Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: Unable to create folder in docker container #3319

Closed
tim-schneider opened this issue Nov 27, 2023 · 6 comments
Closed

[BUG]: Unable to create folder in docker container #3319

tim-schneider opened this issue Nov 27, 2023 · 6 comments
Labels
bug This is a confirmed bug staged Staged for next version

Comments

@tim-schneider
Copy link

Bot Version

v4.1.0

How are you hosting Modmail?

Other

Error Logs

https://www.toptal.com/developers/hastebin

Screenshots

PermissionError: [Errno 13] Permission denied: '/modmailbot/temp' Traceback (most recent call last): File "/modmailbot/bot.py", line 57, in <module> os.mkdir(temp_dir) PermissionError: [Errno 13] Permission denied: '/modmailbot/temp'

Additional Information

With v4.1.0 somehow my docker container has issues letting the Python script creating the temp folder within the modmailbot folder. I did modify the Python image to reflect my OS. And solved the issue with:

@@ -1,4 +1,4 @@
-FROM python:3.10 as py
+FROM arm64v8/python:3.11 as py

 FROM py as build

@@ -13,6 +13,8 @@ COPY --from=build /inst /usr/local

 ENV USING_DOCKER yes
 RUN useradd --system --no-create-home modmail
+RUN mkdir -p /modmailbot/temp
+RUN chown -R modmail:modmail /modmailbot
 USER modmail

 WORKDIR /modmailbot
@tim-schneider tim-schneider added the maybe: bug An unconfirmed bug label Nov 27, 2023
@martinbndr
Copy link
Contributor

For me the logs are empty, can you try getting a new link?
Screenshot_20231128_115532_Chrome

@khakers
Copy link
Contributor

khakers commented Dec 5, 2023

BTW, if you just want to have a docker image for arm, you don't need to change the dockerfile, the current one (in the past, at least) builds on arm with no changes. You can even build directly from the git link without downloading anything.

@tim-schneider
Copy link
Author

BTW, if you just want to have a docker image for arm, you don't need to change the dockerfile, the current one (in the past, at least) builds on arm with no changes. You can even build directly from the git link without downloading anything.

I assume you referencing the ghcr image. I just rented a plain hetzner arm64/v8:

root@debian-4gb-hel1-2:~# docker run -it ghcr.io/modmail-dev/modmail:master
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
docker: Error response from daemon: AppArmor enabled on system but the docker-default profile could not be loaded: running `apparmor_parser apparmor_parser --version` failed with output:
error: exec: "apparmor_parser": executable file not found in $PATH.
ERRO[0000] error waiting for container: context canceled

@tim-schneider
Copy link
Author

For me the logs are empty, can you try getting a new link?

Sorry, there aren't any other logs than what I have provided. Sadly it form did force me to put in a link.

PermissionError: [Errno 13] Permission denied: '/modmailbot/temp' Traceback (most recent call last): File "/modmailbot/bot.py", line 57, in <module> os.mkdir(temp_dir) PermissionError: [Errno 13] Permission denied: '/modmailbot/temp'

@khakers
Copy link
Contributor

khakers commented Dec 8, 2023

No as I said, you just need to build the image on your machine. The python:3.10 image is a multiplatform one with support for linux/arm64/v8. You do not need to modify the dockerfile in any way to get an arm64/v8 build.

Alternatively, modmail could supply a multiplatform image with arm support so this whole song and dance doesn't have to be done.

@sebkuip sebkuip added bug This is a confirmed bug and removed maybe: bug An unconfirmed bug labels Mar 11, 2024
@Taaku18 Taaku18 added the staged Staged for next version label May 15, 2024
@Taaku18
Copy link
Collaborator

Taaku18 commented May 15, 2024

The project's Dockerfile has been updated to fix the issue.

@Taaku18 Taaku18 closed this as completed May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This is a confirmed bug staged Staged for next version
Projects
None yet
Development

No branches or pull requests

5 participants