Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
marciogranzotto opened this issue Sep 21, 2023 · 3 comments
Closed

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

marciogranzotto opened this issue Sep 21, 2023 · 3 comments
Labels
stale There has not been activity on this issue or PR for quite some time.

Comments

@marciogranzotto
Copy link
Contributor

marciogranzotto commented Sep 21, 2023

Problem/Motivation

Usually after a non-graceful reboot, like after a power outage, my plex add-on refuses too start.
This seems to be because of a plexmediaserver.pid file that doesn't get deleted.

Expected behavior

Start normally

Actual behavior

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service base-addon-banner: starting
-----------------------------------------------------------
 Add-on: Plex Media Server
 Recorded media, live TV, online news, and podcasts ready to stream.
-----------------------------------------------------------
 Add-on version: 3.3.0
 You are running the latest version of this add-on.
 System: Home Assistant OS 10.5  (amd64 / generic-x86-64)
 Home Assistant Core: 2023.9.2
 Home Assistant Supervisor: 2023.09.2
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
s6-rc: info: service base-addon-banner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service base-addon-timezone: starting
s6-rc: info: service base-addon-log-level: starting
s6-rc: info: service fix-attrs successfully started
[10:56:34] INFO: Configuring timezone (America/Sao_Paulo)...
s6-rc: info: service base-addon-log-level successfully started
s6-rc: info: service base-addon-timezone successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service init-plex: starting
s6-rc: info: service init-plex successfully started
s6-rc: info: service plex: starting
s6-rc: info: service plex successfully started
s6-rc: info: service legacy-services: starting
[10:56:34] INFO: Starting the Plex Media Server...
Plex Media Server is already running. Will not start...
[10:56:34] INFO: Service Plex Media Server exited with code 1 (by signal 0)
s6-rc: info: service legacy-services successfully started
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service plex: stopping
s6-rc: info: service plex successfully stopped
s6-rc: info: service init-plex: stopping
s6-rc: info: service init-plex successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service base-addon-timezone: stopping
s6-rc: info: service base-addon-log-level: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service base-addon-timezone successfully stopped
s6-rc: info: service base-addon-log-level successfully stopped
s6-rc: info: service base-addon-banner: stopping
s6-rc: info: service base-addon-banner successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped

Steps to reproduce

Force reboot your HA machine.

Proposed changes

Deleting the plexmediaserver.pid file makes the add-on start properly.
I think the start script should check if that exists, if it does, try to kill plexmediaserver.pid and delete the file

For reference: linuxserver/docker-plex#134 (comment)

@s-ol
Copy link

s-ol commented Oct 10, 2023

Same issue here. I'm not familiar with s6 and it seems the pidfile (or whatever the equivalent is) is not called that, so I've been unable to solve this without uninstalling, reinstalling, and reconfiguring the plugin from scratch so far, which is very annoying.

Edit: seems like deleting /run/service/.s6-linux-init-shutdownd:plex:* and the whole /run/s6-rc:s6-rc-init:* directory did the trick. Of course since the container won't start you can't really do that, so the only way I found was to find the container's diff directory (docker inspect addon_xxxx_plex, look for GraphDriver/Data/UpperDir), which is something like /mnt/docker/overlay2/<hash>/diff and delete the files from there. You'll need root on the host system for this.

Copy link

There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues.
Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!

@github-actions github-actions bot added the stale There has not been activity on this issue or PR for quite some time. label Nov 10, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 17, 2023
@marciogranzotto
Copy link
Contributor Author

Actually, the fix is already merged in. Haven't seen this issue anymore.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
stale There has not been activity on this issue or PR for quite some time.
Projects
None yet
Development

No branches or pull requests

2 participants