YoutubeDL-Material: Permissions error on appdata directory when mounting with non-relative path

I’m trying to mount the /app/appdat path to a full folder path, rather than the relative one that is noted in the sample docker compose file. When I do so, I’m getting a permissions error, even though I’m running the container with correctly-permissioned UID/GID set in the environment section of the compose yml. I use full paths for config-related volumes in Docker because it allows me to use SSD to host the content vs. whatever the first Synology volume on the system is using (default, usually HDD).

I gave even tried setting UID to an admin-level one, without success. I will note, every other container I use actuallly expects PUID and PGID instead of this one using just UID and GID.

version: "2"
services:
    ytdl_material:
        environment: 
            ytdl_use_local_db: 'true'
            write_ytdl_config: 'true'
            UID: my_actual_uid
            GID: my_actual_gid
        restart: always
        volumes:
            - /volume3/dockerssd/ytdl/appdata:/app/appdata
            - /volume3/dockerssd/ytdl/audio:/app/audio
            - /volume2/media/download/ytdl:/app/video
            - /volume3/dockerssd/ytdl/subscriptions:/app/subscriptions
            - /volume3/dockerssd/ytdl/users:/app/users
        ports:
            - "8998:17442"
        image: tzahi12345/youtubedl-material:latest

This is on Docker running on Synology. It was working perfectly before, but seems to have died overnight and I can’t get past this error,

2023-05-19T17:18:52: PM2 log: App [YoutubeDL-Material:0] exited with code [1] via signal [SIGINT]
2023-05-19T17:18:52: PM2 log: App [YoutubeDL-Material:0] starting in -fork mode-
2023-05-19T17:18:52: PM2 log: App [YoutubeDL-Material:0] online
Error: EACCES: permission denied, mkdir 'appdata/logs'
    at Object.mkdirSync (node:fs:1336:3)
    at File._createLogDirIfNotExist (/app/node_modules/winston/lib/winston/transports/file.js:691:10)
    at new File (/app/node_modules/winston/lib/winston/transports/file.js:92:28)
    at Object.<anonymous> (/app/logger.js:17:7)
    at Module._compile (node:internal/modules/cjs/loader:1103:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at Module.Hook._require.Module.require (/usr/local/lib/node_modules/pm2/node_modules/require-in-the-middle/index.js:101:39) {
  errno: -13,
  syscall: 'mkdir',
  code: 'EACCES',
  path: 'appdata/logs'
}

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 22 (2 by maintainers)

Most upvoted comments

Further testing

Reverting the container to the 4.2 tag resulted in no issues whatsoever, so this “permissions error” seems like a false positive, or is being triggered by new code, at least. Upgrading that from 4.2 to 4.3 also resulted in no issues. Upgrading that to 4.3.1 resulted in the original issue. So until this is resolved, impacted users can set their docker compose like this, to “stick” to the last known working version.

image: tzahi12345/youtubedl-material:4.3

I’ll take a look at the PR’s in 4.3.1 to see if something jumps out at me, but hopefully the above helps the devs. Or not, 227 commits is a high bar for someone with my admittedly weak dev skills to audit efficiently.

So it just restart without log anything? This become kinda hard to tell, as I can’t replicate startup failure, if it fails to set permission correctly, I can replicate it. The script in fact line up with v4.3 🤔 can you start only the application docker compose up ytdl_material

thanks.

Got it working.

I needed to chown entrypoint.sh to my running user, because I’d copied it to the NAS via SMB. I ended up grabbing the version of it directly from the zip for 4.3, just in case it was a wonky formatting/encoding issue from copy/pasted from here. This does come up now, on 4.3.1, with the override to entrypoint.sh. Thanks for the tip. I’ll stay on 4.3.1 until the regression fix is merged in to nightly, presuming that’ll close this thread.