RandomNinjaAtk / arr-scripts

Extended Container Scripts - Automation scripts to make life easier!
GNU General Public License v3.0
659 stars 66 forks source link

[BUG] - LIDARR - Changing permissions of beets files to those other than the container user #231

Open krankydonkey opened 5 months ago

krankydonkey commented 5 months ago

Application Lidarr

Host platform podman on ubuntu server 22.04

Script BeetsTagger.bash ArtworkExtractor.bash LyricExtractor.bash

Script Version latest

Describe the bug I have created a secondary user and group on Ubuntu called media (1001:1001). The lidarr container is run with the command below, and sets the PUID and PGID environment variables to the media user/group. Lidarr creates its standard config files with these owners, but all files created by download script and all extended scripts still have owner 1000:1000. I have to chown them to get them to work. However, when downloading new content the scripts will keep changing the beets-library.blb and beets.log files to 1000:1000, and then lidarr shows errors:

For each of the scripts listed above

Podman run command:

podman run \ --name=lidarr \ --detach \ -e PUID=$MEDIA_UID \ -e PGID=$MEDIA_GID \ -e UMASK=002 \ -e TZ=Australia/Brisbane \ -p 8686:8686 \ -v /etc/localtime:/etc/localtime:ro \ -v /nas/apps/lidarr/config:/config \ -v /nas/apps/lidarr/custom-services.d:/custom-services.d \ -v /nas/apps/lidarr/custom-cont-init.d:/custom-cont-init.d \ -v /nas/data:/data \ linuxserver/lidarr:latest

hockeygoalie35 commented 5 months ago

Have you tried starting the container as 1001 (the docker run command)?

On Sun, Apr 7, 2024 at 11:49 PM krankydonkey @.***> wrote:

Application Lidarr

Host platform podman on ubuntu server 22.04

Script BeetsTagger.bash ArtworkExtractor.bash LyricExtractor.bash

Script Version latest

Describe the bug I have created a secondary user and group on Ubuntu called media (1001:1001). The lidarr container is run with the command below, and sets the PUID and PGID environment variables to the media user/group. Lidarr creates its standard config files with these owners, but all files created by download script and all extended scripts still have owner 1000:1000. I have to chown them to get them to work. However, when downloading new content the scripts will keep changing the beets-library.blb and beets.log files to 1000:1000, and then lidarr shows errors:

  • jq: error: writing output failed: Broken pipe

For each of the scripts listed above

Podman run command:

podman run --name=lidarr --detach -e PUID=$MEDIA_UID -e PGID=$MEDIA_GID -e UMASK=002 -e TZ=Australia/Brisbane -p 8686:8686 -v /etc/localtime:/etc/localtime:ro -v /nas/apps/lidarr/config:/config -v /nas/apps/lidarr/custom-services.d:/custom-services.d -v /nas/apps/lidarr/custom-cont-init.d:/custom-cont-init.d -v /nas/data:/data linuxserver/lidarr:latest

— Reply to this email directly, view it on GitHub https://github.com/RandomNinjaAtk/arr-scripts/issues/231, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB3GBTN3YHJHKJYRMZLLSZTY4IHVLAVCNFSM6AAAAABF35NKKWVHI2DSMVQWIX3LMV43ASLTON2WKOZSGIZTAMJZGQZTAOI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

hockeygoalie35 commented 5 months ago

Actually you know what, try adding —user 1001:1001. The environmental variables are just for LiDARR, maybe not the base OS running in the container.

krankydonkey commented 5 months ago

Unfortunately that seems to break lidarr. To get the initial lidarr environment working with the media user, I had to chown the config and data directories with:

podman unshare chown -R $MEDIA_UID:$MEDIA_GID /nas

the files show up with permissions of 101000:101000 when I run ls -l as the default user

hockeygoalie35 commented 5 months ago

Unfortunately that seems to break lidarr. To get the initial lidarr environment working with the media user, I had to chown the config and data directories with:

podman unshare chown -R $MEDIA_UID:$MEDIA_GID /nas

the files show up with permissions of 101000:101000 when I run ls -l as the default user

Sorry just to confirm, are you executing the docker run command with the default user, or the media user?

PapaBearDoes commented 4 months ago

I can confirm that "user: 1001:1001" does indeed break the Lidarr container (I use Linuxserver.io's container). I didn't grab the error specifically when it occurred, sorry for that.

I was getting file permissions errors, but I don't specifically remember what exactly was occurring, just that I attempted to use the "user: 1001:1001" thinking it might help.

In Lidarr under Settings -> Media Management -> Permissions you can set the CHOWN group (I ultimately used the group number (1001) instead of the name as the name was causing other issues).

RandomNinjaAtk commented 3 months ago

The files in the final destination are managed by lidarr and permissions/ownership would be set by the application.

All other files are just a means of doing the work and are mostly meant to be temporary at best… So if the files do not have the correct permission in the final destination, which is managed by lidarr, it would either be a user configuration error or upstream issue…