Troubleshooting
Fixing Playback Issues
Crash During Library Scanning
Deep media analysis and scrubbing image generation will cause the plex service to stall and crash during library scans.
- Disable GenerateBIFBehavior. Scrubbing image generation are generated every 2 seconds for the entire length of each video. Not required for use.
- Increase GenerateBIFFrameInterval. If scrubbing must be kept on set the interval to the player scrub time (typically 10-15 seconds) which will exponentially reduce system load.
- Use scheduled intervals with notifications from download clients. Network mounted filesystems cannot use iNotify for Plex library scans. Enable ScheduledLibraryUpdatesEnabled, disable FSEventLibraryUpdatesEnabled, FSEventLibraryPartialScanEnabled.
Keep DB cache at default (40MB)
Increasing the cache size does not resolve library freezes during updates or preview generation. It only increases the likelyhood of data loss during a Plex crash.
Playback Fails / App Crashes
Generally this happens when you are playing media on Plex Home Theater or Plex app, where transcoding is being used. The app will crash generally with a message:
Conversation failed. Transcoder crashed or failed to start up
This usually happens because the transcoder was not able to write to the transcoding directory.
- Ensure Transcoding directory is setup properly on Plex Server.
- Ensure /tmp/Transcode is owned by the right user. Changing the running user without re-creating this directory will cause this to happen.
Playback, transcoding, and Plex are Slow
Many Plex issues are from long-running databases that need pruning.
wget -O /tmp/DBRepair.sh https://github.com/ChuckPa/PlexDBRepair/releases/latest/download/DBRepair.sh
# By default the script requires root which may interfere with squashed NFS
# mounts. Set no root user required only if needed.
sed -i 's/RootRequired=1/RootRequired=0/' /tmp/DBRepair.sh
chmod +x /tmp/DBRepair.sh
# Shutdown plex and copy database files (if needed). Always make backups.
systemctl stop plexmediaserver
cp /var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/Plug-in\ Support/Databases/* /root/
# Set paging size to filesystem blocksize for optimum performance.
export DBREPAIR_PAGESIZE=4096
/tmp/DBRepair.sh --sqlite /usr/lib/plexmediaserver/Plex\ SQLite --databases /root
# Use automatic repair, then deflate databases
auto # Check, repair, optimize, set paging size, vacuum, re-index.
deflate # Clean orphaned data (statistics data).
exit
Spinning playback icon, no playback
Generally if transcoding is setup right, then this is related to the audio transcoding failing. Turn on debug logging on the server and look for:
EAE timeout! EAE not running, or wrong folder? Could not read
This means you need to remap the /tmp directory to your transcoding directory, as plex updated transcoding and split out audio and video encoding into separate locations. Video transcodes in /transcode while audio transcodes in /tmp. Mapping /tmp to the transcoding directory fixes this.
Managing Duplicates
Duplicate Files for Single Files
This happens when two refreshes for a new file happen at the same time. Generally this occurs because inotify detection is turned on in Plex, and Sonarr is set to push a manual update library command to plex on completion. Only one of these things should be enabled at once.
- Move duplicate file out of Plex library.
- Wait for episode refresh trigger / trigger manually (episode should be removed).
- Move duplicate file into Plex library.
- Wait for episode refresh trigger / trigger manually (episode should be removed). Dupe should be removed.
Finding Duplicates
To show all detected duplicates in plex:
Plex ➔ TV Shows ➔ {TV Shows Dropdown in main window} ➔ Episodes
Plex ➔ TV Shows ➔ {All in main window} ➔ Duplicates
From there you can Inspect all shows.
Optimizations
PlexCleaner
Re-encode existing media to focus on direct-play. Useful to attempt to preserve media quality while focusing on reducing server load and playback issues.
Maintainerr
Maintain Plex server by automatically pruning unwatched and watched media as well as Overseerr requests Janitorr is a command line only inspired version.
Plex Generate Previews
Offload thumbnail generation to parallel GPU threads on a schedule outside of Plex butler updates. Reduces Plex load and allows for custom BIF intervals.
- Disable GenerateBIFBehavior.
- Configure service.
imgc may be used to further compress existing (and newly generated) images to reduce Plex metadata directory size.
Legacy Plex Fixes
Fixes for early Plex servers. These generally do not appear anymore.
Backup State Configuration
cd /var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/Plugin\ Support/Databases
echo ".dump metadata_item_settings" | sudo sqlite3 com.plexapp.plugins.library.db | grep -v TABLE | grep -v INDEX > viewstate-information-settings.sql
cd /var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server
sudo cp -av Media /tmp/media-backup
sudo cp -av Metadata /tmp/metadata-backup
Restoring Plex State Configuration
cd /var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/Plugin\ Support/Databases
cat viewstate-information-settings.sql | sudo sqlite3 com.plexapp.plugins.library.db
cd /var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server
sudo cp -av /tmp/media-backup Media
sudo cp -av /tmp/metadata-backup Metadata
Plex Stuck at Initial Startup
# Stop Plex and remove Service Bundle Framework.
sudo service plexmediaserver stop
sudo ps -ef | grep -i plex
sudo kill -9 {REMAINING PIDS}
cd /var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/Plugins
rm -f Service.bundle Framwork.bundle
sudo service plexmediaserver start
sudo reboot