Plex Plugin looks in wrong directory

    • OMV 2.x

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Plex Plugin looks in wrong directory

      I installed the Trakter plugin for Plex, but doesn't get it to run, first it was looking in the "wrong" directory.

      It wanted the "Plug-in Support" directory under /usr/lib/plexmediaserver/Resources and not under /media/UUID/plexmedia....
      So I created the folder in usr/lib... but then I get some other errors about files and directorys It can't find, see log.

      I wonder if It's possible to do something with the plugin to look in the /media/UUID/plex.... folder instead?

      And I'm also missing some libs, just to apt-get install them?
      Like pyopenssl?

      Logfile - pastebin.com/syAUtq0C

      Best Regards,
      Noiden
    • I want to symlink the following directory,
      /usr/lib/plexmediaserver/Resources/Plug-in Support/ to /media/a13efef6-cf13-4fd1-912c-9e626298cb16/plexmediaserver/Library/Application Support/Plex Media Server/Plug-in Support
      ^^^^ This is where the plugin looks. ^^^ Here is where the files actually are.

      Edit.

      I managed to make the symlink, all good, but now I get this folowing error.

      Source Code

      1. 2016-02-21 21:31:36,890 - plugin.core.libraries.main (7fdb9a9dd700) : ERROR (plugin.core.libraries.main:55) - apsw: unavailable - Exception raised in 'test_import': /usr/lib/plexmediaserver/Resources/Plug-in Support/Data/com.plexapp.plugins.trakttv/Libraries/Linux/x86_64/ucs4/apsw.so: failed to map segment from shared object: Operation not permitted
      2. Traceback (most recent call last):
      3. File "/usr/lib/plexmediaserver/Resources/Plug-ins-7efd046/Trakttv.bundle/Contents/Libraries/Shared/plugin/core/libraries/tests/core/base.py", line 33, in run
      4. result = func()
      5. File "/usr/lib/plexmediaserver/Resources/Plug-ins-7efd046/Trakttv.bundle/Contents/Libraries/Shared/plugin/core/libraries/tests/apsw_.py", line 9, in test_import
      6. import apsw
      7. ImportError: /usr/lib/plexmediaserver/Resources/Plug-in Support/Data/com.plexapp.plugins.trakttv/Libraries/Linux/x86_64/ucs4/apsw.so: failed to map segment from shared object: Operation not permitted
      8. 2016-02-21 21:31:37,919 - com.plexapp.plugins.trakttv (7fdb9a9dd700) : CRITICAL (com.plexapp.plugins.trakttv:615) - Exception starting plug-in (most recent call last):
      9. File "/usr/lib/plexmediaserver/Resources/Plug-ins-7efd046/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/core.py", line 608, in start
      10. self.sandbox.execute(self.init_code)
      11. File "/usr/lib/plexmediaserver/Resources/Plug-ins-7efd046/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/code/sandbox.py", line 256, in execute
      12. exec(code) in self.environment
      13. File "/usr/lib/plexmediaserver/Resources/Plug-ins-7efd046/Trakttv.bundle/Contents/Code/__init__.py", line 44, in <module>
      14. import interface
      15. File "/usr/lib/plexmediaserver/Resources/Plug-ins-7efd046/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/code/sandbox.py", line 333, in __import__
      16. return mod.load_module(_name)
      17. File "/usr/lib/plexmediaserver/Resources/Plug-ins-7efd046/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/code/sandbox.py", line 44, in load_module
      18. module = RestrictedModule(name, path, sandbox)
      19. File "/usr/lib/plexmediaserver/Resources/Plug-ins-7efd046/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/code/loader.py", line 30, in __init__
      20. exec(code) in self.__dict__
      21. File "/usr/lib/plexmediaserver/Resources/Plug-ins-7efd046/Trakttv.bundle/Contents/Code/interface/__init__.py", line 4, in <module>
      22. import m_sync
      23. File "/usr/lib/plexmediaserver/Resources/Plug-ins-7efd046/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/code/sandbox.py", line 333, in __import__
      24. return mod.load_module(_name)
      25. File "/usr/lib/plexmediaserver/Resources/Plug-ins-7efd046/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/code/sandbox.py", line 44, in load_module
      26. module = RestrictedModule(name, path, sandbox)
      27. File "/usr/lib/plexmediaserver/Resources/Plug-ins-7efd046/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/code/loader.py", line 30, in __init__
      28. exec(code) in self.__dict__
      29. File "/usr/lib/plexmediaserver/Resources/Plug-ins-7efd046/Trakttv.bundle/Contents/Code/interface/m_sync.py", line 8, in <module>
      30. from plugin.managers.account import AccountManager
      31. File "/usr/lib/plexmediaserver/Resources/Plug-ins-7efd046/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/code/sandbox.py", line 345, in __import__
      32. raise e
      33. ImportError: /usr/lib/plexmediaserver/Resources/Plug-in Support/Data/com.plexapp.plugins.trakttv/Libraries/Linux/x86_64/ucs4/apsw.so: failed to map segment from shared object: Operation not permitted
      Display All


      This error is reported on Trakt.tv plexplugin github page.Btw, why is some stuff on the /media/ (RAID-device) and some other stuff (/usr/lib/plex...) on the system disk? To save space on the system disk?

      The post was edited 2 times, last by NoidPurity ().

    • tekkb wrote:

      You know how to delete the symlink file yes??? When you make a symlink it just creates a small file you can delete. Delete it.

      cd /usr/lib
      ln -s /media/a13efef6-cf13-4fd1-912c-9e626298cb16/plexmediaserver plexmediaserver


      Why should i symlink like that? then I will loose the whole plexmediaserver

      /usr/lib/plexmediaserver# ll
      total 148520
      drwxr-xr-x 3 root root 4096 Feb 7 23:05 .
      drwxr-xr-x 45 root root 4096 Feb 21 21:14 ..
      -rwxr-xr-x 1 root root 3198264 Jan 22 10:47 Plex DLNA Server
      -rwxr-xr-x 1 root root 4052696 Jan 22 10:47 Plex Media Scanner
      -rwxr-xr-x 1 root root 10063976 Jan 22 10:47 Plex Media Server
      drwxr-xr-x 9 root root 4096 Feb 21 21:22 Resources
      -rw-r--r-- 1 root root 10420752 Jan 16 23:41 libavcodec.so.56
      -rw-r--r-- 1 root root 1928664 Jan 16 23:41 libavformat.so.56
      -rw-r--r-- 1 root root 341912 Jan 16 23:41 libavutil.so.54
      -rw-r--r-- 1 root root 3878666 Jan 16 23:31 libboost_chrono.so.1.59.0
      -rw-r--r-- 1 root root 2484308 Jan 16 23:31 libboost_filesystem.so.1.59.0
      -rw-r--r-- 1 root root 1573492 Jan 16 23:31 libboost_iostreams.so.1.59.0
      -rw-r--r-- 1 root root 4963859 Jan 16 23:31 libboost_locale.so.1.59.0
      -rw-r--r-- 1 root root 5702819 Jan 16 23:31 libboost_program_options.so.1.59.0
      -rw-r--r-- 1 root root 5297804 Jan 16 23:31 libboost_regex.so.1.59.0
      -rw-r--r-- 1 root root 1123625 Jan 16 23:31 libboost_signals.so.1.59.0
      -rw-r--r-- 1 root root 984782 Jan 16 23:31 libboost_system.so.1.59.0
      -rw-r--r-- 1 root root 3865292 Jan 16 23:31 libboost_thread.so.1.59.0
      -rw-r--r-- 1 root root 353144 Jan 16 23:31 libboost_timer.so.1.59.0

      and so on....

      /media/a13efef6-cf13-4fd1-912c-9e626298cb16/plexmediaserver# ll
      total 12
      drwxr-xr-x 3 plex plex 4096 Feb 7 23:06 .
      drwxr-xr-x 5 root root 4096 Feb 10 21:26 ..
      drwxr-xr-x 3 plex plex 4096 Feb 7 23:06 Library

      In this directory there are only some stuff not all, I don't know why the plexmediaserver plugin make things on different places, must be to save space on the system drive?
    • tekkb wrote:

      You are right. I was thinking that was default location for the plexmediaserver folder before it is moved to data drive. I am working on something..
      I have to look it up...


      I have already fixed the symlink =) I have another error with the plug-in now, but it's posted to the one making the plug-in on github. =)

      Thanks for the help tough. =)
    • The problem is stated right in that github thread. There is something in the plugin that needs to be executable. For us on OMV the database directory is moved to a data disk that is mounted noexec. You either need to remove the noexec from the data drive on which the plex database resides, in /etc/fstab. Or you need to move the executable to a folder on the system drive and then create symlinks to the location where it resided originally with the plugin.
    • Something must have changed recently in OMV of PLEX as this used to work properly. I used to have all my plugins located at /media/UUID/plexmediaserver now I had to move them to var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/

      Also, I notice that the data in the cache and Logs folder in var/lib/plexmediaserver/Library/Application Support/Plex Media Server/ have today date but the stuff at /media/UUID/plexmediaserver/Library/Application Support/Plex Media Server/ has a old date.

      I think that the Plex plugin is not using the database volume or path that I setup in the OMV front end for some reason. I tried moving it from one data drive to another and it took a long time but I don't think it actually did any thing.

      Any idea on how I can verify where Plex library should be storing things?
      omv 3.0.73 (Erasmus) | 64 bit
      NAS Details: New Server Build
    • Well, my
      cat /etc/passwd | grep plex
      says
      plex:x:112:116::/media/78a7d468-27ad-4e74-950e-307898c7ee40/plexmediaserver:/bin/bash

      and I get the error when the plugin tries to load native libraries:

      2016-03-01 00:42:22,853 - plugin.core.libraries.main (7f2e57a5c700) : INFO (plugin.core.libraries.main:45) - Testing native library support...
      2016-03-01 00:42:22,873 - plugin.core.libraries.main (7f2e57a5c700) : ERROR (plugin.core.libraries.main:55) - apsw: unavailable - Exception raised in 'test_import': /media/78a7d468-27ad-4e74-950e-307898c7ee40/plexmediaserver/Library/Application Support/Plex Media Server/Plug-in Support/Data/com.plexapp.plugins.trakttv/Libraries/Linux/x86_64/ucs4/apsw.so: failed to map segment from shared object: Operation not permitted
      Traceback (most recent call last):
      File "/media/78a7d468-27ad-4e74-950e-307898c7ee40/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Trakttv.bundle/Contents/Libraries/Shared/plugin/core/libraries/tests/core/base.py", line 33, in run
      result = func()
      File "/media/78a7d468-27ad-4e74-950e-307898c7ee40/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Trakttv.bundle/Contents/Libraries/Shared/plugin/core/libraries/tests/apsw_.py", line 9, in test_import
      import apsw

      I think disabling the noexec on the data partition is only a temporary solution.
      I also believe that something must have changed recently in OMV, as this used to work properly. (Others are saying this on github as well)