Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

epub file, Unknown error while analyzing book, java.lang.NullPointerException: null #1386

Closed
5 tasks done
noxiousnick opened this issue Jan 9, 2024 · 7 comments
Closed
5 tasks done
Labels
bug Something isn't working released

Comments

@noxiousnick
Copy link

noxiousnick commented Jan 9, 2024

Steps to reproduce

  1. Added large epub file collection to library
  2. Scan library for new files
  3. Most files accepted just fine, a small percentage get the error described here

Expected behavior

Book added to library with no errors, cover generated, book able to be read.

Actual behavior

Media Management shows "Unknown error while analyzing book". Cover unable to be generated. Book epub file unable to be parsed. Logs only give me this error: java.lang.NullPointerException: null.

Logs

2024-01-09T11:52:15.141-05:00  INFO 1 --- [io-25600-exec-2] o.g.komga.application.tasks.TaskEmitter  : Sending task: AnalyzeBook(bookId='0ERPR1P1KEPBC', priority='6')
2024-01-09T11:52:15.238-05:00  INFO 1 --- [askProcessor-13] o.g.komga.application.tasks.TaskHandler  : Executing task: AnalyzeBook(bookId='0ERPR1P1KEPBC', priority='6')
2024-01-09T11:52:15.239-05:00  INFO 1 --- [askProcessor-13] o.g.komga.domain.service.BookLifecycle   : Analyze and persist book: Book(name=A Cave King's Road to Paradise - Volume 01 [J-Novel Club][Premium], url=file:/data/Officially%20Translated%20Light%20Novels/A%20Cave%20King's%20Road%20to%20Paradise/A%20Cave%20King's%20Road%20to%20Paradise%20-%20Volume%2001%20%5BJ-Novel%20Club%5D%5BPremium%5D.epub, fileLastModified=2023-12-08T09:28:28.028, fileSize=48517033, fileHash=9a9723533a7d39d98e8e18ac0ec36e3c, number=1, id=0ERPR1P1KEPBC, seriesId=0ERPR1P1FET59, libraryId=0ERPPXSPQEMXQ, deletedDate=null, oneshot=false, createdDate=2024-01-08T10:57:29, lastModifiedDate=2024-01-08T13:39:31.210)
2024-01-09T11:52:15.241-05:00  INFO 1 --- [askProcessor-13] o.g.komga.domain.service.BookAnalyzer    : Trying to analyze book: Book(name=A Cave King's Road to Paradise - Volume 01 [J-Novel Club][Premium], url=file:/data/Officially%20Translated%20Light%20Novels/A%20Cave%20King's%20Road%20to%20Paradise/A%20Cave%20King's%20Road%20to%20Paradise%20-%20Volume%2001%20%5BJ-Novel%20Club%5D%5BPremium%5D.epub, fileLastModified=2023-12-08T09:28:28.028, fileSize=48517033, fileHash=9a9723533a7d39d98e8e18ac0ec36e3c, number=1, id=0ERPR1P1KEPBC, seriesId=0ERPR1P1FET59, libraryId=0ERPPXSPQEMXQ, deletedDate=null, oneshot=false, createdDate=2024-01-08T10:57:29, lastModifiedDate=2024-01-08T13:39:31.210)
2024-01-09T11:52:15.356-05:00  INFO 1 --- [askProcessor-13] o.g.komga.domain.service.BookAnalyzer    : Detected media type: application/zip
2024-01-09T11:52:15.791-05:00 ERROR 1 --- [askProcessor-13] o.g.komga.domain.service.BookAnalyzer    : Error while analyzing book: Book(name=A Cave King's Road to Paradise - Volume 01 [J-Novel Club][Premium], url=file:/data/Officially%20Translated%20Light%20Novels/A%20Cave%20King's%20Road%20to%20Paradise/A%20Cave%20King's%20Road%20to%20Paradise%20-%20Volume%2001%20%5BJ-Novel%20Club%5D%5BPremium%5D.epub, fileLastModified=2023-12-08T09:28:28.028, fileSize=48517033, fileHash=9a9723533a7d39d98e8e18ac0ec36e3c, number=1, id=0ERPR1P1KEPBC, seriesId=0ERPR1P1FET59, libraryId=0ERPPXSPQEMXQ, deletedDate=null, oneshot=false, createdDate=2024-01-08T10:57:29, lastModifiedDate=2024-01-08T13:39:31.210)

java.lang.NullPointerException: null
        at org.gotson.komga.infrastructure.mediacontainer.epub.EpubExtractor.computePositions(EpubExtractor.kt:181) ~[classes/:1.10.0]
        at org.gotson.komga.infrastructure.mediacontainer.epub.EpubExtractor.getManifest(EpubExtractor.kt:80) ~[classes/:1.10.0]
        at org.gotson.komga.domain.service.BookAnalyzer.analyzeEpub(BookAnalyzer.kt:131) ~[classes/:1.10.0]
        at org.gotson.komga.domain.service.BookAnalyzer.analyze(BookAnalyzer.kt:78) ~[classes/:1.10.0]
        at org.gotson.komga.domain.service.BookLifecycle.analyzeAndPersist(BookLifecycle.kt:77) ~[classes/:1.10.0]
        at org.gotson.komga.application.tasks.TaskHandler.handleTask(TaskHandler.kt:89) ~[classes/:1.10.0]
        at org.gotson.komga.application.tasks.TaskProcessor.takeAndProcess(TaskProcessor.kt:60) ~[classes/:1.10.0]
        at org.gotson.komga.application.tasks.TaskProcessor.processAvailableTask$lambda$1(TaskProcessor.kt:46) ~[classes/:1.10.0]
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) ~[na:na]
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) ~[na:na]
        at java.base/java.lang.Thread.run(Unknown Source) ~[na:na]

2024-01-09T11:52:15.830-05:00  INFO 1 --- [askProcessor-13] o.g.komga.application.tasks.TaskHandler  : Task AnalyzeBook(bookId='0ERPR1P1KEPBC', priority='6') executed in 591.563869ms

Komga version

v1.10.0-master

Operating system

Debian 11

Installation method

Docker

Other details

This Komga instance is running on a Raspberry Pi 4 using Debian 11 and installed through Docker using the latest container image. All my epub files are from the same collection where the majority of them work. I wouldn't be surprised if there was "something different" about these files like a zip or rar version, but I cannot find anything in the logs to indicate what's different or what's wrong with them.

Acknowledgements

  • I have searched the existing issues (open AND closed) and this is a new ticket, NOT a duplicate or related to another open issue.
  • I have written a short but informative title.
  • I have checked the FAQ.
  • I have updated the app to the latest version.
  • I will fill out all of the requested information in this form.
@gotson
Copy link
Owner

gotson commented Jan 10, 2024

Can you provide the book that fails to analyze?

@noxiousnick
Copy link
Author

Should I attach the epub file here or send it through some other channel? I can attach examples of working and non-working files from the same collection if that helps to diagnose.

@gotson
Copy link
Owner

gotson commented Jan 11, 2024

Should I attach the epub file here or send it through some other channel? I can attach examples of working and non-working files from the same collection if that helps to diagnose.

whatever works for you, i just need the book

@noxiousnick
Copy link
Author

Reached out on discord, thanks!

@gotson
Copy link
Owner

gotson commented Jan 15, 2024

Reached out on discord, thanks!

Thanks, that's helpful.

Basically the ebook has an issue:

  • the spine mentions this page: <itemref idref="jln.xhtml"/>
  • it corresponds to this manifest resource <item id="jln.xhtml" href="Text/jln.xhtml" media-type="application/xhtml+xml"/>
  • however the file is not present in the zip

I will add a fix in Komga not to throw an error, but reading the book may still throw some errors.

@gotson
Copy link
Owner

gotson commented Jan 15, 2024

Note also that the book you provided do not have any epub2/3 metadata for the cover, so it does not have a thumbnail in Komga.

@gotson gotson closed this as completed in 270a50c Jan 15, 2024
@gotson gotson added bug Something isn't working and removed triage labels Jan 15, 2024
gotson added a commit that referenced this issue Jan 19, 2024
Copy link
Contributor

🎉 This issue has been resolved in 1.10.2 (Release Notes)

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working released
Projects
None yet
Development

No branches or pull requests

2 participants