There was an unexpected error loading this library

@MattPC1234

Permissions 777 is a sledgehammer.

To do it correctly, putting it back to what it will be normally:

find /var/lib/plexmediaserver -type d -exec chmod 755 {} \;
find /var/lib/plexmediaserver -type f -exec chmod 644 {} \;

I had database corruption - tried restoring and addressing the corruption - neither fixed my problem until i ran chmod 777. Now we are back up and running.

I am telling you that 777 is overkill.

The database files get 644 permissions. This is a normally running PMS.

[/share/CACHEDEV3_DATA/.qpkg/PlexMediaServer/Library/Plex Media Server/Plug-in Support/Databases] # ls -la
total 1963788
drwxrwxrwx 2 admin administrators      4096 2021-03-12 21:00 ./
drwxrwxrwx 7 admin administrators      4096 2021-01-30 13:13 ../
-rw-rw-r-- 1 admin administrators    336896 2021-03-11 12:55 com.plexapp.plugins.library.blobs.db
-rw-r--r-- 1 admin administrators    336896 2021-03-03 21:01 com.plexapp.plugins.library.blobs.db-2021-03-03
-rw-r--r-- 1 admin administrators    336896 2021-03-06 21:03 com.plexapp.plugins.library.blobs.db-2021-03-06
-rw-r--r-- 1 admin administrators    336896 2021-03-09 21:03 com.plexapp.plugins.library.blobs.db-2021-03-09
-rw-r--r-- 1 admin administrators    336896 2021-03-12 21:00 com.plexapp.plugins.library.blobs.db-2021-03-12
-rw-rw-r-- 1 admin administrators     32768 2021-03-11 13:05 com.plexapp.plugins.library.blobs.db-shm
-rw-rw-r-- 1 admin administrators         0 2021-03-11 13:05 com.plexapp.plugins.library.blobs.db-wal
-rw-rw-r-- 1 admin administrators 399458304 2021-03-14 11:49 com.plexapp.plugins.library.db
-rw-r--r-- 1 admin administrators 401457152 2021-03-03 21:01 com.plexapp.plugins.library.db-2021-03-03
-rw-r--r-- 1 admin administrators 403770368 2021-03-06 21:03 com.plexapp.plugins.library.db-2021-03-06
-rw-r--r-- 1 admin administrators 403770368 2021-03-09 21:03 com.plexapp.plugins.library.db-2021-03-09
-rw-r--r-- 1 admin administrators 398588928 2021-03-12 21:00 com.plexapp.plugins.library.db-2021-03-12
-rw-rw-r-- 1 admin administrators     32768 2021-03-14 11:55 com.plexapp.plugins.library.db-shm
-rw-rw-r-- 1 admin administrators   2061448 2021-03-14 11:55 com.plexapp.plugins.library.db-wal
[/share/CACHEDEV3_DATA/.qpkg/PlexMediaServer/Library/Plex Media Server/Plug-in Support/Databases] # 

There was something else you did or overlooked.
Did you also perform a sudo chown -R plex:plex /var/lib/plexmediaserver ?
That’s part of any full permissions repair on the “Library” tree.

If files were written as root but not chown back to plex then yes, 777 would patch it but not really “Fix” it.

(Not giving you a hard time. Trying to help you get it back to 100% normal)

I think you’re right - because Ubuntu just crashed while refreshing the metadata. PMS it up and running again after reboot - for now.

Up until this point I just assumed the issue (crashing) was caused by a corrupted DB. Assuming instead that it is a file permissions issue - is ‘sudo chown -R plex:plex /var/lib/plexmediaserver’ the permanent fix as opposed to chown? Just ran the former and it worked as expected. Hoping I’m in the clear.

Don’t do 777. Please! Doing this shows you do not know much about Linux permissions. It’s horrible practice for getting any app to work. Follow @ChuckPa suggestion.

Some info on why not for any curious.

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