-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
[Bug]: Issue while repairing - Internal Server Error:java.io.IOException: Command process failed with exit code 3 #2842
Comments
Hey there, @hubdows! I'm here to help you with any bugs, questions, or contributions you may have. Let's squash those bugs together! 🐛 A similar issue was reported in a closed thread, but no solution was found in the comments [1]. For your specific problem, the error message indicates that the
If these steps do not resolve the issue, consider providing more detailed logs or error messages to help further diagnose the problem. To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other |
Just to add some context about the PDF file. It was a magazine file that was 335mb, it opened fine in Adobe and Foxit Reader. I ran it through StirlingPDF Repair to see if what it would do when I encountered the error. This was the first command I tried in Stirling, so I'm hoping it's not a Docker issue. I will check other commands to see if they work. I also ran the same file through ILovePDF desktop app and it automatically repaired/compressed the file to 107mb without error. My docker image is the latest version just downloaded from Docker Hub, running on a Synology NAS using their Container manager. No log errors on the Synology NAS. |
Hi @hubdows and maintainers, I’ve reviewed the issue and believe I can help resolve it. The problem appears to be related to how the ProcessExecutor handles qpdf's exit code 3 (warnings), which is currently causing an Internal Server Error despite the PDF being repaired successfully. I’ve already identified the necessary changes to the ProcessExecutor and RepairController to allow exit code 3 while still serving the repaired PDF. I’d be happy to implement and test these changes. Could you please assign this issue to me? I’ll submit a pull request once the fix is ready. Thank you! |
I will test as soon as I see an update to the Docker container. Thank you very much for your help!!! I will report back as soon as possible. |
Hello, I just want to let you know that the Alpha build REPAIR feature worked correctly. After completing the repair, the repaired file was automatically downloaded. No errors in the logs. Thank YOU! |
) # Description of Changes Please provide a summary of the changes, including: - **What was changed**: - Modified the `ProcessExecutor` class to accept exit code `3` from **qpdf** as a success with warnings. - Added a check to ensure that only **qpdf**’s exit code `3` is treated as a warning. - Added a warning log for **qpdf** exit code `3` to provide better visibility into the repair process. - **Why the change was made**: - The repair process was failing when **qpdf** returned exit code `3`, even though the operation succeeded with warnings. This caused unnecessary errors for users. - The changes ensure that PDFs with minor structural issues (e.g., mismatched object counts) are still repaired successfully, while logging warnings for transparency. - Added a check to ensure that only **qpdf**’s exit code `3` is treated as a warning, preventing potential issues with other tools that might use exit code `3` for actual errors. Closes #2842 --- ## Checklist ### General - [x] I have read the [Contribution Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md) - [x] I have read the [Stirling-PDF Developer Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md) (if applicable) - [x] I have performed a self-review of my own code - [x] My changes generate no new warnings ### Testing (if applicable) - [x] I have tested my changes locally. - Verified that exit code `3` is only treated as a warning for **qpdf** and not for other tools. --- ### Additional Notes - The changes align with **qpdf**'s behavior, where exit code `3` indicates a successful operation with warnings. - Added a check to ensure that only **qpdf**’s exit code `3` is treated as a warning, preventing potential issues with other tools. Co-authored-by: Anthony Stirling <[email protected]>
Installation Method
Docker
The Problem
Trying to repair a PDF, the repair failed with the following error message:
Error
Internal Server Error:java.io.IOException: Command process failed with exit code 3. Error message: WARNING: /tmp/input_10795691053972271551.pdf: reported number of objects (4933) is not one plus the highest object number (4931) qpdf: there are warnings; original file kept in /tmp/input_10795691053972271551.pdf.~qpdf-orig qpdf: operation succeeded with warnings; resulting file may have some problems
While it says succeeded, the PDF appears to be unavailable for download.
Version of Stirling-PDF
3.3
Last Working Version of Stirling-PDF
No response
Page Where the Problem Occurred
http://192.168.1.200:8800/repair
Docker Configuration
Relevant Log Output
Additional Information
No response
Browsers Affected
Chrome
No Duplicate of the Issue
The text was updated successfully, but these errors were encountered: