Media Server Not Starting (Ubuntu)

Server was running fine for a few months, and now will not start with the following status:

● plexmediaserver.service - Plex Media Server
   Loaded: loaded (/lib/systemd/system/plexmediaserver.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Tue 2020-09-29 19:15:08 CDT; 11s ago
  Process: 3380 ExecStart=/bin/sh -c  export PLEX_MEDIA_SERVER_INFO_VENDOR="$(grep ^NAME= /etc/os-release | awk -F= "{print \$2}" | tr -d \" )
  Process: 3378 ExecStartPre=/bin/sh -c /usr/bin/test -d "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}" || /bin/mkdir -p "${PLEX_MEDIA_SERVER_
 Main PID: 3380 (code=exited, status=255)

Sep 29 19:15:03 robert-132-CK-NF78 systemd[1]: plexmediaserver.service: Main process exited, code=exited, status=255/n/a
Sep 29 19:15:03 robert-132-CK-NF78 systemd[1]: plexmediaserver.service: Failed with result 'exit-code'.
Sep 29 19:15:08 robert-132-CK-NF78 systemd[1]: plexmediaserver.service: Service hold-off time over, scheduling restart.
Sep 29 19:15:08 robert-132-CK-NF78 systemd[1]: plexmediaserver.service: Scheduled restart job, restart counter is at 3.
Sep 29 19:15:08 robert-132-CK-NF78 systemd[1]: Stopped Plex Media Server.
Sep 29 19:15:08 robert-132-CK-NF78 systemd[1]: plexmediaserver.service: Start request repeated too quickly.
Sep 29 19:15:08 robert-132-CK-NF78 systemd[1]: plexmediaserver.service: Failed with result 'exit-code'.
Sep 29 19:15:08 robert-132-CK-NF78 systemd[1]: Failed to start Plex Media Server.

Distro & Version: Ubuntu 18.04.5 LTS
Server Version#: 1.20.1.3252-a78fef9a9
Player Version#: 4 .43.1

logs.tar.gz (1.6 MB)

Not sure where to go from here. Let me know if I missed anything.

Your server has processes hung and the port Plex listens to is still in use.

Perhaps best to restart the machine.

Sep 29, 2020 19:14:57.862 [0x7fc0a5479f80] DEBUG - CERT: OCSP requests for stapling will be made to 'http://ocspx.digicert.com/'.
Sep 29, 2020 19:14:57.862 [0x7fc0a5479f80] INFO - OCSP: Successfully retrieved response from cache.
Sep 29, 2020 19:14:57.862 [0x7fc0a5479f80] DEBUG - CERT: Installed intermediate certificate.
Sep 29, 2020 19:14:57.862 [0x7fc0a5479f80] DEBUG - HttpServer: Listening on IPv6 as well as IPv4.
Sep 29, 2020 19:14:57.862 [0x7fc0a5479f80] ERROR - HttpServer: Error binding acceptor: Address already in use
Sep 29, 2020 19:14:57.862 [0x7fc0a5479f80] ERROR - HttpServer: Error opening acceptor on IPv6, falling back to IPv4: Address already in use
Sep 29, 2020 19:14:57.862 [0x7fc0a5479f80] ERROR - HttpServer: Error binding acceptor: Address already in use
Sep 29, 2020 19:14:57.862 [0x7fc0a5479f80] ERROR - Error: Unable to set up server: listen: Address already in use (N5boost10wrapexceptINS_6system12system_errorEEE)

Server still down after restart. Checking the status provides the same result as posted above.

are you running a proxy?

I am not running a proxy.

Please do the following:

  1. sudo systemctl disable plexmediaserver
  2. Restart the host
  3. sudo netstat -an | grep 324

This will tell us if anything references port 324xx

Also please do :

sudo journalctl -xe | grep -i plex

this will show the system log . Scan through it for any permission denied / etc … other odd errors

netstat results:

tcp        0      0 127.0.0.1:32401         0.0.0.0:*               LISTEN     
tcp        0      0 127.0.0.1:59882         127.0.0.1:32400         TIME_WAIT  
tcp        0      0 192.168.1.110:55832     192.168.1.110:32400     TIME_WAIT  
tcp        0      0 192.168.1.110:56024     192.168.1.110:32400     TIME_WAIT  
tcp        0      0 192.168.1.110:55896     192.168.1.110:32400     TIME_WAIT  
tcp        0      0 192.168.1.110:56126     192.168.1.110:32400     TIME_WAIT  
tcp        0      0 192.168.1.110:56086     192.168.1.110:32400     TIME_WAIT  
tcp        0      0 192.168.1.110:55998     192.168.1.110:32400     TIME_WAIT  
tcp        0      0 192.168.1.110:56128     192.168.1.110:32400     ESTABLISHED
tcp        0      0 127.0.0.1:59808         127.0.0.1:32400         TIME_WAIT  
tcp        0      0 192.168.1.110:56138     192.168.1.110:32400     TIME_WAIT  
tcp6       0      0 :::32400                :::*                    LISTEN     
tcp6       0      0 127.0.0.1:32400         127.0.0.1:59866         TIME_WAIT  
tcp6       0      0 192.168.1.110:32400     192.168.1.110:56128     ESTABLISHED
tcp6       0      0 127.0.0.1:32400         127.0.0.1:59832         TIME_WAIT  
tcp6       0      0 127.0.0.1:32400         127.0.0.1:59850         TIME_WAIT  
tcp6       0      0 127.0.0.1:32400         127.0.0.1:59864         TIME_WAIT  
tcp6       0      0 127.0.0.1:32400         127.0.0.1:59862         TIME_WAIT  
tcp6       0      0 127.0.0.1:32400         127.0.0.1:59798         TIME_WAIT  
tcp6       0      0 127.0.0.1:32400         127.0.0.1:59874         TIME_WAIT  
tcp6       0      0 192.168.1.110:32400     192.168.1.202:59431     TIME_WAIT  
tcp6       0      0 192.168.1.110:32400     192.168.1.1:47898       TIME_WAIT  
tcp6       0      0 127.0.0.1:32400         127.0.0.1:59854         TIME_WAIT  
tcp6       0      0 127.0.0.1:32400         127.0.0.1:59860         TIME_WAIT  
tcp6       0      0 127.0.0.1:32400         127.0.0.1:59868         TIME_WAIT  
tcp6       0      0 127.0.0.1:32400         127.0.0.1:59796         TIME_WAIT  
tcp6       0      0 192.168.1.110:32400     192.168.1.1:59436       TIME_WAIT  
tcp6       0      0 127.0.0.1:32400         127.0.0.1:59876         TIME_WAIT  
tcp6       0      0 192.168.1.110:32400     192.168.1.1:59432       TIME_WAIT  
tcp6       0      0 192.168.1.110:32400     192.168.1.202:59435     TIME_WAIT  
tcp6       0      0 127.0.0.1:32400         127.0.0.1:59802         TIME_WAIT  
tcp6       0      0 127.0.0.1:32400         127.0.0.1:59826         TIME_WAIT  
udp        0      0 0.0.0.0:32410           0.0.0.0:*                          
udp        0      0 0.0.0.0:32412           0.0.0.0:*                          
udp        0      0 0.0.0.0:32413           0.0.0.0:*                          
udp        0      0 0.0.0.0:32414           0.0.0.0:*                          
unix  3      [ ]         STREAM     CONNECTED     32442    /run/user/1000/bus
unix  3      [ ]         STREAM     CONNECTED     32441    
unix  3      [ ]         STREAM     CONNECTED     32400    @/tmp/dbus-pCXDBPKAv1
unix  3      [ ]         STREAM     CONNECTED     32401    @/tmp/dbus-pCXDBPKAv1
unix  3      [ ]         STREAM     CONNECTED     32482    
unix  3      [ ]         STREAM     CONNECTED     33248    /run/systemd/journal/stdout
unix  3      [ ]         STREAM     CONNECTED     32483    /run/user/1000/bus
unix  2      [ ]         STREAM     CONNECTED     40324 

looks like a lot of stuff relating to Plex:

Sep 29 21:01:06 robert-132-CK-NF78 audit[733]: AVC apparmor="STATUS" operation="profile_load" profile="unconfined" name="snap.plexmediaserver.plexmediaserver" pid=733 comm="apparmor_parser"
Sep 29 21:01:06 robert-132-CK-NF78 audit[734]: AVC apparmor="STATUS" operation="profile_load" profile="unconfined" name="snap.plexmediaserver.pms-web" pid=734 comm="apparmor_parser"
Sep 29 21:01:06 robert-132-CK-NF78 audit[750]: AVC apparmor="STATUS" operation="profile_load" profile="unconfined" name="snap-update-ns.plexmediaserver" pid=750 comm="apparmor_parser"
Sep 29 21:01:06 robert-132-CK-NF78 audit[782]: AVC apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile="unconfined" name="snap-update-ns.plexmediaserver" pid=782 comm="apparmor_parser"
Sep 29 21:01:06 robert-132-CK-NF78 audit[793]: AVC apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile="unconfined" name="snap.plexmediaserver.plexmediaserver" pid=793 comm="apparmor_parser"
Sep 29 21:01:06 robert-132-CK-NF78 audit[794]: AVC apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile="unconfined" name="snap.plexmediaserver.pms-web" pid=794 comm="apparmor_parser"
Sep 29 21:01:03 robert-132-CK-NF78 systemd-udevd[414]: link_config: autonegotiation is unset or enabled, the speed and duplex are not writable.
Sep 29 21:01:03 robert-132-CK-NF78 systemd-udevd[414]: link_config: autonegotiation is unset or enabled, the speed and duplex are not writable.
Sep 29 21:01:04 robert-132-CK-NF78 systemd[1]: Mounting Mount unit for plexmediaserver, revision 108...
-- Subject: Unit snap-plexmediaserver-108.mount has begun start-up
-- Unit snap-plexmediaserver-108.mount has begun starting up.
Sep 29 21:01:05 robert-132-CK-NF78 systemd-udevd[416]: link_config: autonegotiation is unset or enabled, the speed and duplex are not writable.
Sep 29 21:01:05 robert-132-CK-NF78 systemd-udevd[411]: link_config: autonegotiation is unset or enabled, the speed and duplex are not writable.
Sep 29 21:01:05 robert-132-CK-NF78 systemd[1]: Mounting Mount unit for plexmediaserver, revision 111...
-- Subject: Unit snap-plexmediaserver-111.mount has begun start-up
-- Unit snap-plexmediaserver-111.mount has begun starting up.
Sep 29 21:01:06 robert-132-CK-NF78 systemd[1]: Mounted Mount unit for plexmediaserver, revision 108.
-- Subject: Unit snap-plexmediaserver-108.mount has finished start-up
-- Unit snap-plexmediaserver-108.mount has finished starting up.
Sep 29 21:01:06 robert-132-CK-NF78 systemd[1]: Mounted Mount unit for plexmediaserver, revision 111.
-- Subject: Unit snap-plexmediaserver-111.mount has finished start-up
-- Unit snap-plexmediaserver-111.mount has finished starting up.
Sep 29 21:01:08 robert-132-CK-NF78 systemd[1]: Mounting /mnt/plexdirectory...
-- Subject: Unit mnt-plexdirectory.mount has begun start-up
-- Unit mnt-plexdirectory.mount has begun starting up.
Sep 29 21:01:08 robert-132-CK-NF78 systemd[1]: Mounted /mnt/plexdirectory.
-- Subject: Unit mnt-plexdirectory.mount has finished start-up
-- Unit mnt-plexdirectory.mount has finished starting up.
Sep 29 21:01:23 robert-132-CK-NF78 systemd[1]: Started Service for snap application plexmediaserver.plexmediaserver.
-- Subject: Unit snap.plexmediaserver.plexmediaserver.service has finished start-up
-- Unit snap.plexmediaserver.plexmediaserver.service has finished starting up.
Sep 29 21:01:34 robert-132-CK-NF78 kernel: audit: type=1400 audit(1601431293.501:82): apparmor="DENIED" operation="mknod" profile="snap.plexmediaserver.plexmediaserver" name="/dev/shm/QaHZDG" pid=1321 comm=506C6578204D656469612053657276 requested_mask="c" denied_mask="c" fsuid=0 ouid=0
Sep 29 21:01:33 robert-132-CK-NF78 audit[1321]: AVC apparmor="DENIED" operation="mknod" profile="snap.plexmediaserver.plexmediaserver" name="/dev/shm/QaHZDG" pid=1321 comm=506C6578204D656469612053657276 requested_mask="c" denied_mask="c" fsuid=0 ouid=0
Sep 29 21:01:27 robert-132-CK-NF78 NetworkManager[987]: <info>  [1601431287.0152] dhcp4 (enp0s17):   hostname 'plex-server'
Sep 29 21:01:30 robert-132-CK-NF78 systemd[1]: Starting Tautulli - Stats for Plex Media Server usage...
Sep 29 21:01:33 robert-132-CK-NF78 systemd[1]: Started Tautulli - Stats for Plex Media Server usage.
Sep 29 21:01:49 robert-132-CK-NF78 dbus-daemon[1440]: [session uid=1000 pid=1440] Activating via systemd: service name='org.gtk.vfs.Metadata' unit='gvfs-metadata.service' requested by ':1.39' (uid=1000 pid=1681 comm="thunar /mnt/plexdirectory/robot/ " label="unconfined")
Sep 29 21:02:04 robert-132-CK-NF78 audit[1923]: AVC apparmor="DENIED" operation="open" profile="snap.plexmediaserver.plexmediaserver" name="/proc/1923/mounts" pid=1923 comm=506C65782053637269707420486F73 requested_mask="r" denied_mask="r" fsuid=0 ouid=0
Sep 29 21:02:04 robert-132-CK-NF78 kernel: audit: type=1400 audit(1601431324.115:83): apparmor="DENIED" operation="open" profile="snap.plexmediaserver.plexmediaserver" name="/proc/1923/mounts" pid=1923 comm=506C65782053637269707420486F73 requested_mask="r" denied_mask="r" fsuid=0 ouid=0
Sep 29 21:02:07 robert-132-CK-NF78 audit[1321]: AVC apparmor="DENIED" operation="mknod" profile="snap.plexmediaserver.plexmediaserver" name="/dev/shm/jBXfjh" pid=1321 comm=506C6578204D656469612053657276 requested_mask="c" denied_mask="c" fsuid=0 ouid=0
Sep 29 21:02:07 robert-132-CK-NF78 kernel: audit: type=1400 audit(1601431327.171:84): apparmor="DENIED" operation="mknod" profile="snap.plexmediaserver.plexmediaserver" name="/dev/shm/jBXfjh" pid=1321 comm=506C6578204D656469612053657276 requested_mask="c" denied_mask="c" fsuid=0 ouid=0
Sep 29 21:02:07 robert-132-CK-NF78 audit[1990]: AVC apparmor="DENIED" operation="capable" profile="snap.plexmediaserver.plexmediaserver" pid=1990 comm=506C65782054756E65722053657276 capability=7  capname="setuid"
Sep 29 21:02:07 robert-132-CK-NF78 kernel: audit: type=1400 audit(1601431327.399:85): apparmor="DENIED" operation="capable" profile="snap.plexmediaserver.plexmediaserver" pid=1990 comm=506C65782054756E65722053657276 capability=7  capname="setuid"
Sep 29 21:02:07 robert-132-CK-NF78 audit[1990]: AVC apparmor="DENIED" operation="capable" profile="snap.plexmediaserver.plexmediaserver" pid=1990 comm=506C65782054756E65722053657276 capability=7  capname="setuid"
Sep 29 21:02:07 robert-132-CK-NF78 kernel: audit: type=1400 audit(1601431327.531:86): apparmor="DENIED" operation="capable" profile="snap.plexmediaserver.plexmediaserver" pid=1990 comm=506C65782054756E65722053657276 capability=7  capname="setuid"
Sep 29 21:02:07 robert-132-CK-NF78 kernel: audit: type=1400 audit(1601431327.547:87): apparmor="DENIED" operation="mknod" profile="snap.plexmediaserver.plexmediaserver" name="/dev/shm/50Xgyo" pid=1990 comm=506C65782054756E65722053657276 requested_mask="c" denied_mask="c" fsuid=0 ouid=0
Sep 29 21:02:07 robert-132-CK-NF78 audit[1990]: AVC apparmor="DENIED" operation="mknod" profile="snap.plexmediaserver.plexmediaserver" name="/dev/shm/50Xgyo" pid=1990 comm=506C65782054756E65722053657276 requested_mask="c" denied_mask="c" fsuid=0 ouid=0
Sep 29 21:02:08 robert-132-CK-NF78 audit[2005]: AVC apparmor="DENIED" operation="open" profile="snap.plexmediaserver.plexmediaserver" name="/proc/2005/mounts" pid=2005 comm=506C65782053637269707420486F73 requested_mask="r" denied_mask="r" fsuid=0 ouid=0
Sep 29 21:02:08 robert-132-CK-NF78 kernel: audit: type=1400 audit(1601431328.255:88): apparmor="DENIED" operation="open" profile="snap.plexmediaserver.plexmediaserver" name="/proc/2005/mounts" pid=2005 comm=506C65782053637269707420486F73 requested_mask="r" denied_mask="r" fsuid=0 ouid=0
Sep 29 21:02:13 robert-132-CK-NF78 Plex Tuner Serv[1990]: Plex Tuner Service: Critical: libusb_init failed

oh, i see it now. You’re running the Ubuntu snap package.

Now disable the dpkg installed version if it’s there,

sudo systemctl stop plexmediaserver
sudo systemctl disable plexmediaserver

the normal Ubuntu main commands do not work for snap packages.
Snap containers are like docker and require special commands.

sudo snap stop plexmediaserver
sudo snap start plexmediaserver

the apt-get installed package and the Ubuntu store Snap package will conflict.

Which do you think you have and which do you prefer?

Honestly, I may have both, I’m not sure. I did apt-get today while troubleshoot to see if updating Plex fixed anything.

I don’t think I know enough to have a preference. Whichever is easiest to update?

From the support perspective (what we all can do here), the apt-get (dpkg) version is easier.

The installer is more robust & informative. It will self configure the OS if you have transcoding hardware. The Snap package does not. It’s abstracted.

To remove the snap package (sudo snap remove plexmediaserver)

Then, with that gone, one more restart , check with netstat again to make sure nothing is sitting trying to open 32400 / 32401 and block the main app from starting up

Let me know when you get that far and we’ll finish the cleanup and get you running again

When running the snap removal, seem to be on this for a while now:

Save data of snap "plexmediaserver" in automatic snapshot set #1

Also, I do have this plexupdate item installed, would/how would this need to be removed?

I do not know how to properly administer snap packages.
I think Google is your best reference for that.

When that snapshot save is done, if you have no plans of using SNAP again, it might be a good idea to find where it’s stored and delete it

I was able to remove the plexmediaserver snap. I have some other software installed through snap, so would not want to uninstall snap if not completely necessary.

After restarting, netstat looks like it is no longer showing any ports still attached to plex:

unix  3      [ ]         STREAM     CONNECTED     32472    /run/systemd/journal/stdout
unix  3      [ ]         STREAM     CONNECTED     32469    
unix  2      [ ]         DGRAM                    32407    
unix  3      [ ]         STREAM     CONNECTED     32402    
unix  3      [ ]         STREAM     CONNECTED     32400    
unix  3      [ ]         STREAM     CONNECTED     32468    
unix  3      [ ]         STREAM     CONNECTED     32403    /var/run/dbus/system_bus_socket
unix  3      [ ]         STREAM     CONNECTED     32471    /run/systemd/journal/stdout
unix  3      [ ]         STREAM     CONNECTED     32422    @/tmp/.X11-unix/X0
unix  3      [ ]         STREAM     CONNECTED     23243    
unix  3      [ ]         STREAM     CONNECTED     32419    
unix  3      [ ]         STREAM     CONNECTED     31324    

That looks a whole lot better.

I agree – let’s not remove all of snap. Most of Ubuntu would stop working.

Now let’s continue and make sure you have a proper native package PMS installed.

  1. Download PMS from downloads.plex.tv
  2. From the command line sudo dpkg -i <filename>.deb
  3. The installer will run and report its findings while installing plex. It will run in two phases. If phase 1 (pre-install) fails, it will stop installation. Should that happen, please share the console output and the contents of /tmp/plexinstaller.log

If it completes without error, you should be ready to start using PMS.

It will tell you if it has started PMS or not. If started, open it normally (http://127.0.0.1:32400/web) to begin that setup.

Install was successful, however, there is no mention of it starting PMS and I’m unable to connect to the server address.

Setting up plexmediaserver (1.20.2.3370-b1b651549) ...
PlexMediaServer install: PlexMediaServer-1.20.2.3370-b1b651549 - Installation starting.
PlexMediaServer install: 
PlexMediaServer install: Now installing based on:
PlexMediaServer install:   Installation Type:   Update
PlexMediaServer install:   Process Control:     systemd
PlexMediaServer install:   Plex User:           plex
PlexMediaServer install:   Plex Group:          plex
PlexMediaServer install:   Video Group:         video
PlexMediaServer install:   Metadata Dir:        /var/lib/plexmediaserver/Library/Application Support
PlexMediaServer install:   Temp Directory:      /tmp 
PlexMediaServer install:   Lang Encoding:       en_US.UTF-8
PlexMediaServer install:   Transcoding HW:      Found
PlexMediaServer install: 
PlexMediaServer install: Completing final configuration.
PlexMediaServer install: INFO: Plex Media Server is not enabled to start at system boot.
PlexMediaServer install: PlexMediaServer-1.20.2.3370-b1b651549 - Installation successful.  Errors: 0, Warnings: 0
Processing triggers for libc-bin (2.27-3ubuntu1.2) ...
Processing triggers for desktop-file-utils (0.23-1ubuntu3.18.04.2) ...
Processing triggers for bamfdaemon (0.5.3+18.04.20180207.2-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for mime-support (3.60ubuntu1) ...

The message:

PlexMediaServer install: INFO: Plex Media Server is not enabled to start at system boot.

Is part of the reason because it was an Update installation. The other reason it didn’t start is because it wasn’t running when the installation was performed.

Now you can both start and enable both

sudo systemctl enable plexmediaserver
sudo systemctl start plexmediaserver

First one enables to start at boot while the second starts it now.

Once it starts (remember, it’s running as a system service application), you’ll be able to connect to it.

Plex is now running! Thank you for all your assistance and patience.

I have one last question, how would I update Plex going forward?

Would I just need to stop the service then run sudo dpkg -i <filename>.deb on the updated installer file?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.