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

"Permission denied" error running alertwise #83

Open
maaikelimper opened this issue Mar 11, 2025 · 1 comment
Open

"Permission denied" error running alertwise #83

maaikelimper opened this issue Mar 11, 2025 · 1 comment

Comments

@maaikelimper
Copy link

maaikelimper commented Mar 11, 2025

Hi,

when running the latest version of alertwise using the standalone instructions I get the following error , any idea what might be going wrong here?

alertwise                | Traceback (most recent call last):
alertwise                |   File "/alertwise/app/src/alertwise/manage.py", line 15, in <module>
alertwise                | Traceback (most recent call last):
alertwise                |     main()
alertwise                |   File "/alertwise/app/src/alertwise/manage.py", line 15, in <module>
alertwise                |   File "/alertwise/app/src/alertwise/manage.py", line 11, in main
alertwise                |     main()
alertwise                |     execute_from_command_line(sys.argv)
alertwise                |   File "/alertwise/app/src/alertwise/manage.py", line 11, in main
alertwise                |   File "/alertwise/venv/lib/python3.12/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
alertwise                |     execute_from_command_line(sys.argv)
alertwise                |     utility.execute()
alertwise                |   File "/alertwise/venv/lib/python3.12/site-packages/django/core/management/__init__.py", line 436, in execute
alertwise                |   File "/alertwise/venv/lib/python3.12/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
alertwise                |     self.fetch_command(subcommand).run_from_argv(self.argv)
alertwise                |     utility.execute()
alertwise                |   File "/alertwise/venv/lib/python3.12/site-packages/django/core/management/base.py", line 412, in run_from_argv
alertwise                |   File "/alertwise/venv/lib/python3.12/site-packages/django/core/management/__init__.py", line 436, in execute
alertwise                |     self.execute(*args, **cmd_options)
alertwise                |     self.fetch_command(subcommand).run_from_argv(self.argv)
alertwise                |   File "/alertwise/venv/lib/python3.12/site-packages/django/core/management/base.py", line 458, in execute
alertwise                |   File "/alertwise/venv/lib/python3.12/site-packages/django/core/management/base.py", line 412, in run_from_argv
alertwise                |     output = self.handle(*args, **options)
alertwise                |     self.execute(*args, **cmd_options)
alertwise                |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
alertwise                |   File "/alertwise/venv/lib/python3.12/site-packages/django/core/management/base.py", line 458, in execute
alertwise                |   File "/alertwise/venv/lib/python3.12/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 209, in handle
alertwise                |     output = self.handle(*args, **options)
alertwise                |     collected = self.collect()
alertwise                |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
alertwise                |                 ^^^^^^^^^^^^^^
alertwise                |   File "/alertwise/venv/lib/python3.12/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 209, in handle
alertwise                |   File "/alertwise/venv/lib/python3.12/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 135, in collect
alertwise                |     collected = self.collect()
alertwise                |     handler(path, prefixed_path, storage)
alertwise                |                 ^^^^^^^^^^^^^^
alertwise                |   File "/alertwise/venv/lib/python3.12/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 378, in copy_file
alertwise                |   File "/alertwise/venv/lib/python3.12/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 135, in collect
alertwise                |     self.storage.save(prefixed_path, source_file)
alertwise                |     handler(path, prefixed_path, storage)
alertwise                |   File "/alertwise/venv/lib/python3.12/site-packages/django/core/files/storage/base.py", line 49, in save
alertwise                |   File "/alertwise/venv/lib/python3.12/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 378, in copy_file
alertwise                |     name = self._save(name, content)
alertwise                |     self.storage.save(prefixed_path, source_file)
alertwise                |            ^^^^^^^^^^^^^^^^^^^^^^^^^
alertwise                |   File "/alertwise/venv/lib/python3.12/site-packages/django/core/files/storage/base.py", line 49, in save
alertwise                |   File "/alertwise/venv/lib/python3.12/site-packages/django/core/files/storage/filesystem.py", line 87, in _save
alertwise                |     name = self._save(name, content)
alertwise                |     os.makedirs(directory, exist_ok=True)
alertwise                |            ^^^^^^^^^^^^^^^^^^^^^^^^^
alertwise                |   File "<frozen os>", line 225, in makedirs
alertwise                |   File "/alertwise/venv/lib/python3.12/site-packages/django/core/files/storage/filesystem.py", line 87, in _save
alertwise                | PermissionError: [Errno 13] Permission denied: '/alertwise/app/src/alertwise/static/css'
alertwise                |     os.makedirs(directory, exist_ok=True)
alertwise                |   File "<frozen os>", line 225, in makedirs
alertwise                | PermissionError: [Errno 13] Permission denied: '/alertwise/app/src/alertwise/static/css'
alertwise_celery_beat    | [INFO  wait] Host [alertwise:8000] not yet available...
alertwise_celery_worker  | [INFO  wait] Host [alertwise:8000] not yet available...
@maaikelimper maaikelimper changed the title error running alertwise "Permission denied" error running alertwise Mar 12, 2025
@maaikelimper
Copy link
Author

maaikelimper commented Mar 12, 2025

This error is a result of the the folders being owned by the root-user when running docker compose up -d for the first time:

total 16K
drwxr-xr-x  2 root root 4.0K Mar 11 21:54 backup
drwx------ 19  999 root 4.0K Mar 12 09:05 db
drwxr-xr-x  2 root root 4.0K Mar 11 21:54 media
drwxr-xr-x  2 root root 4.0K Mar 11 21:54 static

The troubleshooting instructions in the README.md indicate that the user needs to change permissions when this error occurs:
Static/media/backup volume permission errors: The same as above, ensure the STATIC_VOLUME_PATH, MEDIA_VOLUME_PATH, and BACKUP_VOLUME_PATH are correctly set and the user running the alertwise containers has the correct permissions to read and write to these volume paths. This is the user set by the UID and GID environment. Set the correct permissions by running sudo chown -R <UID>:<GID> ./path/to/volume, for all the volumes.

Would it be possible to update the install instructions to prevent this error , for example by telling the user to ensure the directories are created before initializing the docker compose stack ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant