Server Version#: 1.22.1.4228 (but probably has been an issue for a while)
Player Version#: N/A
I came across the same issue as this forum post (calling PMS Scanner from CLI gave a weird error about a database column being nonexistent, even though it is an incorrect error message).
However, when checking the schema of the tables, there was no issue with the database whatsoever, albeit the scanner CLI saying that it couldn’t find a column (I don’t think there was an issue in the original post either, just misinterpretation of default values in sqlite3).
After some searching, I found this fix here. To copypasta in case the link goes down some day,
export LD_LIBRARY_PATH=/usr/lib/plexmediaserver:/usr/lib/plexmediaserver/lib
export PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/var/lib/plexmediaserver/Library/Application\ Support
before running your scanner. Perhaps set the rest of the env vars as listed in the service (see sudo systemctl cat plexmediaserver.service on modern debian, or /usr/lib/plexmediaserver/) as well just in case for other uses.
Which means that either
-
tools like the scanner, crash uploader, and any other tools that are meant to be called from the command line, can’t in some Linux distributions because some configuration is not being installed
-
the tools mentioned aren’t supposed to rely on these variables / their default (when the env is non-existent) values are incorrect on (at least) Ubuntu 20.04
-
When things switched to systemd devs decided to put the environment set up in a service for the account, rather than the account itself, by accident.
-
the fact that you have to manually set this up is undocumented / hard to find
In either case that error is just weird. It seems as though database existence isn’t checked.
There’s also a very weird empty folder created - “/usr/lib/plexmediaserver/’.”, as in the last leaf in that path is '.
This is less of a “hey help me” post and more of a “hey here’s something that seems to incorrect and I can’t tell which / why, it should probably be fixed / documented”, in case someone else comes along spending several hours screaming at the sky as to why they can’t run the scanner from the CLI and can’t fix the database.
