a1ex4 / ownfoil

Lightweight and customizable Tinfoil Shop manager, with automatic saves backup.
BSD 3-Clause "New" or "Revised" License
311 stars 32 forks source link

Permission Error in logs and WebUI #71

Closed drchino closed 7 months ago

drchino commented 7 months ago

I've deployed v2 on Docker on my Synology but I keep seeing the errors below in the logs:

warning: unable to access '/root/.config/git/ignore': Permission denied warning: unable to access '/root/.config/git/attributes': Permission denied

When I load the WebUI, it gives permission errors there too. See below for more details of those.

I'm running this with the PGID and PUID of 1000, when I've tried my own PGID and PUID it just crashes the container and won't start. I've checked the folder permissions for "Games" on the Synology NAS and they seem fine. I've tried a chown 1000:1000 and can see that this is the owner of the folders now. There are read and write permissions for all users and groups too. Unless I'm wrong, Linux isn't my strong point!

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

`Traceback (most recent call last)

File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 1478, in __call__

return self.wsgi_app(environ, start_response)
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [Open an interactive python shell in this frame] 

File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 1458, in wsgi_app

response = self.handle_exception(e)
           ^^^^^^^^^^^^^^^^^^^^^^^^

File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 1455, in wsgi_app

response = self.full_dispatch_request()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 869, in full_dispatch_request

rv = self.handle_user_exception(e)
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 867, in full_dispatch_request

rv = self.dispatch_request()
     ^^^^^^^^^^^^^^^^^^^^^^^

File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 852, in dispatch_request

return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/app/app.py", line 67, in index

scan_library()
^^^^^^^^^^^^^^

File "/app/app.py", line 181, in scan_library

_, files = getDirsAndFiles(library)
           ^^^^^^^^^^^^^^^^^^^^^^^^

File "/app/titles.py", line 32, in getDirsAndFiles

entries = os.listdir(path)
          ^^^^^^^^^^^^^^^^

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

`

Sev7nrayne commented 7 months ago

Post your docker config / yaml. Was Docker started with root permissions and did you define your /volume in the configs.

drchino commented 7 months ago

Thanks, see below for the details.

services: ownfoil: container_name: ownfoil image: a1ex4/ownfoil:v2 environment:

Sev7nrayne commented 7 months ago

Confirm UID/GUID: https://mariushosting.com/synology-how-to-find-uid-userid-and-gid-groupid/

check if you see "ownfoil.db" in - /volume1/docker/ownfoil:/app/config - that means it has access to r/wr to that folder. If so try moving the "Switch" folder under docker folder

confirm "Switch" folder lower/uppercase naming matches 1:1 check "Switch" folder user permissions ~ root or admin access (same access privilege's as Docker)

drchino commented 7 months ago

Thank you! It turned out to be a permission issue on the games folder. Everything was fine in the docker folder but the Switch folder didn't have the right permissions. I checked through and changed this and everything is working great.

Thanks for you help.

drchino commented 7 months ago

Resolved - user error