nbr23 / youtube-dl-server

Web / REST interface for downloading youtube videos onto a server.
MIT License
240 stars 34 forks source link

Permissions #120

Open Chris230291 opened 1 month ago

Chris230291 commented 1 month ago

Hello. Thanks for making this. I am struggling with permissions, though.

docker create \
--name=YouTube-DL \
--restart=unless-stopped \
-p 8082:8080 \
--user 1000:1000 \
-v /mnt/storage/Downloads/YouTube-DL:/youtube-dl \
nbr23/youtube-dl-server:latest

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/src/app/./youtube-dl-server.py", line 7, in <module>
    from ydl_server.db import JobsDB
  File "/usr/src/app/ydl_server/db.py", line 5, in <module>
    from ydl_server.config import app_config
  File "/usr/src/app/ydl_server/config.py", line 85, in <module>
    app_config = load_config()
                 ^^^^^^^^^^^^^
  File "/usr/src/app/ydl_server/config.py", line 66, in load_config
    copy_default_config(config_file_path)
  File "/usr/src/app/ydl_server/config.py", line 41, in copy_default_config
    raise Exception(
Exception: Error copying default config file to /app_config/config.yml:
[Errno 13] Permission denied: '/app_config/config.yml'
Using configuration file /app_config/config.yml
/app_config/config.yml does not exist, creating it from default values
Traceback (most recent call last):
  File "/usr/src/app/ydl_server/config.py", line 39, in copy_default_config
    shutil.copy("./default_config.yml", config_file_path)
  File "/usr/local/lib/python3.12/shutil.py", line 435, in copy
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/usr/local/lib/python3.12/shutil.py", line 262, in copyfile
    with open(dst, 'wb') as fdst:
         ^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied: '/app_config/config.yml'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/src/app/./youtube-dl-server.py", line 7, in <module>
    from ydl_server.db import JobsDB
  File "/usr/src/app/ydl_server/db.py", line 5, in <module>
    from ydl_server.config import app_config
  File "/usr/src/app/ydl_server/config.py", line 85, in <module>
    app_config = load_config()
                 ^^^^^^^^^^^^^
  File "/usr/src/app/ydl_server/config.py", line 66, in load_config
    copy_default_config(config_file_path)
  File "/usr/src/app/ydl_server/config.py", line 41, in copy_default_config
    raise Exception(
Exception: Error copying default config file to /app_config/config.yml:
[Errno 13] Permission denied: '/app_config/config.yml'
Using configuration file /app_config/config.yml
/app_config/config.yml does not exist, creating it from default values
Traceback (most recent call last):
  File "/usr/src/app/ydl_server/config.py", line 39, in copy_default_config
    shutil.copy("./default_config.yml", config_file_path)
  File "/usr/local/lib/python3.12/shutil.py", line 435, in copy
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/usr/local/lib/python3.12/shutil.py", line 262, in copyfile
    with open(dst, 'wb') as fdst:
         ^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied: '/app_config/config.yml'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/src/app/./youtube-dl-server.py", line 7, in <module>
    from ydl_server.db import JobsDB
  File "/usr/src/app/ydl_server/db.py", line 5, in <module>
    from ydl_server.config import app_config
  File "/usr/src/app/ydl_server/config.py", line 85, in <module>
    app_config = load_config()
                 ^^^^^^^^^^^^^
  File "/usr/src/app/ydl_server/config.py", line 66, in load_config
    copy_default_config(config_file_path)
  File "/usr/src/app/ydl_server/config.py", line 41, in copy_default_config
    raise Exception(
Exception: Error copying default config file to /app_config/config.yml:
[Errno 13] Permission denied: '/app_config/config.yml'
Using configuration file /app_config/config.yml
/app_config/config.yml does not exist, creating it from default values
Traceback (most recent call last):
  File "/usr/src/app/ydl_server/config.py", line 39, in copy_default_config
    shutil.copy("./default_config.yml", config_file_path)
  File "/usr/local/lib/python3.12/shutil.py", line 435, in copy
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/usr/local/lib/python3.12/shutil.py", line 262, in copyfile
    with open(dst, 'wb') as fdst:
         ^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied: '/app_config/config.yml'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/src/app/./youtube-dl-server.py", line 7, in <module>
    from ydl_server.db import JobsDB
  File "/usr/src/app/ydl_server/db.py", line 5, in <module>
    from ydl_server.config import app_config
  File "/usr/src/app/ydl_server/config.py", line 85, in <module>
    app_config = load_config()
                 ^^^^^^^^^^^^^
  File "/usr/src/app/ydl_server/config.py", line 66, in load_config
    copy_default_config(config_file_path)
  File "/usr/src/app/ydl_server/config.py", line 41, in copy_default_config
    raise Exception(
Exception: Error copying default config file to /app_config/config.yml:
[Errno 13] Permission denied: '/app_config/config.yml'
nbr23 commented 1 month ago

Hi @Chris230291,

Sorry for the late response and thanks for the report! It should now be fixed, let me know if you still have issues!

Cheers,

Chris230291 commented 1 month ago

Unfortunately not. I have to run it without the --user option for it to work.

nbr23 commented 1 month ago

Did you pull the latest image? Are you seeing the exact same error? I would expect at least a different error now.