Plex plugin no longer starting

    • OMV 3.x
    • Plex plugin no longer starting

      I rebooted my server and ran into these error messages when trying to start plexmediaserver:

      Display Spoiler
      root@*****:/lib/systemd/system# systemctl status plexmediaserver.service
      ● plexmediaserver.service - Plex Media Server for Linux
      Loaded: loaded (/lib/systemd/system/plexmediaserver.service; enabled)
      Active: failed (Result: start-limit) since Tue 2017-01-10 12:59:21 CET; 2min 4s ago
      Process: 18655 ExecStart=/bin/sh -c LD_LIBRARY_PATH=/usr/lib/plexmediaserver /usr/lib/plexmediaserver/Plex\ Media\ Server (code=exited, status=134)
      Process: 18651 ExecStartPre=/bin/sh -c /usr/bin/test -d "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}" || /bin/mkdir -p "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}" (code=exited, status=0/SUCCESS)
      Main PID: 18655 (code=exited, status=134)

      Jan 10 12:59:16 Rufus systemd[1]: Unit plexmediaserver.service entered failed state.
      Jan 10 12:59:21 Rufus systemd[1]: plexmediaserver.service holdoff time over, scheduling restart.
      Jan 10 12:59:21 Rufus systemd[1]: Stopping Plex Media Server for Linux...
      Jan 10 12:59:21 Rufus systemd[1]: Starting Plex Media Server for Linux...
      Jan 10 12:59:21 Rufus systemd[1]: plexmediaserver.service start request repeated too quickly, refusing to start.
      Jan 10 12:59:21 Rufus systemd[1]: Failed to start Plex Media Server for Linux.
      Jan 10 12:59:21 Rufus systemd[1]: Unit plexmediaserver.service entered failed state.
      Jan 10 12:59:33 Rufus systemd[1]: Starting Plex Media Server for Linux...
      Jan 10 12:59:33 Rufus systemd[1]: plexmediaserver.service start request repeated too quickly, refusing to start.
      Jan 10 12:59:33 Rufus systemd[1]: Failed to start Plex Media Server for Linux.


      I noticed that Docker didn't work properly after the reboot, which made me realize that Plex didn't work either. I tried re-installing the plugins, but no success...
    • After reinstalling plexmediaserver-plugin I had the same error with the same error messages. By activating the plugin a folder '/opt/plexcodecs' was created with a symlink 'Codecs' in it. The symlink causes the error. I've deleted this symlink and created a folder called 'Codecs' and changed user and group to 'plex'. After that i could restart plexmediaserver with 'systemctl restart plexmediaserver' and - Voila - everything is running again.

      The reason for this is that the symlink 'Codecs' refers to '<plexmediaserver lib-path>/plexmediaserver/Library/Application Support/Plex Media Server/Codecs/' which is itself a symlink to '/opt/Codecs'. The result is an infinite loop. The wrong symlink in '/opt/plexcodecs/Codecs' was set after activating the openmediavault-plugin. The error is maybe in there.

      Please have in mind as long as this error exist you have to repeat this procedure after each reinstallation.
      omv 3.0.59 erasmus | 64 bit | 4.8 backport kernel | omvextrasorg 3.4.14
    • Here is the line that does that. Should it be removed or changed?
      github.com/OpenMediaVault-Plug…conf/plexmediaserver#L106
      omv 4.1.12 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.11
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!
    • No don't change it. This symlink ist the correct one. Somewhere in the process a symlink ist set, which is the other way around, like

      ln -s "${PLEX_HOME}/Library/Application Support/Plex Media Server/Codecs" "${PLEX_CODECS}/Codecs"

      It looks strange, but it's reproducible on my server by reinstalling the plugin. Last time I installed the plugin was some month ago (I don't know exactly), when I changed to OMV 3.0. At that time the install process of the plugin was ok.
      omv 3.0.59 erasmus | 64 bit | 4.8 backport kernel | omvextrasorg 3.4.14
    • The plex package itself must be adding the other symlink. Maybe the plugin could look for the wrong symlink and remove it.
      omv 4.1.12 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.11
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!
    • I did indeed have the same issue just an hour. But not after the first fresh plex-plugin install a couple days ago.
      The install wouldn't use the shared folder with old plex config on as talked about in another thread though so I tried to fix that and plex wouldn't start this time due to the same error as described above.
      Seems the omv plex-plugin creates the /opt/plexcodecs/Codec symlink and I remember it was in some discussions a while back.
      The symlink ${PLEX_HOME}/Library/Application Support/Plex Media Server/Codecs" "${PLEX_CODECS}/Codecs point to /opt/plexcodecs/Codec which points back to itself so I think the quickest fix is to not create the /opt/plexcodecs/Codec symlink and create a folder there instead.
      In that folder I now have a codec.

      As for the database folder it suddenly started using the shared folder after I copied old .../Plug-in Support/Database/ files to the /var/lib/.../Plug-in Support/Database/ folder and restarted the service in the UI. Not sure how this happened but /var/lib/plexmediaserver/ is now empty and the shared folder is growing so all good I think :)