Welcome to our forums! Please take a few moments to read through our Community Guidelines (also conveniently linked in the header at the top of each page). There, you'll find guidelines on conduct, tips on getting the help you may be searching for, and more!

plexmediaserver service sometimes doesn't start on boot

gmartinrgmartinr Posts: 4Members

I have Fedora 16 installed on my PC.

 

My version of plexmediaserver is the following:

 

plexmediaserver-0.9.7.22.510-8faeab3.x86_64
 

I have configured plexmediaserver to start when I boot my PC

 systemctl enable plexmediaserver.service

 

 

But sometimes when I boot my PC plexmediaserver service doesn't start.

 

[root@xxxx ~]# service plexmediaserver status

plexmediaserver.service - Plex Media Server for Linux
 Loaded: loaded (/lib/systemd/system/plexmediaserver.service; enabled)
 Active: failed since Thu, 25 Apr 2013 20:48:47 +0200
Process: 1404 ExecStart=/bin/sh -c /usr/lib/plexmediaserver/Plex\ Media\ Server (code=exited, status=255)
Process: 1294 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)
 CGroup: name=systemd:/system/plexmediaserver.service
[root@xxxx ~]# 
 
 
When this happens I have to start plexmediaserver manually.
 
Anyone knows how to solve the problem?
 
Thanks.
«13

Comments

  • TrudgeTrudge Gone off to greener pastures.... Posts: 9,360Members ✭✭✭
    edited April 2013
    gmartinr wrote on April 25 2013, 5:59 PM: »

    I have Fedora 16 installed on my PC.

    My version of plexmediaserver is the following:

    plexmediaserver-0.9.7.22.510-8faeab3.x86_64
     

    I have configured plexmediaserver to start when I boot my PC

     systemctl enable plexmediaserver.service

    But sometimes when I boot my PC plexmediaserver service doesn't start.

    [root@xxxx ~]# service plexmediaserver status

    plexmediaserver.service - Plex Media Server for Linux
     Loaded: loaded (/lib/systemd/system/plexmediaserver.service; enabled)
     Active: failed since Thu, 25 Apr 2013 20:48:47 +0200
    Process: 1404 ExecStart=/bin/sh -c /usr/lib/plexmediaserver/Plex\ Media\ Server (code=exited, status=255)
    Process: 1294 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)
     CGroup: name=systemd:/system/plexmediaserver.service
    [root@xxxx ~]# 
     
     
    When this happens I have to start plexmediaserver manually.
     
    Anyone knows how to solve the problem?
     
    Thanks.

    can you check dmesg, the systemd log and the console log...and even a copy of the Plex Media Server.log straight after startup when it hasn't started for any errors?

    http://wiki.plexapp.com/index.php/PlexNine_Tips_and_Tricks#Plex_Log_Files

    My guess is it is trying to start and failing (maybe grabbing data from mounted drives that are slow to mount etc)

  • gmartinrgmartinr Posts: 4Members
    Here are the logs.

    [attachment=16516:demsg.log]

    [attachment=16517:dlna.log]

    [attachment=16518:Plex.log]

    [attachment=16519:systemd_debug.log]

    Thanks.
  • slooffmasterslooffmaster Posts: 384Members, Plex Pass Plex Pass
    Hi gmartinr,

    I was wondering whether you have found a fix? I am seeing the exact same symptoms on OpenSuse 12.3 64-bit. I am not using NFS storage but a local ZFS pool.
  • ziggimonziggimon Plex Dev Team AarhusPosts: 2,479Members, Plex Employee, Plex Pass, Plex Ninja Plex Employee

    Hi gmartinr,

    I was wondering whether you have found a fix? I am seeing the exact same symptoms on OpenSuse 12.3 64-bit. I am not using NFS storage but a local ZFS pool.


    If this is off a clean install, can you as root run: systemctl daemon-reload

    And see if that fixes things.

    - Mark
  • slooffmasterslooffmaster Posts: 384Members, Plex Pass Plex Pass

    hi Mark,

    Did that, then rebooted machine but still no joy..  Here are some lines from the syslog:

    Aug 22 18:56:48 hostname.domain.net systemd[1]: Started Plex Media Server for Linux.
    Aug 22 18:56:48 hostname.domain.net systemd[1]: Starting Getty on tty1...
    Aug 22 18:56:48 hostname.domain.net systemd[1]: Started Getty on tty1.
    Aug 22 18:56:48 hostname.domain.net systemd[1]: Starting Login Prompts.
    Aug 22 18:56:48 hostname.domain.net systemd[1]: Reached target Login Prompts.
    Aug 22 18:56:48 hostname.domain.net sh[2807]: Error: Unable to set up server: basic_string::_S_create
    Aug 22 18:56:48 hostname.domain.net systemd[1]: plexmediaserver.service: main process exited, code=exited, status=255/n/a
    Aug 22 18:56:48 hostname.domain.net systemd[1]: Unit plexmediaserver.service entered failed state
    

    Notice that plex initially starts, then dies.

    By the way, this is not a fresh install but a system that I upgraded from 12.1 with systemv initd to 12.3 using systemd. I did not change the plex version during that two-step process.

  • ziggimonziggimon Plex Dev Team AarhusPosts: 2,479Members, Plex Employee, Plex Pass, Plex Ninja Plex Employee

    hi Mark,

    Did that, then rebooted machine but still no joy.. Here are some lines from the syslog:

    Aug 22 18:56:48 hostname.domain.net systemd[1]: Started Plex Media Server for Linux. Aug 22 18:56:48 hostname.domain.net systemd[1]: Starting Getty on tty1... Aug 22 18:56:48 hostname.domain.net systemd[1]: Started Getty on tty1. Aug 22 18:56:48 hostname.domain.net systemd[1]: Starting Login Prompts. Aug 22 18:56:48 hostname.domain.net systemd[1]: Reached target Login Prompts. Aug 22 18:56:48 hostname.domain.net sh[2807]: Error: Unable to set up server: basic_string::_S_create Aug 22 18:56:48 hostname.domain.net systemd[1]: plexmediaserver.service: main process exited, code=exited, status=255/n/a Aug 22 18:56:48 hostname.domain.net systemd[1]: Unit plexmediaserver.service entered failed state Notice that plex initially starts, then dies.
    By the way, this is not a fresh install but a system that I upgraded from 12.1 with systemv initd to 12.3 using systemd. I did not change the plex version during that two-step process.

    Can you dig a little into what the unit is failing with. Might be some apparmor setting killing it, or maybe something else. It seems to crash on launch.

    - Mark
  • tim_duggantim_duggan Posts: 23Members, Plex Pass Plex Pass

    I'm having a similar problem on my CentOS install on a HP N54L.  This is a fairly clean install and I haven't added any software after Plex.  This did start happening after I added a personal media library of 3 files.  I think this might be a coincidence.  I've attached the Plex logs, what others do I need to look at on CentOS for info?

  • slooffmasterslooffmaster Posts: 384Members, Plex Pass Plex Pass

    could the cause of my problems be that I have both a systemd startup script and a sysvinit script while the system is configured to use systemd? Just wondering... if so, removing the sysvinit script should do the trick, right?  :o

  • ziggimonziggimon Plex Dev Team AarhusPosts: 2,479Members, Plex Employee, Plex Pass, Plex Ninja Plex Employee

    could the cause of my problems be that I have both a systemd startup script and a sysvinit script while the system is configured to use systemd? Just wondering... if so, removing the sysvinit script should do the trick, right? :o


    The systemd script should override the init script, so that shouldn't be an issue.

    - Mark
  • slooffmasterslooffmaster Posts: 384Members, Plex Pass Plex Pass

    brief update: force reinstalled plexmediaserver with zypper and now the first reboot went fine. Will return when this problem reappears.

  • slooffmasterslooffmaster Posts: 384Members, Plex Pass Plex Pass

    hmmm... a couple of reboots later and a lot of investigation, still no joy. This is all that shows up in the Plex Media Server.log:

    Aug 24, 2013 18:36:46 [0x7fdd09ff1740] INFO - Plex Media Server v0.9.8.4.125-ffe2a5d
    Aug 24, 2013 18:36:46 [0x7fdd09ff1740] ERROR - SQLITE3:10, 283, recovered 939 frames from WAL file /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db-wal
    Aug 24, 2013 18:36:46 [0x7fdd09ff1740] ERROR - Error: Unable to set up server: basic_string::_S_create
    
  • ziggimonziggimon Plex Dev Team AarhusPosts: 2,479Members, Plex Employee, Plex Pass, Plex Ninja Plex Employee

    hmmm... a couple of reboots later and a lot of investigation, still no joy. This is all that shows up in the Plex Media Server.log:

    Aug 24, 2013 18:36:46 [0x7fdd09ff1740] INFO - Plex Media Server v0.9.8.4.125-ffe2a5d Aug 24, 2013 18:36:46 [0x7fdd09ff1740] ERROR - SQLITE3:10, 283, recovered 939 frames from WAL file /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db-wal Aug 24, 2013 18:36:46 [0x7fdd09ff1740] ERROR - Error: Unable to set up server: basic_string::_S_create

    And just to be completely sure. Restarting it after boot doesn't bring it up?

    I'm thinking timing issue.

    - Mark
  • tim_duggantim_duggan Posts: 23Members, Plex Pass Plex Pass
    edited August 2013

    I just updated my server to 9.8.4.125 via a downloaded rpm and the daemon is still not starting up at boot.  Could some one point me to the right log file to see what's going on?  Boot.log reports that PMS starts OK, but doing a service status at the CLI then reports:

    [root@localhost ~]# service plexmediaserver status

    PlexMediaServer dead but subsys locked
  • ziggimonziggimon Plex Dev Team AarhusPosts: 2,479Members, Plex Employee, Plex Pass, Plex Ninja Plex Employee

    I just updated my server to 9.8.4.125 via a downloaded rpm and the daemon is still not starting up at boot. Could some one point me to the right log file to see what's going on? Boot.log reports that PMS starts OK, but doing a service status at the CLI then reports:


    /var/log/messages and the systemd dump and debugging commands can help.

    - Mark
  • slooffmasterslooffmaster Posts: 384Members, Plex Pass Plex Pass
    For me it is surely a timing issue because it does start okay when I start it immediately after boot, although I cannot think of any dependency missing: other services starting earlier like sickbeard etc all start fine (but using sysvinit scripts). I will do the systemd debugging later today and report back.
  • ziggimonziggimon Plex Dev Team AarhusPosts: 2,479Members, Plex Employee, Plex Pass, Plex Ninja Plex Employee

    For me it is surely a timing issue because it does start okay when I start it immediately after boot, although I cannot think of any dependency missing: other services starting earlier like sickbeard etc all start fine (but using sysvinit scripts). I will do the systemd debugging later today and report back.


    If it's a timing issue we just need to figure out what system process that need to be up before we start Plex. If we can track that down. I will add it to the RPM's

    - Mark
  • slooffmasterslooffmaster Posts: 384Members, Plex Pass Plex Pass

    here's some output from digging into systemd (not my area of expertise though...). This is the sanitised output of:

    > systemd --test --system --unit=multi-user.target
    -> Unit multi-user.target:
    .......................
                  Wants: plexmediaserver.service
                  After: plexmediaserver.service
                  References: plexmediaserver.service
    .......................
     -> Unit basic.target:
    .......................
                  RequiredBy: plexmediaserver.service
                  Before: plexmediaserver.service
                  ReferencedBy: plexmediaserver.service
    .......................
            -> Unit plexmediaserver.service:
                    Description: Plex Media Server for Linux
                    Instance: n/a
                    Unit Load State: loaded
                    Unit Active State: inactive
                    Inactive Exit Timestamp: n/a
                    Active Enter Timestamp: n/a
                    Active Exit Timestamp: n/a
                    Inactive Enter Timestamp: n/a
                    GC Check Good: no
                    Need Daemon Reload: no
                    Name: plexmediaserver.service
                    Fragment Path: /lib/systemd/system/plexmediaserver.service
                    Requires: systemd-journald.socket
                    Requires: basic.target
                    WantedBy: multi-user.target
                    Conflicts: shutdown.target
                    Before: shutdown.target
                    Before: multi-user.target
                    After: network.target
                    After: systemd-journald.socket
                    After: basic.target
                    References: network.target
                    References: systemd-journald.socket
                    References: basic.target
                    References: shutdown.target
                    ReferencedBy: multi-user.target
                    StopWhenUnneeded: no
                    RefuseManualStart: no
                    RefuseManualStop: no
                    DefaultDependencies: yes
                    OnFailureIsolate: no
                    IgnoreOnIsolate: no
                    IgnoreOnSnapshot: no
                    ControlGroup: cpu:/user/erik/426/system/plexmediaserver.service
                    ControlGroup: name=systemd:/user/erik/426/system/plexmediaserver.service
                    Service State: dead
                    Result: success
                    Reload Result: success
                    PermissionsStartOnly: no
                    RootDirectoryStartOnly: no
                    RemainAfterExit: no
                    GuessMainPID: yes
                    Type: simple
                    Restart: no
                    NotifyAccess: none
                    KillMode: control-group
                    KillSignal: SIGTERM
                    SendSIGKILL: yes
                    UMask: 0022
                    WorkingDirectory: /
                    RootDirectory: /
                    NonBlocking: no
                    PrivateTmp: no
                    ControlGroupModify: no
                    ControlGroupPersistent: yes
                    PrivateNetwork: no
                    IgnoreSIGPIPE: yes
                    Environment: PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/var/lib/plexmediaserver/Library/Application Support
                    Environment: PLEX_MEDIA_SERVER_HOME=/usr/lib/plexmediaserver
                    Environment: PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS=6
                    Environment: PLEX_MEDIA_SERVER_TMPDIR=/tmp
                    Environment: LD_LIBRARY_PATH=/usr/lib/plexmediaserver
                    Environment: LC_ALL=en_US.UTF-8
                    Environment: LANG=en_US.UTF-8
                    LimitNOFILE: 4096
                    StandardInput: null
                    StandardOutput: journal
                    StandardError: inherit
                    SyslogFacility: daemon
                    SyslogLevel: info
                    User: plex
                    Group: plex
                    -> ExecStartPre:
                            Command Line: /usr/bin/sh -c '/usr/bin/test -d "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}" || /bin/mkdir -p "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}"'
                    -> ExecStart:
                            Command Line: /usr/bin/sh -c '/usr/lib/plexmediaserver/Plex\ Media\ Server'
    
          -> Unit network.target:
                    Before: plexmediaserver.service
                    ReferencedBy: plexmediaserver.service
    

    can't determine whether this is OK or not... will dig further.

  • rrijken1973rrijken1973 Posts: 7Members, Plex Pass

    I get the same error message in my messages logs:

    Oct  6 20:12:47 server systemd[1]: plexmediaserver.service: main process exited, code=exited, status=255/n/a

    But this is on a server where plexmediaserver runs fine and starts fine manually after boot (at boot it doesn't start), but also sometimes because of a hickup it just shuts down after some up time. In the plex logs around the same time:

    Oct 06, 2013 20:12:47 [0x7fd6e7770740] INFO - Plex Media Server v0.9.8.6.175-88ffbb2 - ubuntu PC x86_64
    Oct 06, 2013 20:12:47 [0x7fd6e7770740] DEBUG - Opening 10 database sessions to library, SQLite 3.8.0, threadsafe=1
    Oct 06, 2013 20:12:47 [0x7fd6e7770740] INFO - SQLITE3:10, 283, recovered 14 frames from WAL file /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db-wal
    Oct 06, 2013 20:12:47 [0x7fd6e7770740] DEBUG - Running migrations.
    Oct 06, 2013 20:12:47 [0x7fd6e7770740] DEBUG - Listening on port 32400 with queue of 128 connections.
    Oct 06, 2013 20:12:47 [0x7fd6e7770740] DEBUG - Listening on port 32443 with queue of 128 connections.
    Oct 06, 2013 20:12:47 [0x7fd6e7770740] ERROR - Error: Unable to set up server: basic_string::_S_create

    System is running a clean install of Fedora 19. All the media is on a cifs share on the internal network mapped to /media/network. Never thought much of it till now and stumbled upon this thread. ANy solutions?

  • ziggimonziggimon Plex Dev Team AarhusPosts: 2,479Members, Plex Employee, Plex Pass, Plex Ninja Plex Employee
    edited October 2013
    I get the same error message in my messages logs:
    Oct  6 20:12:47 server systemd[1]: plexmediaserver.service: main process exited, code=exited, status=255/n/a
    But this is on a server where plexmediaserver runs fine and starts fine manually after boot (at boot it doesn't start), but also sometimes because of a hickup it just shuts down after some up time. In the plex logs around the same time:
    Oct 06, 2013 20:12:47 [0x7fd6e7770740] INFO - Plex Media Server v0.9.8.6.175-88ffbb2 - ubuntu PC x86_64Oct 06, 2013 20:12:47 [0x7fd6e7770740] DEBUG - Opening 10 database sessions to library, SQLite 3.8.0, threadsafe=1Oct 06, 2013 20:12:47 [0x7fd6e7770740] INFO - SQLITE3:10, 283, recovered 14 frames from WAL file /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db-walOct 06, 2013 20:12:47 [0x7fd6e7770740] DEBUG - Running migrations.Oct 06, 2013 20:12:47 [0x7fd6e7770740] DEBUG - Listening on port 32400 with queue of 128 connections.Oct 06, 2013 20:12:47 [0x7fd6e7770740] DEBUG - Listening on port 32443 with queue of 128 connections.Oct 06, 2013 20:12:47 [0x7fd6e7770740] ERROR - Error: Unable to set up server: basic_string::_S_create
    System is running a clean install of Fedora 19. All the media is on a cifs share on the internal network mapped to /media/network. Never thought much of it till now and stumbled upon this thread. ANy solutions?
    And I'm assuming the service starts up correctly if you restart after boot with a failed service start right? I will have a dig around and see if there is something with systemd that can help solve this. Are you running off an SSD OS drive? - Mark
  • rrijken1973rrijken1973 Posts: 7Members, Plex Pass

    Nope, it fails every single time. Have to start the service manually. Runs off an SSD, correct.

«13
Sign In or Register to comment.