Plex Media Scanner returning nothing on "--list"

My plex is working normally with a tv section, and a movies section etc.

However, on running “/usr/lib/plexmediaserver/Plex\ Media\ Scanner --list” - it returns nothing, and doesn’t show my various sections; however the plex server proper still sees / serves content properly.

I’ve recently changed the ‘PLEX_MEDIA_SERVER_USER’ account that the plex server runs under in /etc/default/plexmediaserver - would that be related?

How can i fix this (or debug it), so that i can manually update libraries when required? The log (cat ‘/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Logs/Plex\ Media\ Scanner.log’) does not show any errors that i can see, relating to having zero sections?

thank you

I too am having this issue. Running the following commands does nothing.

export LD_LIBRARY_PATH=/usr/lib/plexmediaserver
/usr/lib/plexmediaserver/Plex\ Media\ Scanner --list

You may be running into the issue of needing a plex token.
Open a browser and try:
http://[PMS_IP_Address]:32400/library/sections
If you get 401 Unauthorized then you do indeed need your Plex Token

Then from the CLI use curl -X GET "http://127.0.0.1:32400/library/sections?X-Plex-Token=XXXXXXXXXX"

REF: https://support.plex.tv/hc/en-us/articles/204059436-Finding-your-account-token-X-Plex-Token

And if I don’t get the 401 Unauthorized?

This is what I get when trying to update from the CL

logged_in_user@MediaServer:/usr/lib/plexmediaserver$ export LD_LIBRARY_PATH="/usr/lib/plexmediaserver"
logged_in_user@MediaServer:/usr/lib/plexmediaserver$ export LANG=“en_US.UTF-8”
logged_in_user@MediaServer:/usr/lib/plexmediaserver$ export PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS=“6”
logged_in_user@MediaServer:/usr/lib/plexmediaserver$ export PLEX_MEDIA_SERVER_TMPDIR="/tmp"
logged_in_user@MediaServer:/usr/lib/plexmediaserver$ export PLEX_MEDIA_SERVER_HOME="/usr/lib/plexmediaserver"
logged_in_user@MediaServer:/usr/lib/plexmediaserver$ export PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR="/var/lib/plexmediaserver/Library/Application Support"
logged_in_user@MediaServer:/usr/lib/plexmediaserver$ /usr/lib/plexmediaserver/Plex\ Media\ Scanner --scan --refresh --section 1
terminate called after throwing an instance of ‘std::runtime_error’
what(): Codecs: Initialize: ‘Failed to create UUID file’
****** PLEX MEDIA SCANNER CRASHED, CRASH REPORT WRITTEN: /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Crash Reports/2ff58c4b-ce26-74eb-487b1f4c-14ffe8f9-v-1.0.3.2461-35f0caa.dmp
Aborted (core dumped)

@TheCli3nt said:
And if I don’t get the 401 Unauthorized?

So entering that URL in a browser would return your library list if a plex token isn’t required.
Did you get the library list returned?

yes, I get the library list returned. But as you can see above, when I try to run the command from the terminal, it crashes

@TheCli3nt Did you ever get this resolved? I am stuck, same exact issue. Trying to update from linux command line.

Plex Media Scanner is UID sensitive.

It must be invoked as user plex
There are two libraries on this test server.

[chuck@lizum ~.68]$ su - plex
Password: 
-sh-4.4$ export LD_LIBRARY_PATH=/usr/lib/plexmediaserver
-sh-4.4$ export PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR="/var/lib/plexmediaserver/Library/Application Support"
-sh-4.4$ cd /usr/lib/plexmediaserver
-sh-4.4$ ./Plex\ Media\ Scanner --list
  2: TV
  1: Movies
-sh-4.4$ 
1 Like

Another way is to run it with:

sudo su -l plex -s /bin/bash -c "LD_LIBRARY_PATH=/usr/lib/plexmediaserver PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR='/var/lib/plexmediaserver/Library/Application Support' /usr/lib/plexmediaserver/Plex\ Media\ Scanner --list"
1 Like

fantastic thank you so much