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

Komga not able to analyze PDFs when /tmp is small and file is larger than tmp-size #1334

Closed
5 tasks done
CmdrMichael opened this issue Dec 6, 2023 · 4 comments
Closed
5 tasks done
Labels
question Further information is requested released

Comments

@CmdrMichael
Copy link

CmdrMichael commented Dec 6, 2023

Steps to reproduce

I upgraded from Komga 0.144 (last version working without errors on a QNAP NAS) to a current version (1.8.4 ).
I think the error was introduced with one of the versions after 0.144, as the problems with not being able to analyze some files started with 0148.2, which was the next version available for QNAP systems. 0.144 could analyze all files without the workaround below. (Maybe introduced with 8da2489

My old library /user was not migrated, therefore I tried to start fresh and added the directory with my PDFs to a new library in Komga. From the 2500 files in the library, around 850 were not analyzed. In Komga every one of the files had the comment: "Unknown error while analyzing book"

I checked the logs. The analysis fails every time for the affected books with "java.io.IOException: No space left on device" But the Komga directory and the NAS itself has multiple TB free diskspace, and Komga has enough memory (-Xmx8G). It turned out that QNAP NAS systems have 64mb as the standard size for the /tmp folder, and this is not enough for Komga for some PDFs. When the PDF is larger than the free space in /tmp the analysis fails. When I mounted /tmp with 1gb instead of 64mb all PDFs were analyzed without problems.

Expected behavior

Komga analyzes PDFs without problems, even files that are large than free space in /tmp. If there is a problem, e.g. that the file is too large for /tmp, then a descriptive error message is shown instead of "Unknown error while analyzing book".

Actual behavior

Files larger than the free space in /tmp can not be analyzed or viewed. This is a problem as QNAP NAS have a standard /tmp size of 64mb and Synology of 128mb. In versions <= Komga 0.144 it worked for files larger than the free space in /tmp.

Logs

https://pastebin.com/hXS6PK8R

Komga version

1.8.4

Operating system

QNAP

Installation method

other (please provide more details below)

Other details

https://www.myqnap.org/product/komga/

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 Dec 7, 2023

You can change the temporary directory used by Java by setting the java.io.tmpdir system property. I have no idea how the QNAP package works though, so i can't really advise how to set that up.

You should take this to the maintainer of the QNAP Komga package and configure it to use another folder.

@gotson
Copy link
Owner

gotson commented Dec 7, 2023

Also note that the temp directory is used for other things in Komga, which could also fail of the size is too small.

@gotson
Copy link
Owner

gotson commented Dec 8, 2023

Another possible solution would be to migrate to Apache PDFBox 3, which has a better PDF loader. It is fresh out of the oven though, and i didn't want to use 3.0.0, but they apparently just released the first patch.

@gotson gotson added question Further information is requested and removed triage labels Dec 8, 2023
@gotson gotson closed this as completed in 38fcde9 Jan 22, 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
question Further information is requested released
Projects
None yet
Development

No branches or pull requests

2 participants