-
Notifications
You must be signed in to change notification settings - Fork 19
Description
Is there an existing issue for this?
- I have searched the existing issues and added correct labels.
Description
When building a custom container image for the ayon-kitsu processor service , worker fails to start the processor service and exits with a PermissionError.
Steps To Reproduce:
Reproduction Steps
-
Create a Dockerfile that builds a custom version of the processor service.
-
Add or patch files (e.g., patching gazu to fix token authentication or event namespace connection).
-
Copy the processor folder using COPY processor /service/processor after setting up permissions and user.
-
Build and run the image.
-
Deploy it with sync or run it locally.
Root Cause
In the original Dockerfile, the COPY processor /service/processor command is executed after the ownership and permission changes:
RUN chown ayonuser:ayonuser -R /service
RUN chmod 777 -R /service
COPY processor /service/processor # This line overwrites previous permissionsThis causes /service/processor/ and its contents to be owned by root, leading to PermissionError when tries to import the module as the unprivileged ayonuser.
✅ Recommended Fix
Reorder the Dockerfile to copy the processor before setting permissions, like so:
COPY processor /service/processor
RUN chown -R ayonuser:ayonuser /service \
&& chmod -R a+rX /serviceThis ensures that the copied files are accessible by the ayonuser, avoiding the PermissionError.
Additional context:
Version
ayon-kitsu-processor:1.2.5
Based on python:3.11-alpine3.18
Relevant log output:
2025-06-26 17:24:05 WARNING ash processor exited with code 1
2025-06-26 17:24:07 INFO ash Starting processor kitsu:1.2.5/processor (image: custom/ayon-kitsu-processor:1.2.5)
Traceback (most recent call last):
File "<frozen runpy>", line 189, in _run_module_as_main
File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
File "<frozen importlib._bootstrap_external>", line 1130, in get_data
PermissionError: [Errno 13] Permission denied: '/service/processor/__init__.py'