[1.4] [Errno 13] Permission denied when running user: other than root #138

Closed
opened 2026-02-14 03:09:38 +01:00 by fatherfork · 3 comments
Contributor

Edit: Updated title. See second comment.

I copied my v1.3.1 data to a new folder with the same permissions, but when starting the pre-1.4 container I get the following error. I've checked permissions and they are identical to the release version data. The referenced directory isn't mapped outside the container.

[2026-02-14 01:59:13 +0000] [1] [INFO] Starting gunicorn 25.0.3
[2026-02-14 01:59:13 +0000] [1] [INFO] Listening at: http://0.0.0.0:3333 (1)
[2026-02-14 01:59:13 +0000] [1] [INFO] Using worker: gevent
[2026-02-14 01:59:13 +0000] [7] [INFO] Booting worker with pid: 7
[2026-02-14 01:59:13 +0000] [7] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/usr/local/lib/python3.14/site-packages/gunicorn/arbiter.py", line 684, in spawn_worker
    worker.init_process()
    ~~~~~~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.14/site-packages/gunicorn/workers/ggevent.py", line 143, in init_process
    super().init_process()
    ~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.14/site-packages/gunicorn/workers/base.py", line 136, in init_process
    self.load_wsgi()
    ~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.14/site-packages/gunicorn/workers/base.py", line 148, in load_wsgi
    self.wsgi = self.app.wsgi()
                ~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.14/site-packages/gunicorn/app/base.py", line 66, in wsgi
    self.callable = self.load()
                    ~~~~~~~~~^^
  File "/usr/local/lib/python3.14/site-packages/gunicorn/app/wsgiapp.py", line 57, in load
    return self.load_wsgiapp()
           ~~~~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.14/site-packages/gunicorn/app/wsgiapp.py", line 47, in load_wsgiapp
    return util.import_app(self.app_uri)
           ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.14/site-packages/gunicorn/util.py", line 377, in import_app
    mod = importlib.import_module(module)
  File "/usr/local/lib/python3.14/importlib/__init__.py", line 88, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1398, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1371, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1342, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 938, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 759, in exec_module
  File "<frozen importlib._bootstrap>", line 491, in _call_with_frames_removed
  File "/app/wsgi.py", line 12, in <module>
    from app import create_app
  File "/app/app.py", line 9, in <module>
    from bricktracker.app import setup_app  # noqa: E402
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/bricktracker/app.py", line 40, in <module>
    from bricktracker.views.purchase_location import purchase_location_page
  File "<frozen importlib._bootstrap>", line 1371, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1342, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 938, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 755, in exec_module
  File "<frozen importlib._bootstrap_external>", line 892, in get_code
  File "<frozen importlib._bootstrap_external>", line 950, in get_data
PermissionError: [Errno 13] Permission denied: '/app/bricktracker/views/purchase_location.py'
[Errno 13] Permission denied: '/app/bricktracker/views/purchase_location.py'
[2026-02-14 01:59:13 +0000] [7] [INFO] Worker exiting (pid: 7)
[2026-02-14 01:59:13 +0000] [1] [ERROR] Worker (pid:7) exited with code 3.
[2026-02-14 01:59:13 +0000] [1] [ERROR] Shutting down: Master
[2026-02-14 01:59:13 +0000] [1] [ERROR] Reason: Worker failed to boot.
Edit: Updated title. See second comment. I copied my v1.3.1 data to a new folder with the same permissions, but when starting the `pre-1.4` container I get the following error. I've checked permissions and they are identical to the release version data. The referenced directory isn't mapped outside the container. ``` [2026-02-14 01:59:13 +0000] [1] [INFO] Starting gunicorn 25.0.3 [2026-02-14 01:59:13 +0000] [1] [INFO] Listening at: http://0.0.0.0:3333 (1) [2026-02-14 01:59:13 +0000] [1] [INFO] Using worker: gevent [2026-02-14 01:59:13 +0000] [7] [INFO] Booting worker with pid: 7 [2026-02-14 01:59:13 +0000] [7] [ERROR] Exception in worker process Traceback (most recent call last): File "/usr/local/lib/python3.14/site-packages/gunicorn/arbiter.py", line 684, in spawn_worker worker.init_process() ~~~~~~~~~~~~~~~~~~~^^ File "/usr/local/lib/python3.14/site-packages/gunicorn/workers/ggevent.py", line 143, in init_process super().init_process() ~~~~~~~~~~~~~~~~~~~~^^ File "/usr/local/lib/python3.14/site-packages/gunicorn/workers/base.py", line 136, in init_process self.load_wsgi() ~~~~~~~~~~~~~~^^ File "/usr/local/lib/python3.14/site-packages/gunicorn/workers/base.py", line 148, in load_wsgi self.wsgi = self.app.wsgi() ~~~~~~~~~~~~~^^ File "/usr/local/lib/python3.14/site-packages/gunicorn/app/base.py", line 66, in wsgi self.callable = self.load() ~~~~~~~~~^^ File "/usr/local/lib/python3.14/site-packages/gunicorn/app/wsgiapp.py", line 57, in load return self.load_wsgiapp() ~~~~~~~~~~~~~~~~~^^ File "/usr/local/lib/python3.14/site-packages/gunicorn/app/wsgiapp.py", line 47, in load_wsgiapp return util.import_app(self.app_uri) ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^ File "/usr/local/lib/python3.14/site-packages/gunicorn/util.py", line 377, in import_app mod = importlib.import_module(module) File "/usr/local/lib/python3.14/importlib/__init__.py", line 88, in import_module return _bootstrap._gcd_import(name[level:], package, level) ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "<frozen importlib._bootstrap>", line 1398, in _gcd_import File "<frozen importlib._bootstrap>", line 1371, in _find_and_load File "<frozen importlib._bootstrap>", line 1342, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 938, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 759, in exec_module File "<frozen importlib._bootstrap>", line 491, in _call_with_frames_removed File "/app/wsgi.py", line 12, in <module> from app import create_app File "/app/app.py", line 9, in <module> from bricktracker.app import setup_app # noqa: E402 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/bricktracker/app.py", line 40, in <module> from bricktracker.views.purchase_location import purchase_location_page File "<frozen importlib._bootstrap>", line 1371, in _find_and_load File "<frozen importlib._bootstrap>", line 1342, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 938, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 755, in exec_module File "<frozen importlib._bootstrap_external>", line 892, in get_code File "<frozen importlib._bootstrap_external>", line 950, in get_data PermissionError: [Errno 13] Permission denied: '/app/bricktracker/views/purchase_location.py' [Errno 13] Permission denied: '/app/bricktracker/views/purchase_location.py' [2026-02-14 01:59:13 +0000] [7] [INFO] Worker exiting (pid: 7) [2026-02-14 01:59:13 +0000] [1] [ERROR] Worker (pid:7) exited with code 3. [2026-02-14 01:59:13 +0000] [1] [ERROR] Shutting down: Master [2026-02-14 01:59:13 +0000] [1] [ERROR] Reason: Worker failed to boot. ```
Author
Contributor

Ok, looks like 1.4 doesn't like running with the docker compose user: variable so that the container does not run as root. Works fine with 1.3.1. Running the pre-1.4 container as root works fine.

Ok, looks like 1.4 doesn't like running with the docker compose `user:` variable so that the container does not run as root. Works fine with 1.3.1. Running the `pre-1.4` container as root works fine.
fatherfork changed title from [1.4] [Errno 13] Permission denied: '/app/bricktracker/views/purchase_location.py' to [1.4] [Errno 13] Permission denied when running user: other than root 2026-02-14 03:35:18 +01:00
Owner

Thanks for reporting this! The issue is now fixed and pushed to the image pre-1.4.

Docker's COPY command preserved the file permissions from the build context. My build locally had some permission issues.

The 1.3.1 image happened to be built on another computer. I added chmod -R a+rX /app to the Dockerfile and it should work with user: in the compose file now.

Thanks for reporting this! The issue is now fixed and pushed to the image `pre-1.4`. Docker's `COPY` command preserved the file permissions from the build context. My build locally had some permission issues. The 1.3.1 image happened to be built on another computer. I added `chmod -R a+rX /app` to the Dockerfile and it should work with `user: ` in the compose file now.
Author
Contributor

Confirmed working with user: set.

Confirmed working with `user:` set.
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: FrederikBaerentsen/BrickTracker#138