steefdebruijn / docker-roonserver

RoonServer downloading Roon on first run
99 stars 26 forks source link

Issue with updating CORE using internal updater #8

Closed xthursdayx closed 3 years ago

xthursdayx commented 3 years ago

Based on my experience and what I've heard from a number of other users it sounds like updating Roon using the internal updater does not work. I'm not sure if that is a result of an error in Roon itself, but I suspect that it is a result of running it in a Docker container. I just backed up my library and then updated to Roon Version 7.1 (build 667) using the internal updater. Once Roon Remote on my Mac and Roon Core (on my server) rebooted I was forced to sign again and connect to my Roon Core as if this was the first time I'd done so. I tried to restore my library in the options only to find that my Roon Core had disappeared after I relaunched it once the restore was finished. I accidentally deleted the docker log along with the container when I reinstalled Roon, but the I saw that I was getting the following error message" /app/RoonServer/start.sh: line 50: /app/RoonServer/Server/RoonServer: Permission denied

Have you run into this error when trying to update Roon?

dkerlee commented 3 years ago

This docker is installed on unRaid Version: 6.8.3 I've consistently had this issue each time for the previous five minor (?I think), and one major update. I start the update via Roon client on laptop. After the update completes, client fails to connect. When I re-connect, I'm prompted to re-enter all my credentials and library is gone. the log at this point pastebin Restore from backup (build 610 stable) Roon restarts, and fails to launch with following log at pastebin

Go to restart docker via unRaid, this this error in log /app/RoonServer/start.sh: line 50: /app/RoonServer/Server/RoonServer: Permission denied /app/RoonServer/start.sh: line 34: kill: (11) - No such process and Roon-server icon comes up with a red square, will not start.

Remove Docker, image, and appdata, re-install docker. Attempting to restore from Backup, also yields same failure as above. Need to re-remove docker image, and associated appdata, rebuild library.

imgur album of screenshots

steefdebruijn commented 3 years ago

Hi,

This issue is reported before. For an unknown reason (unknown by me) the core updater does not work on unraid installations. I have no knowledge and/or resources to investigate this.

I do know the updater works on 'normal' docker installations present on manual installations (like mine) and several NAS installations (like Qnap and Synology)

It seems unraid does some nasty things with volume permissions. What you could try is use a docker volume for the application that is downloaded instead of a bind-mount volume (which is mapped to the host filesystem). My hope is that this bypasses this permissions problem, so

docker run [...] -v roon-app:/app [...] docker-roonserver

instead of

docker run [...] -v /path/to/storage/for/roon-app:/app [...] docker-roonserver

Please report back

Steef

xthursdayx commented 3 years ago

Hi Steef, Thanks a lot for getting back to us about this, and apologies for bringing up an old issues; I didn't see it in the closed issues here on Github. I will look into using a docker volume instead of a mounted volume to see if that fixes the issue, hopefully so.

In terms of permissions, I know that many things related to Docker in Unraid run using the user:group nobody:users, so it could be that updating changes /app permissions making them inaccessible to Roon, though I don't know why that should happen, since the image is able to create and run a container on Unraid at install.

If it's of any use, this is the the docker create command that Unraid runs based on my template (with my own directory variables listed).

docker create --name='RoonServer' --net='host' -e TZ="America/New_York" -e HOST_OS="Unraid" -v '/mnt/cache/appdata/roonserver/':'/app':'rw' -v '/mnt/cache/appdata/roonserver/':'/data':'rw' -v '/mnt/user/Media/Music_library/':'/music':'rw' -v '/mnt/user/Backup/Roon_Backup/':'/backup':'rw' 'steefdebruijn/docker-roonserver' 
xthursdayx commented 3 years ago

For anyone dealing with this issue on Unraid, I've made a thread about the issue in the Unraid forums, here: https://forums.unraid.net/topic/98298-docker-container-permissions-issue-after-internal-update/

steefdebruijn commented 3 years ago

I think I see what the problem is.

The volumes mapped by unraid are duplicate for the /app and /data volumes. Therein are overlapping folders.

Please configure different host folders for all four container volumes. One way to do that is using the docker volume I suggested earlier.

Please try and report back any findings

Regards Steef

xthursdayx commented 3 years ago

Those volume mappings were manually set up. I set them up like that so that I could just have one main folder associated with Roon's config and data files. I can re-map to separate folders, but to be clear, Roon Server works fine until we try to update.

Is there a reason that /data and /app can't write into the same host folder?

The /mnt/cache/appdata/roonserver/ directory has the following sub-folders currently: /RAATServer /RoonGoer /RoonServer. I see that both /data and /app should have a sub-folder called /RoonServer but it doesn't seem that they contain the same sub-directories and items, so I'm not sure what they would be overwriting... I could be wrong though.

steefdebruijn commented 3 years ago

With these settings the app and data files are mixed in one and the same subfolder. Data is managed by the core and app is managed by the core updater.

And because only Roon team knows how the updater works and this setup unveils problems on updates I suggest that you separate the two and find out if this solves the update problem.

xthursdayx commented 3 years ago

Interesting. I've now separated the two directories and rebuilt my Roon library. I guess we'll have to wait until the Roon folks release another update to see if that fixed the issue. However, I suspect you may be right about that being the problem, if people on other Linux distros are able to update through this docker container with no trouble using the correct volume mappings.

When I made my template for UNRAID, I just reproduced the volume mappings people were already manually using on UNRAID, without considering that this might be a problem, since everything seemed to work fine until updating. Hopefully the new mappings will solve the problem and I can update my template in UNRAID's CommunityApps repository.

Thanks for your help troubleshooting!

steefdebruijn commented 3 years ago

Please let me know here if this turns out to be the solution. I can enhance the documentation with this info and try to add a check to the run script.

xthursdayx commented 3 years ago

Sorry for the long delay, now that Roon just updated to 1.7 (Build 710) I was able to try updating with the new directory mappings and things worked perfectly. I've updated my UNRAID template accordingly. Cheers!