libboost_system.so.1.59.0 - missing but are in folder

Hi

Im trying to do a manual scan via terminal commands on my Debian 8 setup, but when I run;
(sudo) /usr/lib/plexmediaserver/Plex\ Media\ Scanner --list

I only get the following error;
/usr/lib/plexmediaserver/Plex Media Scanner: error while loading shared libraries: libboost_system.so.1.59.0: cannot open shared object file: No such file or directory

Thing is that the file that its says its missing are in the folder.

Anyone know a fix for this?

Hawk

Do those files have the correct permissions? There was someone last week who updated his Debian Sid machine and all of the libboost files were somehow changed to drw-rw-rw-, ie missing the executable flag, which would prevent the system from running them.

https://support.plex.tv/hc/en-us/articles/200288596-Linux-Permissions-Guide

Files should have enough permissions to run, so dont think thats the issue;

-rwxr-xr-x 1 root root 984782 Jan 16 23:31 libboost_system.so.1.59.0

You LD_LIBRARY_PATH doesn’t include /usr/lib/plexmediaserver

If using /bin/tcsh:

setenv LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/lib/plexmediaserver"

Adjust syntax to match your shell

@ChuckPa said:
You LD_LIBRARY_PATH doesn’t include /usr/lib/plexmediaserver

If using /bin/tcsh:

setenv LD_LIBRARY_PATH=“${LD_LIBRARY_PATH}:/usr/lib/plexmediaserver”

Adjust syntax to match your shell

Could you please explain this some more? Dont really get what I need to do.

@ChuckPa said:
You LD_LIBRARY_PATH doesn’t include /usr/lib/plexmediaserver

If using /bin/tcsh:

setenv LD_LIBRARY_PATH=“${LD_LIBRARY_PATH}:/usr/lib/plexmediaserver”

Adjust syntax to match your shell

After some searching I found what you where talking about, but its in the path your mention;

[Service]
Environment=“PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/var/lib/plexmediaserver/Library/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
Environment=LC_ALL=en_US.UTF-8
Environment=LANG=en_US.UTF-8
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

Perhaps this will explain it better.
Performing a ‘sudo sh’ gives the ‘sh-4.3’ prompt.

‘env | grep LD’ having no output shows no LD_LIBRARY_PATH defined.

sh-4.3# env | grep LD
sh-4.3# /usr/lib/plexmediaserver/Plex\ Media\ Scanner
/usr/lib/plexmediaserver/Plex Media Scanner: error while loading shared libraries: libboost_system.so.1.59.0: cannot open shared object file: No such file or directory
sh-4.3# LD_LIBRARY_PATH=/usr/lib/plexmediaserver ; export LD_LIBRARY_PATH
sh-4.3# /usr/lib/plexmediaserver/Plex\ Media\ Scanner
Plex Media Scanner (c) 2010-2014 Plex Development Team.

  -h, --help           Display this message.
  -v, --verbose        Show more output.
  -p, --progress       Show special progress output.
  --log-file-suffix    Specify suffix for log file.

 Actions:

  -r, --refresh        Refresh the metadata.
  -a, --analyze        Analyze media information.
  -b, --index          Generate a media index file.
  -s, --scan           Scan for new media.
  -i, --info           Get information.
  -l, --list           List.
  -g, --generate       Regenerate thumbnails/fanart.
  -t, --tree           Show a section tree.
  -w, --reset          Delete all media out of a section.
  -n, --add-section <name> --type <type:1,2,8> --agent <identifier> --location <path> --lang <code> Add a new section.
  -D, --del-section    Delete a section.

 Items to which actions apply:

  -c, --section        A library section ID.
  -o, --item           An item ID.
  -d, --directory      A directory path.
  -f, --file           A file.

 Modifiers to actions:

  -x, --force          Force an operation (e.g. refresh).
  --no-thumbs          Do not regenerate thumbs when analyzing.
  --thumbOffset <percent> Percent offset into video for thumbnail image generated during media analysis.
  --artOffset <percent> Percent offset into video for fanart image generated during media analysis.

sh-4.3#

That got me abit closer atleast :slight_smile:
Now I can run the command;
/usr/lib/plexmediaserver/Plex\ Media\ Scanner --list
without errors, but it doesnt show any results, just returns to let me type more commands.

Know what Im doing wrong?
Tried with sudo first but then it just returns the same errors as before

What are you trying to do at the command line? Perhaps that’s the better question to ask.

Which section(s)? How thorough of a scan?

@ChuckPa said:
What are you trying to do at the command line? Perhaps that’s the better question to ask.

Which section(s)? How thorough of a scan?

First of all Im trying to get the command to list all my sections so I know the numbers of each section I have. Then Im gone try and use that to scan, both for new media and full scan of one section.

As of now it doenst do anything I want.

To list your section IDs,

  1. Go get your Plex ‘Token’ . Here’s how: https://support.plex.tv/hc/en-us/articles/204059436-Finding-your-account-token-X-Plex-Token

    It says “Token” its your “X-Plex-Token”

  2. Use this query to retrieve your list of sections

http://Your_Server_Here:32400/library/sections?X-Plex-Token=Your_Token_Here

If you want the epitome of laziness, you can:

http://Your_Server_Here:32400/library/sections/Section_ID_Here/refresh?X-Plex-Token=Your_Token_Here

It’s the same as you hitting Update

Adding &force=1 to the query will make it throw out all the analysis and force as if fresh, all over again.

Thanks, this gives me the section numbers atleast.
But still doesnt let me run a scanning command via terminal like I want.
Want to use terminal command to setup an autoscan on one section every day at a set time.
Havnt found that option in plex settings other then a full scan of all sections, and I dont want that.

Thats the reason I want to get terminal to work :slight_smile:
But now that I can get the sections, I’ll see if that helps out on the command.

Thanks

with the section IDs, you use ‘-s section_id’ to do the scan.

You don’t need to be the plex user either.

#!/bin/sh
LD_LIBRARY_PATH=/usr/lib/plexmediaserver ; export LD_LIBRARY_PATH

/usr/lib/plexmediaserver/Plex\ Media\ Scanner -s _Section_ID_HERE_

Didnt work :confused:
Tried both doing the commands manually and by creating a .sh file to run. (yes rememberd to chmod the file)
Without sudo before the command, nothing happens. With sudo before the command I get this;
:~/plex$ sudo /usr/lib/plexmediaserver/Plex\ Media\ Scanner -s 8
/usr/lib/plexmediaserver/Plex Media Scanner: error while loading shared libraries: libboost_system.so.1.59.0: cannot open shared object file: No such file or directory

And I did run the LD_LIBRARY_PATH command before the /usr/lib/plexmediaserver/Plex\ Media\ Scanner -s 8 command.

If you are running Plex as root (default) you’ll need to su to root and do

LD_LIBRARY_PATH=/usr/lib/plexmediaserver ; export LD_LIBRARY_PATH

before you run Plex Media Scanner. This is because when you “sudo” it runs the command in a new child shell which won’t have that export.

I have the exact same problem as Hawk1984. I want to update the library at the end of a script that I run which moves content into a directory that Plex watches.

When the transfer is complete, I want to trigger a library scan / update.

Sadly, /usr/lib/plexmediaserver/Plex\ Media\ Scanner --list has no output at all.

Does anyone have a guide on how to use plex in a cli or can help me with this issue?

The scanner is user-senstivie.

[chuck@lizum plexmediaserver.111]$ sudo sh
sh-4.3# su plex
bash-4.3$ export LD_LIBRARY_PATH=/usr/lib/plexmediaserver
bash-4.3$ export PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR="/var/lib/plexmediaserver/Library/Application Support"
bash-4.3$ pwd
/usr/lib/plexmediaserver
bash-4.3$ ./Plex\ Media\ Scanner --list
  1: Movies
  3: Music
  2: Television
bash-4.3$ 
1 Like

Thank you ChuckPA!, that did the trick.

As a workaround I found that I could just curl this

http://Your_Server_Here:32400/library/sections/Section_ID_Here/refresh?X-Plex-Token=Your_Token_Here

But now to use the scanner cli i have to run the script as Plex i guess.