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 #15

Closed CasperNielsen closed 4 years ago

CasperNielsen commented 4 years ago

Super awesome tool! But have run into some problems with the new version. I'm getting this error, have tried recreating the container after getting the error, same result. It finds my movies and TV shows, but after that it's fails. Not sure if it has something to do with the movies that are missing responses, because i recall something similar in the older versions, when the program was running just fine.

[INFO ] - 2020-02-20 21:59:58 @ ImdbDockerImplementation.invoke: Running version: 1.3.1

[INFO ] - 2020-02-20 21:59:58 @ Main.testApiTmdb: Testing TMDB API key: TEMP

[INFO ] - 2020-02-20 21:59:59 @ Main.genericApiTest: Test passed. API Key is valid.

[INFO ] - 2020-02-20 21:59:59 @ ImdbDockerImplementation.invoke: TMDB API key enabled TMDB <=> IMDB matching. Will fetch IMDB ratings for non matched IMDB items.

[INFO ] - 2020-02-20 21:59:59 @ Main.testApiTvdb: Testing TVDB API authorization: username=TEMP | userkey=TEMP | apikey=TEMP

[INFO ] - 2020-02-20 22:00:00 @ ImdbDockerImplementation.invoke: TVDB API authorization enabled IMDB rating update for TV Series with the TVDB agent.

[INFO ] - 2020-02-20 22:00:00 @ ImdbDockerImplementation.invoke: Starting IMDB Watchdog

[INFO ] - 2020-02-20 22:00:00 @ ImdbDockerImplementation.invoke: Plex data dir: /plexdata

[INFO ] - 2020-02-20 22:00:00 @ ImdbDockerImplementation.invoke: Invoke every 12 hour(s)

[INFO ] - 2020-02-20 22:00:00 @ ImdbDockerImplementation.invoke: Running first task...

[INFO ] - 2020-02-20 22:00:00 @ ImdbDockerImplementation.invoke: Scheduling next tasks to run @ every 12 hour(s)

[INFO ] - 2020-02-20 22:00:02 @ ImdbRatingDatasetFactory.readData: Reading data...

[INFO ] - 2020-02-20 22:00:07 @ ImdbRatingDatasetFactory.readData: 1027209 lines read.

[INFO ] - 2020-02-20 22:00:07 @ ImdbDockerImplementation$ImdbBatchJob.run: [MOVIE] Movies has 10 item(s)

[INFO ] - 2020-02-20 22:00:07 @ ImdbDockerImplementation$ImdbBatchJob.run: [SERIES] Tv has 10 item(s)

[INFO ] - 2020-02-20 22:00:07 @ ImdbDockerImplementation$ImdbBatchJob.run: Processing [MOVIE] Movies with UUID 48c5dd66-30c7-4ed0-9e4d-4dba96ec939b at stage: CREATED

[INFO ] - 2020-02-20 22:00:07 @ ImdbPipeline.analyseDatabase: Resolving IMDB identifiers for items. Only warnings and errors will show up...

[INFO ] - 2020-02-20 22:00:07 @ ImdbPipeline.analyseDatabase: Items that show up here will not be processed by further stages of the pipeline.

[INFO ] - 2020-02-20 22:00:07 @ TmdbToImdbResolvement.resolveUncached: Attempting to resolve TMDB identifer 488663 against IMDB...

[WARN ] - 2020-02-20 22:00:07 @ TmdbToImdbResolvement.resolveUncached: TMBD API request failed: [1/3] : TMDB API returned null imdb_id. No imdbid or API changed?

[WARN ] - 2020-02-20 22:00:07 @ TmdbToImdbResolvement.resolveUncached: Dumping response:(GET https://api.themoviedb.org/3/movie/488663?api_key=TEMP) 200

[WARN ] - 2020-02-20 22:00:07 @ TmdbToImdbResolvement.resolveUncached: TMBD API request failed: [2/3] : TMDB API returned null imdb_id. No imdbid or API changed?

[WARN ] - 2020-02-20 22:00:07 @ TmdbToImdbResolvement.resolveUncached: Dumping response:(GET https://api.themoviedb.org/3/movie/488663?api_key=TEMP) 200

[WARN ] - 2020-02-20 22:00:07 @ TmdbToImdbResolvement.resolveUncached: TMBD API request failed: [3/3] : TMDB API returned null imdb_id. No imdbid or API changed?

[WARN ] - 2020-02-20 22:00:07 @ TmdbToImdbResolvement.resolveUncached: Dumping response:(GET https://api.themoviedb.org/3/movie/488663?api_key=TEMP) 200

[INFO ] - 2020-02-20 22:00:07 @ ImdbDockerImplementation$ImdbBatchJob.run: Job returned ERROR : TMDB API returned null imdb_id. No imdbid or API changed?

[ERROR] - 2020-02-20 22:00:07 @ ImdbDockerImplementation$ImdbBatchJob.run: NullPointerException exception encountered...

[ERROR] - 2020-02-20 22:00:07 @ ImdbDockerImplementation$ImdbBatchJob.run: Please contact the maintainer of the application with the stacktrace below if you think this is unwanted behavior.

[ERROR] - 2020-02-20 22:00:07 @ ImdbDockerImplementation$ImdbBatchJob.run: ========================================

[ERROR] - 2020-02-20 22:00:07 @ ImdbDockerImplementation$ImdbBatchJob.run: java.lang.NullPointerException: TMDB API returned null imdb_id. No imdbid or API changed?
    at java.base/java.util.Objects.requireNonNull(Unknown Source)
    at updatetool.imdb.resolvement.TmdbToImdbResolvement.resolveUncached(TmdbToImdbResolvement.java:54)
    at updatetool.imdb.resolvement.TmdbToImdbResolvement.resolve(TmdbToImdbResolvement.java:39)
    at updatetool.imdb.resolvement.TmdbToImdbResolvement.resolve(TmdbToImdbResolvement.java:15)
    at updatetool.imdb.ImdbPipeline.analyseDatabase(ImdbPipeline.java:99)
    at updatetool.imdb.ImdbPipeline.analyseDatabase(ImdbPipeline.java:37)
    at updatetool.api.Pipeline.invoke(Pipeline.java:20)
    at updatetool.imdb.ImdbJobRunner.run(ImdbJobRunner.java:19)
    at updatetool.imdb.ImdbDockerImplementation$ImdbBatchJob.run(ImdbDockerImplementation.java:191)
    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] - 2020-02-20 22:00:07 @ ImdbDockerImplementation$ImdbBatchJob.run: ========================================
[ERROR] - 2020-02-20 22:00:07 @ ImdbDockerImplementation$ImdbBatchJob.run: The application will terminate now.
mynttt commented 4 years ago

That's an assertion I put there. Normally the imdbId would look like this when not available from the API

"imdbId":""

Now it was

"imdbId":null

So the assertion was put in place to find out quickly if the API ever changes. Seems like they do return null for some reason tho instead of "" so I'll just quickly remove the assertion later this day to fix the problem.

mynttt commented 4 years ago

Fixed with 74bc4260a1df9a118d2b77862682c7d077ca628a