Plex Media Scanner Crashing After Latest PMS Update

My server has been working pretty well for a long time but after the latest update, scanning media seems not possible.

When I run the command:

“/usr/lib/plexmediaserver/Plex Media Scanner” --list

Here’s what I get in the terminal:

terminate called after throwing an instance of ‘soci::soci_error’
what(): sqlite3_statement_backend::prepare: no such column: library_sections.content_changed_at for SQL: select library_sections.id as ‘library_sections_id’, library_sections.library_id as ‘library_sections_library_id’, library_sections.name as ‘library_sections_name’, library_sections.name_sort as ‘library_sections_name_sort’, library_sections.section_type as ‘library_sections_section_type’, library_sections.language as ‘library_sections_language’, library_sections.agent as ‘library_sections_agent’, library_sections.scanner as ‘library_sections_scanner’, library_sections.user_thumb_url as ‘library_sections_user_thumb_url’, library_sections.user_art_url as ‘library_sections_user_art_url’, library_sections.user_theme_music_url as ‘library_sections_user_theme_music_url’, library_sections.created_at as ‘library_sections_created_at’, library_sections.updated_at as ‘library_sections_updated_at’, library_sections.scanned_at as ‘library_sections_scanned_at’, library_sections.user_fields as ‘library_sections_user_fields’, library_sections.query_xml as ‘library_sections_query_xml’, library_sections.query_type as ‘library_sections_query_type’, library_sections.uuid as ‘library_sections_uuid’, library_sections.changed_at as ‘library_sections_changed_at’, library_sections.content_changed_at as ‘library_sections_content_changed_at’ from library_sections
****** PLEX MEDIA SCANNER CRASHED, CRASH REPORT WRITTEN: /root/Library/Application Support/Plex Media Server/Crash Reports/1.18.1.2019-c186313fe/PLEX MEDIA SCANNER/7aef4e77-41b1-64c3-10e2cdbc-65913067.dmp

Can someone tell me what the heck is going on with the Media Scanner??

It’s not the scanner. Something happened to your database.

An abrupt system power-off / ungraceful shutdown of PMS ? (e.g. kill -9 / kill -11 style?)

You’ll need to recover the DB from the most recent backup then just rescan your media again. Worst case is you have it refresh the metadata.

When that’s all done, Empty Trash & Clean bundles to clear out any residual junk in the other directories.

I am seeing this on my Synology.
(I have had no abrupt power off’s, the syno’s on a ups and no force kills)

I will go and try the database repair and see if that solves it.

But the thing is Plex can quite happily scan my library ‘normally’ via app.plex or using PMP, so would DB corruption/damage not impact that sort of scan. Just curious.

Edit.

Database appears fine, can run that query just fine directly on the database. Looks like probably a permissions issue, but on my Syno even running as the plex user still gives that error.

Which user are you trying to run the scanner from?

As while investigating I found that on my ubuntu box:

1: login as my regular user
2: export LD_LIBRARY_PATH=/usr/lib/plexmediaserver/lib
3: /usr/lib/plexmediaserver/Plex\ Media\ Scanner --list

I get the same error as you

But if you switch to the plex user, then it works:

sudo su plex

Then run the scanner command

/usr/lib/plexmediaserver/Plex\ Media\ Scanner --list
 1: Movies
 2: Movies 4K
 3: Movies Kids
etc...
```

The Scanner must run as the same username PMS runs as.
This has always been the use case.

I was pretty sure that was the case, it’s just the support article has no mention of that requirement.

But still not sure why it won’t work on my syno, even as the plex user.

bash-4.3$ whoami
plex

bash-4.3$ /var/packages/Plex\ Media\ Server/target/Plex\ Media\ Scanner --list

gives the error

terminate called after throwing an instance of 'soci::soci_error' etc...
admin@moesern:~$ sudo -su plex
sh-4.3$ cd /var/packages/Plex\ Media\ Server/
sh-4.3$ export PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR="/volume1/Plex/Library/Application Support"
sh-4.3$ cd target
sh-4.3$ ls
CrashUploader  lib			Plex DLNA Server   Plex Media Fingerprinter  Plex Media Server	Plex Script Host  Plex Tuner Service
dsm_config     Plex Commercial Skipper	plex_library_path  Plex Media Scanner	     Plex Relay		Plex Transcoder   Resources
sh-4.3$ ./Plex\ Media\ Scanner --list
  4: demo
  3: Music
  1: Television
sh-4.3$

Thanks. I tried a few different export commands, but not that one.

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