Tzahi12345 / YoutubeDL-Material

Self-hosted YouTube downloader built on Material Design
MIT License
2.66k stars 276 forks source link

[BUG] container won't start #1115

Open greenspace10 opened 6 months ago

greenspace10 commented 6 months ago

Describe the bug Installed with latest tag and the following env vars

PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
UID: 1026
GID: 101
USER: youtube
NO_UPDATE_NOTIFIER: true
PM2_HOME: /app/pm2
ALLOW_CONFIG_MUTATIONS: true
npm_config_cache: /app/.npm
NODE_VERSION:  16.14.2
NVM_DIR: /usr/local/nvm
ytdl_mongodb_connection_string: mongodb://ytdl-mongo:27017
ytdl_use_local_db: false
write_ytdl_config: true

results in following errors.

[entrypoint] setup permission, this may take a while

> backend@1.0.0 start
> pm2-runtime --raw pm2.config.js

npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /.npm
npm ERR! errno -13
npm ERR!
npm ERR! Your cache folder contains root-owned files, due to a bug in
npm ERR! previous versions of npm which has since been addressed.
npm ERR!
npm ERR! To permanently fix this problem, please run:
npm ERR!   sudo chown -R 1026:101 "/.npm"

npm ERR! A complete log of this run can be found in:

I switched to the nightly tag with the same env vars. results in the following errors.

[entrypoint] setup permission, this may take a while
error: exec: "npm": executable file not found in $PATH

any help on what I am doing wrong?

further details; I am trying to install this on a Synology NAS (DSM 7.1.1-42962 Update 6) with docker installed, other containers are operating as expected.

spacecake commented 6 months ago

I have the same issue with the latest docker-compose at start. 😢

[entrypoint] setup permission, this may take a while
backend@1.0.0 start
pm2-runtime --raw pm2.config.js
npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /.npm
npm ERR! errno -13

npm ERR! Your cache folder contains root-owned files, due to a bug in
npm ERR! previous versions of npm which has since been addressed.
spreiter commented 6 months ago

I also just installed it on DS918+ with DSM 7.1.1. With latest tag it does not work when using different UID/GID, but nightly was fine.

I only created the necessary folders in advance. Did you try without UID/GID?

Content of my docker-compose.yml:

version: "2"
services:
    ytdl_material:
        environment: 
            UID: 1025
            GID: 100
            ytdl_mongodb_connection_string: 'mongodb://ytdl-mongo-db:27017'
            ytdl_use_local_db: 'false'
            write_ytdl_config: 'true'
        restart: always
        depends_on:
            - ytdl-mongo-db
        volumes:
            - ./appdata:/app/appdata
            - ./audio:/app/audio
            - /volume1/Public/MusicVideos:/app/video
            - ./subscriptions:/app/subscriptions
            - ./users:/app/users
        ports:
            - "8998:17442"
        #image: tzahi12345/youtubedl-material:latest
        image: tzahi12345/youtubedl-material:nightly
    ytdl-mongo-db:
        image: mongo:4
        logging:
            driver: "none"          
        container_name: mongo-db
        restart: always
        volumes:
            - ./db/:/data/db
Monoboy4ik commented 5 months ago

after restart container i see this image

spreiter commented 5 months ago
Error: listen EACCES: permission denied 0.0.0.0:443

Sounds like the container has a problem with the network setup. What settings are you using, @Monoboy4ik ? Are you running in privileged mode, maybe?

Monoboy4ik commented 5 months ago
Error: listen EACCES: permission denied 0.0.0.0:443

Sounds like the container has a problem with the network setup. What settings are you using, @Monoboy4ik ? Are you running in privileged mode, maybe?

I found out that if I change the port in the settings from 17442 to 443 (I use a reverse proxy), then the container does not start

services: ytdl_material: environment:

spreiter commented 5 months ago

I see. But the reverse proxy should allow to map any port to the "outside" world, right? I guess port 443 is restricted and requires additional access rights inside the container. So only when the user would be root, it can work.

Monoboy4ik commented 5 months ago

you're right, I added "privileged: true" but it didn't help

Monoboy4ik commented 5 months ago

I thought that these settings only affect the formation of the correct link to the downloaded file, but it looks like another proxy is trying to rise inside the container...

M-Davies commented 3 months ago

General advice seems to be use nightly image https://github.com/Tzahi12345/YoutubeDL-Material/issues/1034