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

Error converting document to PDF, LibreOffice timed out after 60 seconds #149

Closed
michaelpierre opened this issue Mar 8, 2022 · 4 comments
Labels
bug Something isn't working timeout Dangerzone Times Out
Milestone

Comments

@michaelpierre
Copy link

michaelpierre commented Mar 8, 2022

dangerzone-error

I have a 2.1 MB .xlsx Excel file i'm trying to convert to a PDF using DangerZone. I keep getting the captioned error. Other .xlsx Excel files convert successfully using DangerZone except this file. DangerZone is installed in a Ubuntu 20.04.4 VMWare VM on a Windows 11 host. Any idea why this is happening?

@yveszoundi
Copy link

@michaelpierre , Many of the conversion operations rely on "external programs" such as LibreOffice, executed with a defined timeout. The problem is determining the expected time limit for a program to either complete or be considered as a zombie process: should a timeout be even set/guessed by dangerzone in the first place????

Potential mitigation options

Do not set an execution timeout at all

  • Pros: If a process does not complete "quickly", there could be several legit reasons (large documents, lots of images, OCR enabled, etc.). Letting the program (LibreOffice, etc.) complete gracefully is often reasonable.
  • Cons: If a process hangs in the container during the conversion (and this has happened before), there's no user feedback.

Use a timeout that is proportional to the number of pages

  • Pros: This will work in many situations for most people, unless documents have tons of graphics.
  • Cons: There is more than just the number of pages to account for (number/size of images, available RAM and CPU, etc.).

Similar issues previously reported

Other references

I created another dangerzone version written in Rust due to this problem and for personal exploration. It's more about explaining the rationale as it pertains to this issue, rather than advertising my own minimal solution (developer audience).

  • I often run dangerzone inside a dedicated VM (RAM limit of 1GB), 60 secs timeouts are not desired.
  • I avoid scripting languages such as Python, if possible: for many corporate laptops the RAM is often 8GB-16GB. Scripting languages tend to abuse resources: if your PC starts swapping (many apps open), you could see more timeouts.

@yveszoundi
Copy link

@michaelpierre , I created an initial release of dangerzone-rust, in case it might be temporarily useful to you or others:

  • Linux binaries are available (GUI and CLI programs), along with MacOS and Windows support
    • The dangerzone-gui is an AppImage under Linux that might require the fuse2 dependency to run
    • Other Linux binaries are standalone zero-dependency programs (statically linked)
  • There's also a minimal "Online Service": Web usable by several users (home network and/or possibly intranet?)

@deeplow deeplow added the bug Something isn't working label Aug 17, 2022
@eloquence eloquence added this to the 0.5.0 milestone Sep 15, 2022
apyrgio added a commit that referenced this issue Nov 23, 2022
Bump the global timeout used for various steps from 1 minute to 2
minutes. The reason is that we've seen several reports of operations
failing due to timeout reasons, that were otherwise legitimately
running.

Also, bump the timeout used for compression, which has been reported as
problematic as well.

Refs #146
Refs #149
@apyrgio
Copy link
Contributor

apyrgio commented Nov 23, 2022

We will bump the timeout in the 0.4.0 release (not yet released). Let's keep this issue open for a little while, so that we can see if an increased timeout helps. Please comment here once you have 0.4.0 installed and this bug still affects you. Else, we can close this issue.

Note that increasing the timeout won't solve the underlying issue, but it will make it very rare, which is a good first step.

apyrgio added a commit that referenced this issue Nov 23, 2022
Bump the global timeout used for various steps from 1 minute to 2
minutes. The reason is that we've seen several reports of operations
failing due to timeout reasons, that were otherwise legitimately
running.

Also, bump the timeout used for compression, which has been reported as
problematic as well.

Refs #146
Refs #149
@deeplow deeplow added the timeout Dangerzone Times Out label Jan 23, 2023
@apyrgio
Copy link
Contributor

apyrgio commented Jun 13, 2023

Hi folks. I think this is the last issue for timeouts that is still open, so quick announcement for those who haven't seen the v0.4.1 changelog:

Feature: Adjust conversion timeouts based on the document's pages/size, and allow users to disable them with --disable-timeouts (available when you run the Dangerzone from the terminal) (#327)

If you still encounter timeout errors, then your environment may be low on resources, as Yves already suggested. In that case, feel free to use the --disable-timeouts option. Hopefully, this way Dangerzone will be able to detect hung processes within a reasonable time, and not fail even in machines that are swapping out.

If you still encounter a problem and none of the above solutions work, please reach out to us and create a new issue. For now, we consider this problem resolved.

@apyrgio apyrgio closed this as completed Jun 13, 2023
@apyrgio apyrgio modified the milestones: 0.5.0, 0.4.2 Aug 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working timeout Dangerzone Times Out
Projects
None yet
Development

No branches or pull requests

5 participants