djdembeck/bragibooks

Won't start on Synology docker Server Error (500)

baloodusudouest opened this issue · 8 comments

Hi,

I try to use your docker but at first start i have this issue

Operations to perform:

  Apply all migrations: auth, contenttypes, importer, sessions

Running migrations:

  No migrations to apply.

[2022-01-08 15:26:41 +0000] [11] [INFO] Starting gunicorn 20.1.0

[2022-01-08 15:26:41 +0000] [11] [INFO] Listening at: http://0.0.0.0:8000 (11)

[2022-01-08 15:26:41 +0000] [11] [INFO] Using worker: gthread

[2022-01-08 15:26:41 +0000] [12] [INFO] Booting worker with pid: 12

[2022-01-08 15:26:41 +0000] [13] [INFO] Booting worker with pid: 13

Internal Server Error: /import/

Traceback (most recent call last):

  File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner

    response = get_response(request)

  File "/usr/local/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response

    response = wrapped_callback(request, *callback_args, **callback_kwargs)

  File "/usr/local/lib/python3.9/site-packages/django/views/generic/base.py", line 70, in view

    return self.dispatch(request, *args, **kwargs)

  File "/usr/local/lib/python3.9/site-packages/django/views/generic/base.py", line 98, in dispatch

    return handler(request, *args, **kwargs)

  File "/usr/local/lib/python3.9/site-packages/django/views/generic/base.py", line 159, in get

    context = self.get_context_data(**kwargs)

  File "/home/app/web/importer/views.py", line 34, in get_context_data

    for path in sorted(

  File "/usr/local/lib/python3.9/pathlib.py", line 1160, in iterdir

    for name in self._accessor.listdir(self):

PermissionError: [Errno 13] Permission denied: '/input'

What i've done wrong? i try to find but i cannot see.

Thanks for your help!

Hello,

The issue can be seen at the very bottom of the log:
PermissionError: [Errno 13] Permission denied: '/input'

Did you map a folder to /input?
https://github.com/djdembeck/bragibooks#docker-1

It's mapped like this

image

do you need more information or logs? don't hesitate

So I've been playing with this for a minute, still working on it but need to go do something so I figured I would put my current findings.

This project actually starts the docker image by first running a chown on the /config, /input and /output paths and assigning them to the 'worker' user. It then executes the start script as that user.

I ssh'd directly into the docker instance and can access the /input directory without issue, as the root user. However if I run a
su worker first and try to cd into that directory I get the permission denied. So for some reason the chown command

image

So for some reason the chown command isn't working as expected, despite the root user having permissions.
I've also created a new user on my machine and granted them admin permissions to the input/output folders and passed those into Docker using the PUID and PGID variables but it made no difference 🤷

Thanks for posting your findings. It's odd that I don't have these permissions issues, so it does work to some extent. I imagine the issues came from this PR: #51

i think that the program don't use the PUID and PGID, and use some random or programed ones, but i have a specific PUID and PGID for docker program, to avoid the access to certain folder for ex.
I think that you need to add the environnement to setup the PUID and PGID to use

Permissions have been reworked and also support -e UID and -e GID for changing from defaults.

and now i have the access!!!!! Thanks @djdembeck
I will try to manage some audiobooks to see if it's all good, but thanks a lot!