pretalx / pretalx-docker

Docker setup for a complete pretalx installation. Community-sourced, not officially supported.
34 stars 49 forks source link

PermissionError: [Errno 13] Permission denied: '/public/media' #56

Open d33tah opened 9 months ago

d33tah commented 9 months ago
> sudo docker exec -ti pretalx pretalx init
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/pretalx/src/pretalx/__main__.py", line 9, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python3.10/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python3.10/site-packages/django/core/management/__init__.py", line 382, in execute
    settings.INSTALLED_APPS
  File "/usr/local/lib/python3.10/site-packages/django/conf/__init__.py", line 102, in __getattr__
    self._setup(name)
  File "/usr/local/lib/python3.10/site-packages/django/conf/__init__.py", line 89, in _setup
    self._wrapped = Settings(settings_module)
  File "/usr/local/lib/python3.10/site-packages/django/conf/__init__.py", line 217, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/usr/local/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/pretalx/src/pretalx/settings.py", line 59, in <module>
    directory.mkdir(parents=True, exist_ok=True)
  File "/usr/local/lib/python3.10/pathlib.py", line 1175, in mkdir
    self._accessor.mkdir(self, mode)
PermissionError: [Errno 13] Permission denied: '/public/media'
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/pretalx/src/pretalx/__main__.py", line 9, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python3.10/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python3.10/site-packages/django/core/management/__init__.py", line 382, in execute
    settings.INSTALLED_APPS
  File "/usr/local/lib/python3.10/site-packages/django/conf/__init__.py", line 102, in __getattr__
    self._setup(name)
  File "/usr/local/lib/python3.10/site-packages/django/conf/__init__.py", line 89, in _setup
    self._wrapped = Settings(settings_module)
  File "/usr/local/lib/python3.10/site-packages/django/conf/__init__.py", line 217, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/usr/local/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/pretalx/src/pretalx/settings.py", line 59, in <module>
    directory.mkdir(parents=True, exist_ok=True)
  File "/usr/local/lib/python3.10/pathlib.py", line 1175, in mkdir
    self._accessor.mkdir(self, mode)
PermissionError: [Errno 13] Permission denied: '/public/media'

A workaround I did was sudo docker exec --user 0 -ti pretalx pretalx init, but I hadn't yet verified whether it solves the problem

rixx commented 9 months ago

Happy to merge PRs fixing this problem! As the pretalx docker image is community maintained, I won't have time to look into this myself.

Zaczero commented 9 months ago

I was not able to reproduce the issue. Could you please share more details about your setup? Are you using docker/docker-compose? Do you use docker volumes? Did you follow the production instructions?

d33tah commented 9 months ago

@Zaczero I only cloned it and ran docker-compose up -d.

rixx commented 9 months ago

I was not able to reproduce the issue.

Weird, because I just set up pretalx-docker for the first time in probably five years, literally only ran docker compose up -d and docker exec -ti pretalx pretalx init as instructed by the README, and could reproduce the issue just fine.

Would be nice if somebody could either provide better setup instructions or add the --user 0 workaround to the README.

lujoga commented 9 months ago

The problem seems to be that currently there is no pre-built pretalx/standalone image with a /public directory owned by pretalxuser. This should be fixed as soon as an image based on the updated Dockerfile is released.

rixx commented 9 months ago

There is no new image being released, because the GitHub action for a release ran into a timeout after six hours of … not much happening (cf).

I'll re-run the job, but if that doesn't change anything, somebody will have to fix the build or people will just have to build the image locally.

uebmaster commented 9 months ago

Same issue for me.

PermissionError: [Errno 13] Permission denied: '/public/media'

Thanks in advance.

turbotimon commented 8 months ago

Have faced the same problem (ans still have some open). I made a PR

Happy to merge PRs fixing this problem! As the pretalx docker image is community maintained, I won't have time to look into this myself.

@rixx Happy to make a PR to hopefully imporve UX, as it took me hours to find that out.. Not sure to fix all the problems people facing in this issue but at least it give some hints! #60

(Btw, still facing some issues with pretalx ignoring static path and imho the main docu could also improved, but thats in an other issue in the main repo)

rixx commented 8 months ago

imho the main docu could also improved

pretalx is open source and happy for contributions. Apart from that, it's mostly developed (and documented, and run, …) by me on my own, and the documentation (as well as every other part of the project) being imperfect just comes with the fact that I have limited time and attention. Apologies that it took you hours to find out how to run pretalx – this is probably where I should remind people that there's also the offer of hosted pretalx and/or a support contract for immediate help with problems like that.