3

I am trying to install plexmediaplayer from source. This involves compiling libmpv.so.1 which I've done and installed under /usr/local/lib

When I run plexmediaplayer, I get the following error:

$ plexmediaplayer 
plexmediaplayer: error while loading shared libraries: libmpv.so.1: cannot open shared object file: No such file or directory

ldconfig finds the library correctly:

$ ldconfig -v | grep libmpv
libmpv.so.1 -> libmpv.so.1.24.0

ldd on the plexmiediaplayer binary shows libmpv:

$ ldd plexmediaplayer | grep libmpv
libmpv.so.1 => /usr/local/lib/libmpv.so.1 (0x00007f2fe4f33000)

which is a symlink:

ls -l /usr/local/lib/libmpv.so.1
lrwxrwxrwx 1 root root 16 Feb  9 20:37 /usr/local/lib/libmpv.so.1 -> libmpv.so.1.24.0

both the shared object and executable are compiled for x86_64 and readable by the non-root user trying to run plexmediaplayer:

$ file /usr/local/lib/libmpv.so.1.24.0
/usr/local/lib/libmpv.so.1.24.0: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=855d9cbf952c76e3c0c1c1a162c4c94ea5a12b91, not stripped
$ file /usr/local/bin/plexmediaplayer 
/usr/local/bin/plexmediaplayer: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=dc92ac026c5ac7bc3e5554a591321de81a3f4576, not stripped

These both match my machine arch:

$ uname -a
Linux hostname 4.4.0-66-generic #87-Ubuntu SMP Fri Mar 3 15:29:05 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

Running strace on plexmediaplayer gives the following:

$ strace -o lotsalogs -ff -e trace=file plexmediaplayer
open("/opt/Qt5.8.0/5.8/gcc_64//lib/tls/x86_64/libmpv.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/opt/Qt5.8.0/5.8/gcc_64//lib/tls/libmpv.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/opt/Qt5.8.0/5.8/gcc_64//lib/x86_64/libmpv.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/opt/Qt5.8.0/5.8/gcc_64//lib/libmpv.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/libmpv.so.1", O_RDONLY|O_CLOEXEC) = -1 EACCES (Permission denied)
open("/lib/x86_64-linux-gnu/tls/x86_64/libmpv.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/tls/libmpv.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/x86_64/libmpv.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libmpv.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/x86_64-linux-gnu/tls/x86_64/libmpv.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/x86_64-linux-gnu/tls/libmpv.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/x86_64-linux-gnu/x86_64/libmpv.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/x86_64-linux-gnu/libmpv.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/lib/tls/x86_64/libmpv.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/lib/tls/libmpv.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/lib/x86_64/libmpv.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/lib/libmpv.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/tls/x86_64/libmpv.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/tls/libmpv.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/x86_64/libmpv.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/libmpv.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)

Which includes:

open("/usr/local/lib/libmpv.so.1", O_RDONLY|O_CLOEXEC) = -1 EACCES (Permission denied)

but the permissions on the file through the symlink are:

ls -l /usr/local/lib/libmpv.so.1.24.0 
-rwxr-xr-x 1 root root 27872856 Mar 22 22:17 /usr/local/lib/libmpv.so.1.24.0

Any ideas why this can't be found by my binary?

EDIT: I wiped all libmpv under /usr/local/lib and plexmediaplayer under /usr/local/bin, and removed by source directory, then reinstalled side-by-side in a VM. The build in the VM worked, the one on my host machine did not. I also hashed ld on both machines, and (unsurprisingly) they match.

  • Is there an error or something from plexmediaplayer when you start it? If so, what is that? – thrig Mar 23 '17 at 19:17
  • Sorry I forgot to include it. I've added the error to the top of my question. – Flobe Mar 23 '17 at 20:18
  • Okay can you strace -o lotsalogs -ff -e trace=file plexmediaplayer and then grep libmpv.so.1 lotsalogs.* so we can see what exactly it's failing on? – thrig Mar 23 '17 at 20:30
  • @thrig updated with strace output. – Flobe Mar 23 '17 at 20:52
  • Can you as a not-root user read the file, e.g. file /usr/local/lib/libmpv.so.1.24.0 ? – thrig Mar 23 '17 at 21:24
0

It turns out that I (badly?) configured apparmor for plexmediaplayer months ago, which caused the problem upon updating and recompiling.

0

I was able to get around this issue by running sudo cp /usr/local/lib/libmpv*.so /usr/lib32

ldd plexmediaplayer showed the same and despite the libs being there, they weren't working.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.