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

[SQLITE_ERROR] SQL error or missing database (no such table: library_sections) #31

Closed koolkunz closed 4 years ago

koolkunz commented 4 years ago

Hey firstly thank you for making this tool (plex couldnt care less about fixing this huge flaw) I am trying to run this on Windows 10 (2004), I have tried running the bat file as admin also but it gives the same error. PMS Version:1.19.4.2935 This is the log: [INFO ] - 2020-07-18 23:21:18 @ Main.loadImplementation: Loaded implementation << imdb-docker << updatetool.imdb.ImdbDockerImplementation [INFO ] - 2020-07-18 23:21:18 @ Main.main: Running version: 1.3.9b [INFO ] - 2020-07-18 23:21:18 @ Main.main: Args: {imdb-docker={schedule=12}} [INFO ] - 2020-07-18 23:21:18 @ Main.main: << INIT: imdb-docker @ {schedule=12} >> [INFO ] - 2020-07-18 23:21:18 @ Main.testApiTmdb: Testing TMDB API key: REDACTED [INFO ] - 2020-07-18 23:21:20 @ Main.genericApiTest: Test passed. API Key is valid. [INFO ] - 2020-07-18 23:21:20 @ ImdbDockerImplementation.bootstrap: TMDB API key enabled TMDB <=> IMDB matching. Will process TMDB backed Movie and TV Series libraries and TMDB orphans. [INFO ] - 2020-07-18 23:21:20 @ Main.testApiTvdb: Testing TVDB API authorization: apikey=REDACTED [INFO ] - 2020-07-18 23:21:20 @ Main.testApiTvdb: Test passed. API Key is valid. [INFO ] - 2020-07-18 23:21:20 @ ImdbDockerImplementation.bootstrap: TVDB API authorization enabled IMDB rating update for TV Series with the TVDB agent. [INFO ] - 2020-07-18 23:21:20 @ ImdbDockerImplementation.bootstrap: Starting IMDB Watchdog [INFO ] - 2020-07-18 23:21:20 @ ImdbDockerImplementation.bootstrap: Plex data dir: C:\Users\Kunal Goel\AppData\Local\Plex Media Server [INFO ] - 2020-07-18 23:21:20 @ ImdbDockerImplementation.bootstrap: Capabilities: [TMDB, TVDB] [INFO ] - 2020-07-18 23:21:20 @ Main.main: << INIT SUCCESS >> [INFO ] - 2020-07-18 23:21:20 @ Scheduler.go: Scheduler is loading tasks... Blocking until completely set-up and ready to go. [INFO ] - 2020-07-18 23:21:20 @ Scheduler.go: Scheduling tasks... [INFO ] - 2020-07-18 23:21:20 @ Scheduler.lambda$go$0: Scheduled imdb-docker task to run @ every 12 hour(s). [INFO ] - 2020-07-18 23:21:20 @ Scheduler.lambda$go$1: Queued task imdb-docker for immediate execution. [INFO ] - 2020-07-18 23:21:20 @ Scheduler.go: Running supplied tasks immediately NOW! [INFO ] - 2020-07-18 23:21:20 @ TaskWrapper.run: ================================================ [INFO ] - 2020-07-18 23:21:20 @ TaskWrapper.run: Starting task: imdb-docker | Execution count: 0 [INFO ] - 2020-07-18 23:21:20 @ TaskWrapper.run: ================================================ [ERROR] - 2020-07-18 23:21:21 @ ImdbDockerImplementation$ImdbBatchJob.run: SQLiteException exception encountered... [ERROR] - 2020-07-18 23:21:21 @ ImdbDockerImplementation$ImdbBatchJob.run: Please contact the maintainer of the application with the stacktrace below if you think this is unwanted behavior. [ERROR] - 2020-07-18 23:21:21 @ ImdbDockerImplementation$ImdbBatchJob.run: ======================================== [ERROR] - 2020-07-18 23:21:21 @ 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:941) at org.sqlite.core.DB.newSQLException(DB.java:953) at org.sqlite.core.DB.throwex(DB.java:918) 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:73) at updatetool.common.SqliteDatabaseProvider.queryFor(SqliteDatabaseProvider.java:26) at updatetool.common.DatabaseSupport.requestLibrary(DatabaseSupport.java:67) at updatetool.common.DatabaseSupport.requestMovieLibraries(DatabaseSupport.java:59) at updatetool.imdb.ImdbDockerImplementation$ImdbBatchJob.run(ImdbDockerImplementation.java:197) at updatetool.TaskWrapper.run(Main.java:284) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834) [ERROR] - 2020-07-18 23:21:21 @ ImdbDockerImplementation$ImdbBatchJob.run: ======================================== [ERROR] - 2020-07-18 23:21:21 @ ImdbDockerImplementation$ImdbBatchJob.run: The application will terminate now.

Can you please help me out here?

mynttt commented 4 years ago

Very interesting! It appears that the table library_sections is missing from the database (which makes no sense unless Plex renamed it). Could you run the command sqlite3 com.plexapp.plugins.library.db .tables on that database and post the output here?

You can download sqlite for windows here.

koolkunz commented 4 years ago

Ok I ran that command and it gave no output and the db file is of 0 kb so I looked around and it turns out I have two Plex Media Server folders (I have reinstalled PMS in the past so it maybe a remnant folder from earlier installation): 1) C:\Users\Kunal Goel\AppData\Local\Plex\Plex Media Server (334kb db file) 2) C:\Users\Kunal Goel\AppData\Local\Plex Media Server (0kb db file)

So now I changed the path to 1st folder and the command ran but still nothing happened [INFO ] - 2020-07-18 23:45:53 @ Main.loadImplementation: Loaded implementation << imdb-docker << updatetool.imdb.ImdbDockerImplementation [INFO ] - 2020-07-18 23:45:53 @ Main.main: Running version: 1.3.9b [INFO ] - 2020-07-18 23:45:53 @ Main.main: Args: {imdb-docker={schedule=12}} [INFO ] - 2020-07-18 23:45:53 @ Main.main: << INIT: imdb-docker @ {schedule=12} >> [INFO ] - 2020-07-18 23:45:53 @ Main.testApiTmdb: Testing TMDB API key: REDACTED [INFO ] - 2020-07-18 23:45:55 @ Main.genericApiTest: Test passed. API Key is valid. [INFO ] - 2020-07-18 23:45:55 @ ImdbDockerImplementation.bootstrap: TMDB API key enabled TMDB <=> IMDB matching. Will process TMDB backed Movie and TV Series libraries and TMDB orphans. [INFO ] - 2020-07-18 23:45:55 @ Main.testApiTvdb: Testing TVDB API authorization: apikey=REDACTED [INFO ] - 2020-07-18 23:45:56 @ Main.testApiTvdb: Test passed. API Key is valid. [INFO ] - 2020-07-18 23:45:56 @ ImdbDockerImplementation.bootstrap: TVDB API authorization enabled IMDB rating update for TV Series with the TVDB agent. [INFO ] - 2020-07-18 23:45:56 @ ImdbDockerImplementation.bootstrap: Starting IMDB Watchdog [INFO ] - 2020-07-18 23:45:56 @ ImdbDockerImplementation.bootstrap: Plex data dir: C:\Users\Kunal Goel\AppData\Local\Plex\Plex Media Server [INFO ] - 2020-07-18 23:45:56 @ ImdbDockerImplementation.bootstrap: Capabilities: [TMDB, TVDB] [INFO ] - 2020-07-18 23:45:56 @ Main.main: << INIT SUCCESS >> [INFO ] - 2020-07-18 23:45:56 @ Scheduler.go: Scheduler is loading tasks... Blocking until completely set-up and ready to go. [INFO ] - 2020-07-18 23:45:56 @ Scheduler.go: Scheduling tasks... [INFO ] - 2020-07-18 23:45:56 @ Scheduler.lambda$go$0: Scheduled imdb-docker task to run @ every 12 hour(s). [INFO ] - 2020-07-18 23:45:56 @ Scheduler.lambda$go$1: Queued task imdb-docker for immediate execution. [INFO ] - 2020-07-18 23:45:56 @ Scheduler.go: Running supplied tasks immediately NOW! [INFO ] - 2020-07-18 23:45:56 @ TaskWrapper.run: ================================================ [INFO ] - 2020-07-18 23:45:56 @ TaskWrapper.run: Starting task: imdb-docker | Execution count: 0 [INFO ] - 2020-07-18 23:45:56 @ TaskWrapper.run: ================================================ [INFO ] - 2020-07-18 23:45:56 @ ImdbDockerImplementation$ImdbBatchJob.run: Library IDs on ignore list: [] [INFO ] - 2020-07-18 23:45:56 @ ImdbDockerImplementation$ImdbBatchJob.run: No libraries found. Sleeping until next invocation... [INFO ] - 2020-07-18 23:45:56 @ TaskWrapper.run: ================================================ [INFO ] - 2020-07-18 23:45:56 @ TaskWrapper.run: Suggesting JVM to run the GC as soon as possible (Request might be ignored!) [INFO ] - 2020-07-18 23:45:56 @ TaskWrapper.run: Completed imdb-docker in 0.1346384s. - Invoking next task or going to sleep. It is safe to suspend execution if no other task is being invoked immediately.

mynttt commented 4 years ago

Can you run sqlite3 com.plexapp.plugins.library.db and then post the output of SELECT agent FROM library_sections;?

koolkunz commented 4 years ago

It gives no output/empty output

mynttt commented 4 years ago

Can you send the 334kb database? It has no sensitive information in it (other than the items you have in the library). If you don't want to publicly attach it here, send an email at marc (at) herschel.io. It should not give an empty output unless no libraries exist yet.

koolkunz commented 4 years ago

ok wait I am sorry for wasting your time. I had completely forgotten that I had moved the plex directory to D: drive. I put in the correct folder now and it has worked as expected. Thank you and once again sorry for wasting your time.

mynttt commented 4 years ago

Lmao don't worry about it. Glad it works now!