gotenberg icon indicating copy to clipboard operation
gotenberg copied to clipboard

LibreOffice listener fails to start

Open gulien opened this issue 2 years ago β€’ 22 comments

Discussed in https://github.com/gotenberg/gotenberg/discussions/440

Originally posted by Lincoln-hub March 22, 2022 I am running Gotenbergr on my local computer, I installed all the required engines but I'm running into this error: [FATAL] starting uno: start long-running LibreOffice listener: execute LibreOffice listener: context done: context deadline exceeded exit status 1. Does anyone know how to fix this?

gulien avatar Mar 26 '22 06:03 gulien

@lincoln-hub could you disable the long-running LibreOffice listener with --uno-listener-restart-threshold=0? If that does not work, could you rollback to version 7.3?

gulien avatar Mar 26 '22 06:03 gulien

Hi @gulien Thank you for your help. Disabling the long-running LibreOffice listener didn't work either. version 7.3 gives the error below(looks like there is no option for --user-profile): 2022/03/26 22:17:55.067 DEBUG api form data values: map[] {"trace": "4ea59205-b1da-4385-b4cd-057e025ce49e"} 2022/03/26 22:17:55.067 DEBUG api form data files: map[Data_for_scaling.xlsx:/tmp/55c85e27-b816-4442-bf56-81e47da09a86/Data_for_scaling.xlsx] {"trace": "4ea59205-b1da-4385-b4cd-057e025ce49e"} 2022/03/26 22:17:55.067 DEBUG api print to PDF with: {Landscape:false PageRanges: PDFArchive:false} {"trace": "4ea59205-b1da-4385-b4cd-057e025ce49e"} 2022/03/26 22:17:55.067 DEBUG api.cmd start unix process: /usr/bin/unoconv --user-profile ///tmp/bdd4323e-579f-445f-8c21-8a5c47cad9f8 --port 41383 --format pdf -vvv --output /tmp/55c85e27-b816-4442-bf56-81e47da09a86/26a72c11-882b-4ec2-9993-e82bb2d5d1a2.pdf /tmp/55c85e27-b816-4442-bf56-81e47da09a86/Data_for_scaling.xlsx {"trace": "4ea59205-b1da-4385-b4cd-057e025ce49e"} 2022/03/26 22:17:55.169 DEBUG api.cmd.stdout unoconv: option --user-profile not recognized, try unoconv -h for a list of all the options {"trace": "4ea59205-b1da-4385-b4cd-057e025ce49e"} 2022/03/26 22:17:55.182 DEBUG api.cmd unix process already killed {"trace": "4ea59205-b1da-4385-b4cd-057e025ce49e"} 2022/03/26 22:17:55.182 DEBUG api '/tmp/55c85e27-b816-4442-bf56-81e47da09a86' removed {"trace": "4ea59205-b1da-4385-b4cd-057e025ce49e"} 2022/03/26 22:17:55.182 ERROR api convert to PDF: unoconv PDF: unix process error: exit status 255 {"trace": "4ea59205-b1da-4385-b4cd-057e025ce49e", "remote_ip": "::1", "host": "localhost:3000", "uri": "/forms/libreoffice/convert", "method": "POST", "path": "/forms/libreoffice/convert", "referer": "", "user_agent": "PostmanRuntime/7.28.4", "status": 500, "latency": 116257920, "latency_human": "116.25792ms", "bytes_in": 9026, "bytes_out": 21}

Lincoln-hub avatar Mar 26 '22 23:03 Lincoln-hub

Now that’s weird.. What’s your system specifications? amd64?

gulien avatar Mar 27 '22 10:03 gulien

We have the same problem since we upgraded from 7.4.3 to 7.5.2. The error log messages are:

{"level":"error","ts":1648454891.0365252,"logger":"uno","msg":"unlock long-running LibreOffice listener: restart LibreOffice listener: start LibreOffice listener: LibreOffice listener socket not available: context deadline exceeded"}

{"level":"error","ts":1648454901.0387313,"logger":"api","msg":"convert to PDF: lock long-running LibreOffice listener: restart long-running LibreOffice listener: start LibreOffice listener: LibreOffice listener socket not available: context deadline exceeded","trace":"188155ec-e383-4486-9b7a-e77ea6788bbf","remote_ip":"xxx.xxx.xxx.xxx","host":"zsp-pdfcreator-worker:3000","uri":"/pdfcreatorworker/forms/libreoffice/convert","method":"POST","path":"/pdfcreatorworker/forms/libreoffice/convert","referer":"","user_agent":"ReactorNetty/1.0.16","status":503,"latency":18618289204,"latency_human":"18.618289204s","bytes_in":-1,"bytes_out":19}

Our system spec is Linux 3.10.0-1160.53.1.el7.x86_64 #1 SMP Thu Dec 16 10:19:28 UTC 2021 x86_64 GNU/Linux.

remoteexception avatar Mar 28 '22 10:03 remoteexception

It may be related to https://github.com/gotenberg/gotenberg/issues/403

gulien avatar Mar 28 '22 12:03 gulien

@remoteexception @Lincoln-hub could you run libreoffice --version inside the container (latest version)?

gulien avatar Mar 28 '22 12:03 gulien

With gotenberg 7.5.2:

libreoffice --version
LibreOffice 7.3.1.3 30(Build:3)

With gotenberg 7.4.3:

libreoffice --version
LibreOffice 7.2.5.2.0 20(Build:2)

remoteexception avatar Mar 28 '22 12:03 remoteexception

I'm kinda blocked here..

The version 7.3 was the one actually causing the issue described in #403, but it's now the default in bullseye-backports (and there is not other version in this distribution). I could rollback to 7.0 with bullseye distribution, but that's an "old" version that has also some issues.

Any idea welcome πŸ˜„

gulien avatar Mar 29 '22 15:03 gulien

Just wanted to say, I'm experiencing this problem too. I'm able to upload a single doc sometimes, but soon after it crashes with the above mentioned errors

azmatzuberi avatar Apr 02 '22 16:04 azmatzuberi

I guess the version 7.4.3 still work in the mean time πŸ˜…

gulien avatar Apr 02 '22 17:04 gulien

Maybe you could check, whether there is a known bug in Libreoffice or file a bug report at: https://bugs.documentfoundation.org/

I am also experiencing this problem since last upgrade. Unfortunately I don't have sufficient knowledge about gotenberg, GO, UNO etc. to file or search for a bug.

HoffmannTom avatar Apr 25 '22 08:04 HoffmannTom

Instead of using bullseye-backports, could you install the .deb files from the LibreOffice archive using the latest 'Still Branch' release? https://downloadarchive.documentfoundation.org/libreoffice/old/7.2.7.1/deb/x86_64/

crackalak avatar Apr 26 '22 18:04 crackalak

@crackalak indeed, thanks πŸ™

I have to check if there are other platforms available (arm64 etc.), otherwise the amd64 image will differ from others.

gulien avatar Apr 26 '22 18:04 gulien

Ah yes, looking at that archive it seems there are only arm64 builds for macos

Additionally, there appears to be a mismatch of versions between architectures in bullseye-backports πŸ€”: https://packages.debian.org/bullseye-backports/libreoffice

crackalak avatar Apr 26 '22 22:04 crackalak

I also have problems with 7.5.2, but 7.4.3 works fine for me

YuriyVorobyov96 avatar May 06 '22 11:05 YuriyVorobyov96

Version 7.5.3 brings a newer build of LibreOffice 7.3. No issues on the demo instance so far.

gulien avatar Jun 07 '22 15:06 gulien

I'm also facing this issue with 7.5.3. Is a rollback to 7.4.3 the best solution for now?

davidbasalla avatar Jun 15 '22 06:06 davidbasalla

@davidbasalla it is for now 😟

I wonder why it works on some systems/platforms, while on other it does not. For instance, it never happened on the demo instance.

gulien avatar Jun 15 '22 07:06 gulien

It might be related to the switch from unoconv to my own custom solution when it comes to creating the listener.

gulien avatar Jun 15 '22 07:06 gulien

I also experience the same problem. Is returning to Unoconv a possible way to go? Maybe just to see if its related to that.

HoffmannTom avatar Jul 05 '22 13:07 HoffmannTom

@HoffmannTom I do think it's more related to the LibreOffice version than unoconv.

gulien avatar Jul 05 '22 14:07 gulien

I tested the new version 7.6.0. Unfortunately, the same problem shows up, listener dies after a certain time. Had to do rollback to 7.4.3

HoffmannTom avatar Sep 05 '22 06:09 HoffmannTom

Having the same problem, had to downgrade to 7.4.3 from 7.7 which meant the loss of --uno-listener-restart-threshold=0 which in turn means that we get the error Service Unavailable rather than context deadline when converting multiple documents.

NiklasBr avatar Nov 18 '22 12:11 NiklasBr

@NiklasBr how is it working for you as of now? I'm thinking about downgrading to 7.4.3 (I'm running it on CloudRun) as well

janswist avatar Dec 04 '22 13:12 janswist

@NiklasBr @crackalak @davidbasalla @azmatzuberi @YuriyVorobyov96 @remoteexception could you try the image gulnap/gotenberg:libreofficefix? It's using a downgraded version of LibreOffice (7.0.4) but with the Gotenberg 7.7.1 codebase.

gulien avatar Jan 02 '23 16:01 gulien

@NiklasBr @crackalak @davidbasalla @azmatzuberi @YuriyVorobyov96 @remoteexception could you try the image gulnap/gotenberg:libreofficefix? It's using a downgraded version of LibreOffice (7.0.4) but with the Gotenberg 7.7.1 codebase.

I came across the same issue today. I used this suggestion as an attempt to fix this issue and it worked for me. I did not perform extensive testing but with [gotenberg/gotenberg:latest] the issue occurred and with [gulnap/gotenberg:libreofficefix] it did not. Thank you!

chuth-cx avatar Jan 03 '23 11:01 chuth-cx

@chuth-cx Thanks for the feedback!

gulien avatar Jan 03 '23 12:01 gulien

As mentioned in https://github.com/paperless-ngx/paperless-ngx/issues/2065 there was also a problem with document conversion from office documents to pdf using Gotenberg 7.5/7.6, Gotenberg 7.4 is working fine.

I just tested file conversion with gulnap/gotenberg:libreofficefix and can report back, that it's working too.

mztiq avatar Jan 03 '23 14:01 mztiq

@mztiq Thanks for the feedback! Once a new release is available (soon I hope), could you update the paperless-ngx issue too? πŸ˜„

gulien avatar Jan 03 '23 14:01 gulien

@gulien of course.

mztiq avatar Jan 03 '23 14:01 mztiq