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
250 stars 12 forks source link

NullPointerException exception encountered #5

Closed twojciac closed 4 years ago

twojciac commented 4 years ago

[INFO ] - 2019-12-29 15:01:52 @ Main.testApiImdb: Test passed. API Key is valid. [INFO ] - 2019-12-29 15:01:52 @ ImdbDockerImplementation.invoke: Starting IMDB Watchdog [INFO ] - 2019-12-29 15:01:52 @ ImdbDockerImplementation.invoke: Plex data dir: /plexdata [INFO ] - 2019-12-29 15:01:52 @ ImdbDockerImplementation.invoke: Invoke every 12 hour(s) [INFO ] - 2019-12-29 15:01:52 @ ImdbDockerImplementation.invoke: Purge cache every 14 day(s) [INFO ] - 2019-12-29 15:01:52 @ ImdbDockerImplementation.invoke: Running first task... [INFO ] - 2019-12-29 15:01:52 @ ImdbDockerImplementation.invoke: Scheduling next tasks to run @ every 12 hour(s) [INFO ] - 2019-12-29 15:01:53 @ ImdbDockerImplementation$ImdbBatchJob.run: Library: Movies has 2493 item(s) [INFO ] - 2019-12-29 15:01:53 @ ImdbDockerImplementation$ImdbBatchJob.run: Processing library: Movies with UUID 545ce49a-3e1d -4504-b870-8ae9a98edf85 at stage: CREATED [WARN ] - 2019-12-29 15:01:53 @ ImdbPipeline.analyseDatabase: Detected items with invalid guid. These items will be ignored a s they do not provide IMDB IDs. [WARN ] - 2019-12-29 15:01:53 @ ImdbPipeline.analyseDatabase: Item: The Expedition to the End of the World has non matching i mdb guid: com.plexapp.agents.themoviedb://168164?lang=en [WARN ] - 2019-12-29 15:01:53 @ ImdbPipeline.analyseDatabase: Item: Alienated has non matching imdb guid: com.plexapp.agents. themoviedb://353314?lang=en [WARN ] - 2019-12-29 15:01:53 @ ImdbPipeline.analyseDatabase: Item: Den of Darkness has non matching imdb guid: com.plexapp.a gents.themoviedb://398470?lang=en [WARN ] - 2019-12-29 15:01:53 @ ImdbPipeline.analyseDatabase: Item: Evidence of Truth has non matching imdb guid: com.plexapp .agents.themoviedb://400252?lang=en [WARN ] - 2019-12-29 15:01:53 @ ImdbPipeline.analyseDatabase: Item: Adventures in Babysitting has non matching imdb guid: com .plexapp.agents.themoviedb://360606?lang=en [WARN ] - 2019-12-29 15:01:53 @ ImdbPipeline.analyseDatabase: Item: Ghostumentary has non matching imdb guid: com.plexapp.age nts.themoviedb://415087?lang=en [WARN ] - 2019-12-29 15:01:53 @ ImdbPipeline.analyseDatabase: Item: Chevalier has non matching imdb guid: com.plexapp.agents. themoviedb://314220?lang=en [WARN ] - 2019-12-29 15:01:53 @ ImdbPipeline.analyseDatabase: Item: Medicine of the Wolf has non matching imdb guid: com.plex app.agents.themoviedb://397334?lang=en [WARN ] - 2019-12-29 15:01:53 @ ImdbPipeline.analyseDatabase: Item: Miles To Go Before I Sleep has non matching imdb guid: co m.plexapp.agents.themoviedb://409341?lang=en [WARN ] - 2019-12-29 15:01:53 @ ImdbPipeline.analyseDatabase: Item: Maigret in Montmartre has non matching imdb guid: com.ple xapp.agents.themoviedb://548462?lang=en [WARN ] - 2019-12-29 15:01:53 @ ImdbPipeline.analyseDatabase: Item: Backstabbing for Beginners has non matching imdb guid: co m.plexapp.agents.themoviedb://476678?lang=en [WARN ] - 2019-12-29 15:01:53 @ ImdbPipeline.analyseDatabase: Item: An Actor Prepares has non matching imdb guid: com.plexapp .agents.themoviedb://434596?lang=en [WARN ] - 2019-12-29 15:01:53 @ ImdbPipeline.analyseDatabase: Item: To Catch a Serial Killer has non matching imdb guid: com. plexapp.agents.themoviedb://551936?lang=en [WARN ] - 2019-12-29 15:01:53 @ ImdbPipeline.analyseDatabase: Item: My Dad Wrote a Porno has non matching imdb guid: com.plex app.agents.themoviedb://545021?lang=en [WARN ] - 2019-12-29 15:01:53 @ ImdbPipeline.analyseDatabase: Item: Stockholm has non matching imdb guid: com.plexapp.agents. themoviedb://437626?lang=en [WARN ] - 2019-12-29 15:01:53 @ ImdbPipeline.analyseDatabase: Item: Above the Shadows has non matching imdb guid: com.plexapp .agents.themoviedb://609734?lang=en [WARN ] - 2019-12-29 15:01:53 @ ImdbPipeline.analyseDatabase: Item: Above the Best has non matching imdb guid: com.plexapp.ag ents.themoviedb://605364?lang=en [WARN ] - 2019-12-29 15:01:53 @ ImdbPipeline.analyseDatabase: Item: The Only Living Boy in New York has non matching imdb gui d: com.plexapp.agents.themoviedb://95608?lang=en [WARN ] - 2019-12-29 15:01:53 @ ImdbPipeline.analyseDatabase: Item: LEGO DC: Batman - Family Matters has non matching imdb gu id: com.plexapp.agents.themoviedb://602307?lang=en [WARN ] - 2019-12-29 15:01:53 @ ImdbPipeline.analyseDatabase: Item: I, Dolours has non matching imdb guid: com.plexapp.agents .themoviedb://521703?lang=en [WARN ] - 2019-12-29 15:01:53 @ ImdbPipeline.analyseDatabase: Item: Big Family: The Story of Bluegrass Music has non matching imdb guid: com.plexapp.agents.themoviedb://626304?lang=en [WARN ] - 2019-12-29 15:01:53 @ ImdbPipeline.analyseDatabase: Item: Death of Dick Long, The has non matching imdb guid: local ://236559 [WARN ] - 2019-12-29 15:01:53 @ ImdbPipeline.analyseDatabase: Item: American Confederate has non matching imdb guid: com.plex app.agents.themoviedb://631691?lang=en [WARN ] - 2019-12-29 15:01:53 @ ImdbPipeline.analyseDatabase: Item: Daniel Isn't Real has non matching imdb guid: com.plexapp .agents.themoviedb://537788?lang=en [WARN ] - 2019-12-29 15:01:53 @ ImdbPipeline.analyseDatabase: Item: The Aeronauts has non matching imdb guid: com.plexapp.age nts.themoviedb://514921?lang=en [INFO ] - 2019-12-29 15:01:53 @ ImdbPipeline.analyseDatabase: Filtered 25 invalid item(s). [INFO ] - 2019-12-29 15:01:53 @ ImdbPipeline.accumulateMetadata: Items: 2392 [INFO ] - 2019-12-29 15:01:53 @ ImdbPipeline.accumulateMetadata: Metadata missing for: 2392 [INFO ] - 2019-12-29 15:01:53 @ ImdbPipeline.accumulateMetadata: Retrieving metadata... [INFO ] - 2019-12-29 15:01:58 @ ImdbDockerImplementation$ImdbBatchJob.run: Job returned ERROR : null [ERROR] - 2019-12-29 15:01:58 @ ImdbDockerImplementation$ImdbBatchJob.run: NullPointerException exception encountered... [ERROR] - 2019-12-29 15:01:58 @ ImdbDockerImplementation$ImdbBatchJob.run: Please contact the maintainer of the application w ith the stacktrace below if you think this is unwanted behavior. [ERROR] - 2019-12-29 15:01:58 @ ImdbDockerImplementation$ImdbBatchJob.run: ======================================== [ERROR] - 2019-12-29 15:01:58 @ ImdbDockerImplementation$ImdbBatchJob.run: java.lang.NullPointerException at updatetool.imdb.ImdbOmdbWorker.call(ImdbOmdbWorker.java:65) at updatetool.imdb.ImdbOmdbWorker.call(ImdbOmdbWorker.java:17) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) 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] - 2019-12-29 15:01:58 @ ImdbDockerImplementation$ImdbBatchJob.run: ======================================== [ERROR] - 2019-12-29 15:01:58 @ ImdbDockerImplementation$ImdbBatchJob.run: The application will terminate now.

twojciac commented 4 years ago

Restarted and got the following result, which leads me to believe the initial exception is related to the OMDB free-tier API which is limited to 1000 queries per day. If there's a way to chunk the update to process a limited number of queries per day and do the updates in batches that might fix it.

Invoking tool! Logs in /config [INFO ] - 2019-12-29 15:22:46 @ Main.testApiImdb: Testing API key: e4342095 [ERROR] - 2019-12-29 15:22:46 @ Main.testApiImdb: API Test failed: Code 401

[ERROR] - 2019-12-29 15:22:46 @ Main.testApiImdb: Payload:{"Response":"False","Error":"Request limit reached!"}

[ERROR] - 2019-12-29 15:22:46 @ Main.testApiImdb: Key available under https://www.omdbapi.com/

mynttt commented 4 years ago

That is correct! I just updated the tool it will now handle the situation better by displaying the rate limited message and not shutting down. Currently, the internal process is laid out like a pipeline where one stage can only proceed after the previous stage succeeded. That makes it easier to resume state if the tool ever crashes.

It should have saved the already created cache of OMDB responses, you can update either the docker or restart it which will also cause the tool to update itself (or DL the newest version if you don't use the container). In the new version it should not shutdown and just retry again in N hours until it manages to grab all entries at least once. Then it will proceed into the next stage and update the ratings that mismatch.

twojciac commented 4 years ago

Thanks!