I am a Plex newcomer and have just installed on Ubuntu 14.04.5 LTS (host with IP address 192.168.23.8). I have only done the following:
- Downloaded the 64-bit deb package (plexmediaserver_1.10.1.4602-f54242b6b_amd64.deb)
- dpkg -i plexmediaserver_1.10.1.4602-f54242b6b_amd64.deb
- ssh -L 32400:localhost:32400 192.168.23.8
- Open a web browser to http://localhost:32400/web
- Add a library
Unfortunately no media from this library can be found.
Investigating further, there are a bunch of errors in /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Logs/Plex Media Scanner.log:
Jan 05, 2018 20:41:36.969 [0x7f07075a4840] DEBUG - Downloading document http://127.0.0.1:32400/library/changestamp
Jan 05, 2018 20:41:36.969 [0x7f07075a4840] DEBUG - HTTP requesting GET http://127.0.0.1:32400/library/changestamp
Jan 05, 2018 20:41:36.970 [0x7f07075a4840] DEBUG - HTTP 401 response from GET http://127.0.0.1:32400/library/changestamp
Jan 05, 2018 20:41:36.970 [0x7f07075a4840] ERROR - downloadContainer: expected MediaContainer element, found html
Jan 05, 2018 20:41:36.970 [0x7f07075a4840] ERROR - Exception inside transaction (inside=1) (…/Library/Episode.cpp:187): Unable to allocate a changestamp from the server
Jan 05, 2018 20:41:36.970 [0x7f07075a4840] ERROR - Exception inside transaction (inside=1) (…/Library/MetadataItem.cpp:2903): Unable to allocate a changestamp from the server
Jan 05, 2018 20:41:36.970 [0x7f07075a4840] ERROR - Exception assimilating media item in programme name/Season 2: Unable to allocate a changestamp from the server
Investigating further:
curl http://localhost:32400/library/changestamp
Unauthorized
401 Unauthorized
So it appears as though there is a permission problem preventing the scanner from working.
How can I fix this?
Would you care to make a tar.gz of ./Logs and upload it here?
I think the remote is having a permissions problem , specifically which UID owns the directories. The logs will confirm it
Which directories are of concern here?
/var/lib/plexmediaserver is owned by plex:plex, as are the plexmediaserver processes. The library is owned by another user, but all folders and files within it have read access to all. I notice under the “Folders” view that Plex can see the folders in the library, but doesn’t recognise any files within them.
apologies. I didn’t get a notification until just now.
- Who is user
a@b.c ?
- what username is PMS running as?
- does that username own
/var/lib/plexmediaserver (or wherever relocated to) and all files & directories below it?
The log is full of permission denied (as you see) which tells me a) a@b.c doesn’t have permission or b) the PMS runtime username doesn’t have permission at the OS/Filesystem level .
In response:
- I replaced all instances of my email address in the logs to
a@b.c for privacy.
- PMS is running as
plex.
-
/var/lib/plexmediaserver is also owned by plex. Note that this was a fresh install.
Curiously, I tried adding a music library, then rescanned TV programmes, and it started working. Therefore I wager that there’s a bug here- adding just a TV programmes library on a fresh install prevents the scanner from detecting any programmes.
In Linux, if PMS can’ scan and add media, the vast majority of problems are either a) permission reading the source media and directory structure or b) how the media is named. Linux permissions are such a common problem to anyone new to Linux, I wrote a How-To to assist with the variety of ways you can make media available to PMS
Can you help me out with some information such as naming & structure? I request this presuming the scanner has file system permission to read. If media is still not added, how the files are named is the next most common problem and subject to review
As I said, the TV programme scanner mysteriously started working after I added a music library, so this problem is unrelated to file permission or media naming. When it started scanning, it found all of my TV programmes correctly, and the following started appearing in the log:
Jan 20, 2018 20:04:51.589 [0x7fcfd83ff700] DEBUG - Downloading document http://127.0.0.1:32400/library/changestamp
Jan 20, 2018 20:04:51.589 [0x7fcfd83ff700] DEBUG - HTTP requesting GET http://127.0.0.1:32400/library/changestamp
Jan 20, 2018 20:04:51.591 [0x7fcfd83ff700] DEBUG - HTTP 200 response from GET http://127.0.0.1:32400/library/changestamp
… thus demonstrating that /library/changestamp is returning HTTP 200 rather than HTTP 401 now.
Therefore I assert that something to do with TV programmes being the first library is causing /library/changestamp to return HTTP 401 rather than 200 and hence for all media scanning to fail.
Well, thats weird. Had the exact same issues on a fresh install. Removed my library. Added a music library, next added movies now it suddenly works.