carbone icon indicating copy to clipboard operation
carbone copied to clipboard

Has anyone had any luck integrating with Libreoffice 6.2.x or 6.3.x in a Linux environment?

Open ngaldridge opened this issue 4 years ago • 11 comments

Hi,

Has anyone had any luck integrating with a Libreoffice 6.2.x or 6.3.x in a linux environment?

I set PYTHONPATH="/usr/lib/libreoffice/program" so that Carbone can find Uno, but I get some strange errors when Carbone's converter.py is attempting to import from com.sun.star...

When I run the test program with Nodejs debug turned on, i get:

  carbone:converter python stderr : Traceback (most recent call last):
  File "/usr/local/dcs/node_modules/carbone/lib/converter.py", line 9, in <module>
    from com.sun.star.document.UpdateDocMode import QUIET_UPDATE
  File "/usr/lib/libreoffice/program/uno.py", line 434, in _uno_import
    raise uno_import_exc
  File "/usr/lib/libreoffice/program/uno.py", line 356, in _uno_import
    return _builtin_import(name, *optargs, **kwargs)
ImportError: No module named 'com' (or 'com.sun.star.document.UpdateDocMode.QUIET_UPDATE' is unknown)
 +109ms
  carbone:converter process Python of factory 0 died 1 +4ms
  carbone:converter process Office of factory 0 died null +70ms
  carbone:converter factory 0 is completely off +0ms
  carbone:converter python stderr : Traceback (most recent call last):
  File "/usr/local/dcs/node_modules/carbone/lib/converter.py", line 9, in <module>
    from com.sun.star.document.UpdateDocMode import QUIET_UPDATE
  File "/usr/lib/libreoffice/program/uno.py", line 434, in _uno_import
    raise uno_import_exc
  File "/usr/lib/libreoffice/program/uno.py", line 356, in _uno_import
    return _builtin_import(name, *optargs, **kwargs)
ImportError: No module named 'com' (or 'com.sun.star.document.UpdateDocMode.QUIET_UPDATE' is unknown)
 +101ms
  carbone:converter process Python of factory 0 died 1 +4ms
  carbone:converter process Office of factory 0 died null +289ms
  carbone:converter factory 0 is completely off +0ms
  carbone:converter python stderr : Traceback (most recent call last):
  File "/usr/local/dcs/node_modules/carbone/lib/converter.py", line 9, in <module>
    from com.sun.star.document.UpdateDocMode import QUIET_UPDATE
  File "/usr/lib/libreoffice/program/uno.py", line 434, in _uno_import
    raise uno_import_exc
  File "/usr/lib/libreoffice/program/uno.py", line 356, in _uno_import
    return _builtin_import(name, *optargs, **kwargs)
ImportError: No module named 'com' (or 'com.sun.star.document.UpdateDocMode.QUIET_UPDATE' is unknown)
 +99ms
  carbone:converter process Python of factory 0 died 1 +3ms

Thanks in advance for any advice!

Cheers,

Nathan

ngaldridge avatar Aug 30 '19 20:08 ngaldridge

Hi,

How did you install LibreOffice? We strongly recommend using this method: https://github.com/Ideolys/carbone#on-ubuntu-server--ubuntu-desktop This LibreOffice installation method contains everything Carbone needs.

We have some Ubuntu 18.04 LTS servers running successfully with the version 6.3.0.4. Here is the link: http://downloadarchive.documentfoundation.org/libreoffice/old/6.3.0.4/deb/x86_64/LibreOffice_6.3.0.4_Linux_x86-64_deb.tar.gz

Best regards, David.

dgrelaud avatar Sep 02 '19 04:09 dgrelaud

So, I'm running on Alpine and thus the only binary installs are from the Alpine repo. I guess there's something interesting going on with the Python/LO library integration that I haven't figured out yet.

ngaldridge avatar Sep 03 '19 03:09 ngaldridge

I’ve already tried to run Carbone in Alpine for a Docker image, but many things were missing and I didn’t succeed. Good luck with it, it’s hard 😄

viincenb avatar Sep 03 '19 16:09 viincenb

Ok - I got one run out of it (docker/alpine) - I figured out how the python/libreoffice binding works (at least enough to be dangerous).

I need to do a few more tests now to see if I've really got it.

ngaldridge avatar Sep 03 '19 23:09 ngaldridge

So, I have succeeded in figuring out how to integrate with 6.2.x and 6.3.x in Alpine (in Docker). Feel free to contact me if you would like to know what I had to do.

Cheers!

Nathan

ngaldridge avatar Sep 05 '19 22:09 ngaldridge

@ngaldridge I would be interested in this. Are you able to send a gist of your Dockerfile?

pdittaro avatar Sep 13 '19 20:09 pdittaro

Hi,

We are investigating the idea again, we will come back to you.

steevepay avatar Oct 15 '19 18:10 steevepay

Hi @pdittaro

You can take a look at carbone-docker if you want a packaged Docker image with a Carbone API exposed. (Upgraded to LibreOffice 6.3.3.1 this morning).

You also could be interested in carbone-connect to have a similar Carbone JS API with some improvements (Promises and Streams).

fleebzz avatar Oct 17 '19 15:10 fleebzz

So, I have succeeded in figuring out how to integrate with 6.2.x and 6.3.x in Alpine (in Docker). Feel free to contact me if you would like to know what I had to do.

Cheers!

Nathan

@ngaldridge would you be able to share your Alpine solution? I've got it working with @fleebzz's carbone-docker container (and using newer node images than the 8 one in there), but interested in seeing your Alpine one as well if available. Thanks.

loneil avatar Dec 17 '19 20:12 loneil

https://github.com/bcgov/alpine-node-libreoffice/issues/7

I am running into an almost similar issue but the Office is the one that dies.

Anyone with a solution ? I don't have much details to go with but died 1

carbone-lambda_1  | 2022-06-10T14:41:16.622Z carbone:converter process Office of factory 0 died 1
carbone-lambda_1  | 2022-06-10T14:41:16.626Z carbone:converter process Python of factory 0 died null
carbone-lambda_1  | 2022-06-10T14:41:16.627Z carbone:converter factory 0 is completely off

karimkawambwa avatar Jun 10 '22 14:06 karimkawambwa

ngaldridge Hi there, could you share the install instruction on docker alpine 🙏 ? It would be of a great help :)!

adussarps avatar Oct 21 '23 12:10 adussarps