Plex issues after upgrading from Ubuntu 14.04 to 16.04 1

This is a follow up from my previous post about moving the Plex metadata location, after having some issues after upgrading Ubuntu to 16.04.

I recently updated Ubuntu to 16.04, the upgrade itself was seamless. However I soon noticed Plex was no longer accessible. It turns out, after tunneling port 32400 with putty, that Plex was running as a fresh installation.
This made me come to conclusion the config files had changes during the Ubuntu upgrade. It turns out Plex migrated to systemd after upgrading and didn’t migrate my changes.

Plex has documented the new config file and steps on how to move the metadata in the post here – https://support.plex.tv/hc/en-us/articles/200273978-Linux-User-and-Storage-configuration

Following the information on here I changed the service configuration. One thing that did catch me out, is that the quotes are in different places than they used to be. This caused me some unusual errors and core dumps until I realised – so that’s something to double check.

sudo vim /etc/systemd/system/plexmediaserver.service

The contents of the file now look like this.

[Unit]
Description=Plex Media Server for Linux
After=network.target

[Service]
#Environment="PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/var/lib/plexmediaserver/Library/Application Support"
Environment="PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/home/plex/plex/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
ExecStartPre=/bin/sh -c '/usr/bin/test -d "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}" || /bin/mkdir -p "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}"'
ExecStart=/bin/sh -c '/usr/lib/plexmediaserver/Plex\ Media\ Server'
Type=simple
User=plex
Group=plex
Restart=on-failure
RestartSec=5
StartLimitInterval=60s
StartLimitBurst=3

[Install]
WantedBy=multi-user.target

You can then reload the demon and start Plex.

sudo systemctl --system daemon-reload
sudo service plexmediaserver start

Hopefully someone else finds this useful.

Below are some of the errors I was getting while troubleshooting this.

This was a core dump I got, this was seen in

sudo systemctl status plexmediaserver.service

plexmediaserver.service - Plex Media Server for Linux
Loaded: loaded (/etc/systemd/system/plexmediaserver.service; enabled; vendor preset: enabled)
Active: inactive (dead) (Result: core-dump) since Mon 2016-12-19 23:10:21 GMT; 8min ago
Process: 31603 ExecStart=/bin/sh -c /usr/lib/plexmediaserver/Plex\ Media\ Server (code=dumped, signal=ABRT)
Main PID: 31603 (code=dumped, signal=ABRT)

Dec 19 23:10:16 ns352516.ip-91-121-83.eu systemd[1]: plexmediaserver.service: Unit entered failed state.
Dec 19 23:10:16 ns352516.ip-91-121-83.eu systemd[1]: plexmediaserver.service: Failed with result 'core-dump'.
Dec 19 23:10:21 ns352516.ip-91-121-83.eu systemd[1]: plexmediaserver.service: Service hold-off time over, scheduling restart.
Dec 19 23:10:21 ns352516.ip-91-121-83.eu systemd[1]: Stopped Plex Media Server for Linux.
Dec 19 23:10:21 ns352516.ip-91-121-83.eu systemd[1]: plexmediaserver.service: Start request repeated too quickly.
Dec 19 23:10:21 ns352516.ip-91-121-83.eu systemd[1]: Failed to start Plex Media Server for Linux.

This error is what lead me to the issue. Notice the imbalanced quotes and weird location where it was trying to do the core dump.

sudo journalctl -xe


Dec 19 23:37:07 sh[9200]: terminate called after throwing an instance of 'terminate called recursively
Dec 19 23:37:07 sh[9200]: std::runtime_error'
Dec 19 23:37:07 sh[9200]: what(): Codecs: Initialize: 'boost::filesystem::create_directories: Permission denied: ""/home/plex/plex/Application/Plex Media Server/Codecs"'
Dec 19 23:37:07 sh[9200]: ****** PLEX MEDIA SERVER CRASHED, CRASH REPORT WRITTEN: "/home/plex/plex/Application/Plex Media Server/Crash Reports/1.3.3.3148-b38628e/PLEX MEDIA SERVER/2eb85ca3-d17c-96e1-477a257b-4bda
Dec 19 23:37:07 sh[9200]: Error in command line:the argument for option '--serverUuid' should follow immediately after the equal sign
Dec 19 23:37:07 sh[9200]: Crash Uploader options (all are required):
Dec 19 23:37:07 sh[9200]: --directory arg Directory to scan for crash reports
Dec 19 23:37:07 sh[9200]: --serverUuid arg UUID of the server that crashed
Dec 19 23:37:07 sh[9200]: --userId arg User that owns this product
Dec 19 23:37:07 sh[9200]: --platform arg Platform string
Dec 19 23:37:07 sh[9200]: --url arg URL to upload to
Dec 19 23:37:07 sh[9200]: --help show help message
Dec 19 23:37:07 sh[9200]: --version arg Version of the product
Dec 19 23:37:07 systemd[1]: plexmediaserver.service: Main process exited, code=killed, status=6/ABRT
Dec 19 23:37:07 systemd[1]: plexmediaserver.service: Unit entered failed state.
Dec 19 23:37:07 systemd[1]: plexmediaserver.service: Failed with result 'signal'.

One comment on “Plex issues after upgrading from Ubuntu 14.04 to 16.04

  1. Pingback: Move Plex Metadata Location on Ubuntu 14.04

Leave a Reply