`docker restart` forgets my server
ptarjan opened this issue · 5 comments
Output of docker inspect plex --format='{{index .Config.Labels.version}}'
:
1.18.2.2058-armhf
Description
When I update my docker image I lose all my configuration (library locations, etc.). I think it has something to do with needing PLEX_CLAIM
as an environment variable?
Steps to reproduce the issue:
docker-compose pull
docker-compose down
docker-compose up -d
Describe the results you received:
A new claim page when I visit <my_ip>:32400
Describe the results you expected:
The same config I had before I updated
Additional information you deem important (e.g. issue happens only occasionally):
Thank you for reporting this issue.
If you find this product useful, please consider donating. You can also support this by watching ads on https://utip.io/femtopixel as much as you like.
I think you should post your docker-compose.yaml
file to be sure how your container was set.
This stated, I'm pretty sure this is surely not related to PLEX_CLAIM
environment variable and you forgot to set your configuration path as as volume (https://github.com/jaymoulin/docker-plex#configuration : mount your Plex Library
to /root/Library).
Note: you don't have to docker-compose down
to update, docker-compose pull && docker-compose up -d
does that job for you.
Thanks for taking a look at the issue and for teaching me a thing or two about docker-compose
.
My docker-compose.yaml
is as follows:
$ cat docker-compose.yml
version: '3.3'
services:
plex:
container_name: plex
restart: always
network_mode: host
environment:
- TZ=America/Los_Angeles
volumes:
- '/home/plex:/root/Library'
- '/mnt/data/Transcode:/transcode'
- '/mnt/data:/media'
image: jaymoulin/plex
And I do think it is working since the files seem to be written
$ ls -al /home/plex/Application\ Support/Plex\ Media\ Server/
total 48
drwxr-xr-x 10 root root 4096 Nov 30 18:40 .
drwxr-xr-x 3 root root 4096 Nov 29 16:47 ..
drwxr-xr-x 4 root root 4096 Nov 30 18:31 Cache
drwxr-xr-x 3 root root 4096 Nov 29 16:47 Codecs
drwxr-xr-x 3 root root 4096 Nov 29 16:47 'Crash Reports'
drwxr-xr-x 3 root root 4096 Nov 30 18:40 Logs
drwxr-xr-x 3 root root 4096 Nov 29 20:15 Media
drwxr-xr-x 4 root root 4096 Nov 29 20:18 Metadata
-rw-r--r-- 1 root root 1 Nov 29 20:22 plexmediaserver.pid
drwxr-xr-x 2 root root 4096 Nov 29 16:47 Plug-ins
drwxr-xr-x 7 root root 4096 Nov 29 16:47 'Plug-in Support'
-rw------- 1 root root 982 Nov 30 18:40 Preferences.xml
Does your plex need to be re-claimed on upgrade?
Interesting. I do have a similar docker-compose.yml
file but I can't reproduce your issue:
$ cat docker-compose.yml
version: "3.4"
services:
plex:
image: "jaymoulin/plex"
volumes:
- /mnt/usbdrive:/media
- /mnt/usbdrive/var/plex:/root/Library
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
network_mode: host
restart: always
As your file are existing in your host drive, this should be working and your PMS should not need to be reclaimed. Is your PMS linked to a plex account?
Interesting that yours works. Did you try downgrading and upgrading the image (can you do that with docker-compose
?). I recently added PLEX_CLAIM
to my environment variables as suggested by some online guides (https://github.com/plexinc/pms-docker#host-networking most notably) and I can restart the container without problems now, but I haven't tried to update it yet since you haven't released a new images since I last pulled.
And yes, it should be claimed. Is there a way to check? When I log into plex.tv
or on my other plex apps I see the server and the content.
I never added PLEX_CLAIM
environment to my container. As far as I understand, this environment var is created by PMS when requesting, and its value is added then added in Preferences.xml
in the Library folder (the reason I thought your volume was not mounted) (source: https://forums.plex.tv/t/plexpass-tag-and-plex_claim/172669).
You can downgrade your plex version by specifying which version to use in the docker-compose.yml
file, image line (eg image: jaymoulin/plex:1.9.7
). Then docker-compose up -d
will pull the downgraded image, destroy the actual plex container and recreate a new one.
Not specifying version will use the latest
tag, which will allow you to use docker-compose pull
to download the latest release and docker-compose up -d
to recreate the container using the latest image (or docker-compose pull && docker-compose up -d
as I like to use (command I put in a crontab to automatically update my container))
If you're logged in plex application and see your PMS, then it should be OK.