mynttt / UpdateTool

A tool to update the IMDB ratings for Plex libraries that contain movies/series and use the IMDB agent to receive ratings
GNU General Public License v3.0
257 stars 12 forks source link

SQLiteException when running containter #69

Closed sinewave closed 3 years ago

sinewave commented 3 years ago

Hi, just came across this app and was excited to get it running however I keep running into the error below when trying to run the container:

The only thing I changed in the template is:

  1. Plex Path = /mnt/user/appdata/binhex-plexpass/Plex Media Server/ (I'm using binhex-plexpass plex container)
  2. TMDB API Key
  3. Not using TVDB as I don't have an api key.

Unraid 6.9.2

[ERROR] - 2021-09-06 15:54:51 @ ImdbDockerImplementation$ImdbBatchJob.run: SQLiteException exception encountered...

[ERROR] - 2021-09-06 15:54:51 @ ImdbDockerImplementation$ImdbBatchJob.run: Please contact the maintainer of the application with the stacktrace below if you think this is unwanted behavior.

[ERROR] - 2021-09-06 15:54:51 @ ImdbDockerImplementation$ImdbBatchJob.run: ========================================

[ERROR] - 2021-09-06 15:54:51 @ ImdbDockerImplementation$ImdbBatchJob.run: org.sqlite.SQLiteException: [SQLITE_ERROR] SQL error or missing database (no such table: library_sections)

at org.sqlite.core.DB.newSQLException(DB.java:1012)
at org.sqlite.core.DB.newSQLException(DB.java:1024)
at org.sqlite.core.DB.throwex(DB.java:989)
at org.sqlite.core.NativeDB.prepare_utf8(Native Method)
at org.sqlite.core.NativeDB.prepare(NativeDB.java:134)
at org.sqlite.core.DB.prepare(DB.java:257)
at org.sqlite.jdbc3.JDBC3Statement.executeQuery(JDBC3Statement.java:66)
at updatetool.common.SqliteDatabaseProvider.queryFor(SqliteDatabaseProvider.java:26)
at updatetool.common.DatabaseSupport.requestLibrary(DatabaseSupport.java:83)
at updatetool.common.DatabaseSupport.requestMovieLibraries(DatabaseSupport.java:62)
at updatetool.imdb.ImdbDockerImplementation$ImdbBatchJob.run(ImdbDockerImplementation.java:220)
at updatetool.TaskWrapper.run(Main.java:252)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
[ERROR] - 2021-09-06 15:54:51 @ ImdbDockerImplementation$ImdbBatchJob.run: ========================================

[ERROR] - 2021-09-06 15:54:51 @ ImdbDockerImplementation$ImdbBatchJob.run: The application will terminate now.
randy-randerson commented 3 years ago

Seeing the same thing on my end. UnRaid version 6.8.3

mynttt commented 3 years ago

Could you guys post the output of this command?

find <YOUR_PATH> -name "*.db"

@randy-randerson @sinewave

My guess is that the path is not correctly pointing to the right database and sqlite thus assumes a new empty database.

randy-randerson commented 3 years ago

Here's my output:

root@Citadel:/mnt/user/appdata/UpdateTool# find ./* -name "*.db"
./com.plexapp.plugins.library.db
sinewave commented 3 years ago

Here's my output, there were also a ton of backup dbs in the trakt folder but I imagine those aren't what you're looking for:

/mnt/user/appdata/binhex-plexpass/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.blobs.db /mnt/user/appdata/binhex-plexpass/Plex Media Server/Plug-in Support/Databases/com.plexapp.dlna.db /mnt/user/appdata/binhex-plexpass/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db /mnt/user/appdata/binhex-plexpass/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.trakttv.db /mnt/user/appdata/binhex-plexpass/Plex Media Server/Plug-in Support/Caches/com.plexapp.plugins.trakttv/plex.db /mnt/user/appdata/binhex-plexpass/Plex Media Server/Plug-in Support/Caches/com.plexapp.plugins.trakttv/trakt.db

Let me know if there's anything else you need and thx for taking look 🙏

KurtzPT commented 3 years ago

Reporting the same behavior. Maybe it has to do something with the PGID/PUID variables not being on the template/not being used?

mynttt commented 3 years ago

That's very strange have they changed the database schema or something? I'm not really updating my plex anymore at the moment so I would not know.

The tool basically determains the database this way:

BASE_PATH + Plug-in Support/Databases/com.plexapp.plugins.library.db

So if @sinewave supplies /mnt/user/appdata/binhex-plexpass/Plex Media Server as base path the tool should open the correct database @ /mnt/user/appdata/binhex-plexpass/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db

If it now reports a missing table that could only be the case if they renamed that table.

@randy-randerson In your case it looks like the tool created an empty database within the tool folder which should not be the case. Have you supplied a directory structure like mentioned above to it?

@KurtzPT If you report the same behavior it probably has something todo with a renamed table. Could you supply the output of this command?

sqlite3 com.plexapp.plugins.library.db ".tables"

KurtzPT commented 3 years ago

@mynttt I actually downloaded the SQL file myself to check if it was that and no, the table is still there:

image

KurtzPT commented 3 years ago

I managed to get it working, simply put I don't think the docker image is using the /plexdata path in the container.

What I did to make it work is put this value in:

image

EDIT: Not related but, the unRAID template is also missing the "UNLOCK_FOR_NEW_TV_AGENT" key

randy-randerson commented 3 years ago

I managed to get it working, simply put I don't think the docker image is using the /plexdata path in the container.

What I did to make it work is put this value in:

image

EDIT: Not related but, the unRAID template is also missing the "UNLOCK_FOR_NEW_TV_AGENT" key

@KurtzPT @mynttt can confirm this worked for me as well.

mynttt commented 3 years ago

Glad it works @randy-randerson @KurtzPT (I have added the missing variable to the template as well!)