online icon indicating copy to clipboard operation
online copied to clipboard

PDF save as or conversion doesn't work

Open hfiguiere opened this issue 2 years ago • 7 comments

Describe the Bug

Exporting to PDF from the web interface, or converting to PDF using the conversion API fail.

Steps to Reproduce

  1. Build CODE
  2. make run
  3. Open the URL of a default document
  4. Save as PDF
  5. (nothing happens)

Expected Behavior

Save as PDF work: it opens in browser OR save.

Actual Behavior

Nothing happens.

Screenshots

Desktop

(Please complete the following information)

  • OS: Linux
  • Browser: Firefox
  • Version: [e.g. 114.0]

Smartphone

n/a

Additional Context

Converting to a Microsoft format do work. (DOCX or PPTX) This happen with Writer or Impress (ODT or ODP as source respectively).

curl -k -F "[email protected]" https://127.0.0.1:9980/cool/convert-to/pdf returns 0 bytes.

the error in the console:

warn:lok:676643:676641:desktop/source/lib/init.cxx:246: lok exception 'exception: SfxBaseModel::impl_store <file:///tmp/user/docs/CollaboraOnline_UpdatedLayout_Transitions_WIP.pdf> failed: 0xc10(Error Area:Io Class:Write Code:16) at /home/hub/Documents/Collabora/cool-dev/libreoffice-core/sfx2/source/doc/sfxbasemodel.cxx:3237 at /home/hub/Documents/Collabora/cool-dev/libreoffice-core/sfx2/source/doc/sfxbasemodel.cxx:1793'

When using the web UI, the error is:

warn:lok:676643:676641:desktop/source/lib/init.cxx:246: lok exception 'exception: SfxBaseModel::impl_store <file:///tmp/user/docs/CollaboraOnline_UpdatedLayout_Transitions_WIP.pdf> failed: 0xc10(Error Area:Io Class:Write Code:16) at /home/hub/Documents/Collabora/cool-dev/libreoffice-core/sfx2/source/doc/sfxbasemodel.cxx:3237 at /home/hub/Documents/Collabora/cool-dev/libreoffice-core/sfx2/source/doc/sfxbasemodel.cxx:1793'

hfiguiere avatar Sep 01 '23 16:09 hfiguiere

online is at 7cebe0f0419d2e7502ceafb7f5a1ce0029c38464

libreoffice-core is at 2d9e0a7ffa29a0882b92c55e90189e509124e2de

But code from a few days ago had the same problem.

hfiguiere avatar Sep 01 '23 16:09 hfiguiere

PDFExport::Export throw:

N3com3sun4star3uno9ExceptionE msg: NSS_NoDB_Init failed with SEC_ERROR_PKCS11_DEVICE_ERROR (-8023) at /home/hub/Documents/Collabora/cool-dev/libreoffice-core/comphelper/source/misc/hash.cxx:87

hfiguiere avatar Sep 01 '23 20:09 hfiguiere

I see two problems:

  1. it fails, and that looks like a config problem (possibly on my side), but the failure is obscure. I had to dig deep and trace to get the exception above.
  2. the download hang. I think the API response should have been terminated possibly with an HTTP error code. Similarly in the web UI there is no error either. Just nothing.

hfiguiere avatar Sep 01 '23 21:09 hfiguiere

The lack of /dev/random and /dev/urandom in the jails seems to be the reason.

hfiguiere avatar Sep 04 '23 13:09 hfiguiere

A workaround is to build core with --with-tls=openssl. At least in a dev setup this works.

hfiguiere avatar Sep 04 '23 14:09 hfiguiere

I wonder if this is not #5088 also.

hfiguiere avatar Apr 29 '24 14:04 hfiguiere

If this still reproduces, and seeing as step 1 is "Build CODE", is there output from:

make check-for-system-nss

in online?

(core needs to be built using --without-system-nss for nss to work in chroot jail the above attempts to check for that)

caolanm avatar Oct 14 '24 15:10 caolanm