Plex plexmediaserver snap "Plex Media Server is already running. Will not start..."

Seems to have broken in revision 101 or 102 (can’t revert that far back to check).

The server fails to start with

Plex Media Server is already running. Will not start...

Running a ps shows that no Plex processes are actually running, so maybe there’s a lockfile left over somewhere. I’ve tried removing the $SNAP_COMMON/tmp directory but I still get the same error.

I’ve tried running with --shell to see that Plex can access everything, which seems it can. I also have the removable-media and raw-usb interfaces connected.

Seems that others have hit it too

Yep, dug around for a bit. I removed

/var/snap/plexmediaserver/common/Library/Application Support/Plex Media Server/

and I can start the server again.

smells like a packaging error (wrong daemon: stanza) but i can not find the snapcraft.yaml they use anywhere :frowning:

I can’t see anything obvious there. You can access it with:

snap download plexmediaserver
unsquashfs ./plexmediaserver*.snap
$EDITOR ./squashfs-root/meta/snap.yaml

I think it’s just that there’s no cleanup of the pid file in the stop hook.

picking the correct daemon option means you hand off pid handling to systemd (as it should be) so no such hooks would be needed …

1 Like

ahh i see! that would be nice because it seems a few people have come across this with the snap.