CollaboraOnline / online

Collabora Online is a collaborative online office suite based on LibreOffice technology. This is also the source for the Collabora Office apps for iOS and Android.
https://collaboraonline.com
Other
1.8k stars 691 forks source link

PDF save as or conversion doesn't work #7201

Open hfiguiere opened 1 year ago

hfiguiere commented 1 year ago

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)

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 "data=@myfile.odp" 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 commented 1 year ago

online is at 7cebe0f0419d2e7502ceafb7f5a1ce0029c38464

libreoffice-core is at 2d9e0a7ffa29a0882b92c55e90189e509124e2de

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

hfiguiere commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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

hfiguiere commented 1 year ago

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

hfiguiere commented 5 months ago

I wonder if this is not #5088 also.