trakt / Plex-Trakt-Scrobbler

Add what you are watching on Plex to trakt.tv
1.44k stars 167 forks source link

Plex Plugin does NOT work with Nvidia shield: Critical Error unable to import the playhouse.apsw_ext library #543

Open arhammer77 opened 4 years ago

arhammer77 commented 4 years ago

Plex Server running on nvidia shield with metadata in separate USB drive. Media is also on separate USB drives attached to shield.

Stopped Plex server Copied the plugin over manually to the plugin folder Restarted Plex server

Tried to run Trakt plugin and got this:

Critical Error unable to import the playhouse.apsw_ext library

019-10-19 21:26:11,239 - plugin.core.message (2a2c459548) : CRITICAL (plugin.core.message:77) - Unable to import the apsw library (dlopen failed: couldn't map "/storage/64A5-F009/Android/data/com.plexapp.mediaserver.smb/Plex Media Server/Plug-in Support/Data/com.plexapp.plugins.trakttv/Libraries/Android/aarch64/ucs2/apsw.so" segment 0: Operation not permitted) Traceback (most recent call last): File "/storage/64A5-F009/Android/data/com.plexapp.mediaserver.smb/Plex Media Server/Plug-ins/Trakttv.bundle/Contents/Libraries/Shared/exception_wrappers/libraries/apsw.py", line 16, in <module> from apsw import * ImportError: dlopen failed: couldn't map "/storage/64A5-F009/Android/data/com.plexapp.mediaserver.smb/Plex Media Server/Plug-in Support/Data/com.plexapp.plugins.trakttv/Libraries/Android/aarch64/ucs2/apsw.so" segment 0: Operation not permitted 2019-10-19 21:26:11,543 - pyemitter (2a2c459548) : DEBUG (pyemitter:45) - [exception_wrappers.manager.Manager]:emit(event: 'exception', args: ('peewee', 'Unable to import the playhouse.apsw_ext library (dlopen failed: couldn\'t map "/storage/64A5-F009/Android/data/com.plexapp.mediaserver.smb/Plex Media Server/Plug-in Support/Data/com.plexapp.plugins.trakttv/Libraries/Android/aarch64/ucs2/apsw.so" segment 0: Operation not permitted)', (<type 'exceptions.ImportError'>, ImportError('dlopen failed: couldn\'t map "/storage/64A5-F009/Android/data/com.plexapp.mediaserver.smb/Plex Media Server/Plug-in Support/Data/com.plexapp.plugins.trakttv/Libraries/Android/aarch64/ucs2/apsw.so" segment 0: Operation not permitted',), <traceback object at 0x2a309ce830>)), kwargs: {}) 2019-10-19 21:26:11,544 - plugin.core.message (2a2c459548) : CRITICAL (plugin.core.message:77) - Unable to import the playhouse.apsw_ext library (dlopen failed: couldn't map "/storage/64A5-F009/Android/data/com.plexapp.mediaserver.smb/Plex Media Server/Plug-in Support/Data/com.plexapp.plugins.trakttv/Libraries/Android/aarch64/ucs2/apsw.so" segment 0: Operation not permitted) Traceback (most recent call last): File "/storage/64A5-F009/Android/data/com.plexapp.mediaserver.smb/Plex Media Server/Plug-ins/Trakttv.bundle/Contents/Libraries/Shared/exception_wrappers/libraries/playhouse/apsw_ext.py", line 24, in <module> from playhouse.apsw_ext import * File "/storage/64A5-F009/Android/data/com.plexapp.mediaserver.smb/Plex Media Server/Plug-ins/Trakttv.bundle/Contents/Libraries/Shared/playhouse/apsw_ext.py", line 19, in <module> import apsw ImportError: dlopen failed: couldn't map "/storage/64A5-F009/Android/data/com.plexapp.mediaserver.smb/Plex Media Server/Plug-in Support/Data/com.plexapp.plugins.trakttv/Libraries/Android/aarch64/ucs2/apsw.so" segment 0: Operation not permitted com.plexapp.plugins.trakttv.log

agneevX commented 4 years ago

This should work:

cd /tmp
wget --quiet https://www.dropbox.com/s/jo9jam8n73htkqc/trakt.zip?dl=1 -O trakt.zip
unzip trakt.zip > /dev/null
cd trakt
sudo cp apsw.so /usr/lib/plexmediaserver/Resources/Python/lib/python2.7/lib-dynload
sudo cp com.plexapp.plugins.trakttv.db com.plexapp.plugins.trakttv.db-shm com.plexapp.plugins.trakttv.db-wal  "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-in Support/Databases"
cd "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-in Support/Databases"
sudo chown plex:plex com.plexapp.plugins.trakttv.db com.plexapp.plugins.trakttv.db-shm com.plexapp.plugins.trakttv.db-wal
sudo chmod 644 com.plexapp.plugins.trakttv.db com.plexapp.plugins.trakttv.db-shm com.plexapp.plugins.trakttv.db-wal
sudo systemctl restart plexmediaserver

Substitute the paths, if needed.

johnmarshall515 commented 4 years ago

This should work:

cd /tmp
wget --quiet https://www.dropbox.com/s/jo9jam8n73htkqc/trakt.zip?dl=1 -O trakt.zip
unzip trakt.zip > /dev/null
cd trakt
sudo cp apsw.so /usr/lib/plexmediaserver/Resources/Python/lib/python2.7/lib-dynload
sudo cp com.plexapp.plugins.trakttv.db com.plexapp.plugins.trakttv.db-shm com.plexapp.plugins.trakttv.db-wal  "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-in Support/Databases"
cd "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-in Support/Databases"
sudo chown plex:plex com.plexapp.plugins.trakttv.db com.plexapp.plugins.trakttv.db-shm com.plexapp.plugins.trakttv.db-wal
sudo chmod 644 com.plexapp.plugins.trakttv.db com.plexapp.plugins.trakttv.db-shm com.plexapp.plugins.trakttv.db-wal
sudo systemctl restart plexmediaserver

Substitute the paths, if needed.

Can you repost the dropbox link? It’s down

agneevX commented 4 years ago

Sorry about that. https://www.dropbox.com/s/8139onakej9xfyj/trakt.zip?dl=0

johnmarshall515 commented 4 years ago

Sorry about that. https://www.dropbox.com/s/8139onakej9xfyj/trakt.zip?dl=0

Thank you.

Okay so i fixed the path for the nvidia shield and placed the apsw.so file under:

“/storage/emulated/0/Android/data/com.plexapp.mediaserver.smb/Plex Media Server/Plug-in Support/Data/com.plexapp.plugins.trakttv/Libraries/Android/aarch64/ucs2/apsw.so”

But now the error has changed to:

ImportError: dlopen failed: “/storage/emulated/0/Android/data/com.plexapp.mediaserver.smb/Plex Media Server/Plug-in Support/Data/com.plexapp.plugins.trakttv/Libraries/Android/aarch64/ucs2/apsw.so” is 32-bit instead of 64-bit

So I think the problem is that the apsw.so was compiled for armV7 but needs to be compiled for aarch64. Problem is I have no idea how to do that so im hoping you know how or can point me in the right direction.

agneevX commented 4 years ago

Is this on Nvidia Shield?

johnmarshall515 commented 4 years ago

Is this on Nvidia Shield?

Yes

TonioBDS commented 4 years ago

Plex Server running on nvidia shield with metadata in separate USB drive. Media is also on separate USB drives attached to shield.

Stopped Plex server Copied the plugin over manually to the plugin folder Restarted Plex server

Tried to run Trakt plugin and got this:

Critical Error unable to import the playhouse.apsw_ext library

Hello johnmarshall515. I have the same problem to install the trakt plugin on my non-rooted Shield Pro (2019) running PMS with metadata located in unser accessible USD drive. Did you ever manage to make it work ? And if yes, how did you do please ?

Actually I don't even know how I should to run the commands provided by agneevX:

cd /tmp
wget --quiet https://www.dropbox.com/s/jo9jam8n73htkqc/trakt.zip?dl=1 -O trakt.zip
unzip trakt.zip > /dev/null
cd trakt
sudo cp apsw.so /usr/lib/plexmediaserver/Resources/Python/lib/python2.7/lib-dynload
sudo cp com.plexapp.plugins.trakttv.db com.plexapp.plugins.trakttv.db-shm com.plexapp.plugins.trakttv.db-wal  "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-in Support/Databases"
cd "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-in Support/Databases"
sudo chown plex:plex com.plexapp.plugins.trakttv.db com.plexapp.plugins.trakttv.db-shm com.plexapp.plugins.trakttv.db-wal
sudo chmod 644 com.plexapp.plugins.trakttv.db com.plexapp.plugins.trakttv.db-shm com.plexapp.plugins.trakttv.db-wal
sudo systemctl restart plexmediaserver

Do you access to you Nvidia shield through SSH ? What kind of SSH server did you installed on your shield ? Please let me know. Thank you all