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

Unoserver ran once and don't restart #18

Closed
classifaddict opened this issue Mar 4, 2022 · 10 comments
Closed

Unoserver ran once and don't restart #18

classifaddict opened this issue Mar 4, 2022 · 10 comments

Comments

@classifaddict
Copy link

Hello,
I succeed running unoserver/unoconverter once and then I never been able to start the server again after rebooting the machine:

$ sudo unoserver --daemon --executable /usr/lib/libreoffice/program/soffice.bin
INFO:unoserver:Starting unoserver.
INFO:unoserver:Command: /usr/lib/libreoffice/program/soffice.bin --headless --invisible --nocrashreport --nodefault --nologo --nofirststartwizard --norestore -env:UserInstallation=file:///tmp/tmpznzt5utn --accept=socket,host=127.0.0.1,port=2002,tcpNoDelay=1;urp;StarOffice.ComponentContext
<subprocess.Popen object at 0x7fd1c8c1ad60>

$ ps aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.0 8940 160 ? Ssl 08:04 0:00 /init
root 9 0.0 0.0 8948 140 tty1 Ss 08:04 0:00 /init
olivier 10 0.0 0.0 18228 2772 tty1 S 08:04 0:00 -bash
root 76 0.0 0.0 8948 140 tty2 Ss 08:06 0:00 /init
olivier 77 0.0 0.0 18480 3324 tty2 S 08:06 0:01 -bash
olivier 805 0.0 0.0 18664 1888 tty2 R 10:45 0:00 ps aux

$ unoconvert --convert-to pdf test.fodt test.pdf
INFO:unoserver:Starting unoconverter.
Traceback (most recent call last):
File "/usr/local/bin/unoconvert", line 8, in
sys.exit(main())
File "/usr/local/lib/python3.8/dist-packages/unoserver/converter.py", line 231, in main
converter = UnoConverter(args.interface, args.port)
File "/usr/local/lib/python3.8/dist-packages/unoserver/converter.py", line 74, in init
self.context = self.resolver.resolve(
unoserver.converter.NoConnectException: Connector : couldn't connect to socket (Connection refused) /build/libreoffice-crGbO6/libreoffice-7.3.0~rc3/io/source/connector/connector.cxx:117

This happened in both Ubuntu 20.04.3 WSL and Virtualbox.

Is there anything that could prevent unoserver from restarting?

Thanks for this tools and your help!

@regebro
Copy link
Member

regebro commented Mar 4, 2022

Try without --daemon and see what happens. Maybe it crashes?

@classifaddict
Copy link
Author

classifaddict commented Mar 4, 2022

$ sudo unoserver --executable /usr/lib/libreoffice/program/soffice.bin
[sudo] password for olivier:
INFO:unoserver:Starting unoserver.
INFO:unoserver:Command: /usr/lib/libreoffice/program/soffice.bin --headless --invisible --nocrashreport --nodefault --nologo --nofirststartwizard --norestore -env:UserInstallation=file:///tmp/tmp8ip81ibp --accept=socket,host=127.0.0.1,port=2002,tcpNoDelay=1;urp;StarOffice.ComponentContext
$

Is there a log file somewhere?

@regebro
Copy link
Member

regebro commented Mar 4, 2022

No, Libreoffice is very bad at logging. As a last attempt, try just running libreoffice. It seems it doesn't start properly.

@classifaddict
Copy link
Author

unoconvert is OK if I run this command in a separate shell:
/usr/lib/libreoffice/program/soffice.bin --headless --invisible --nocrashreport --nodefault --nologo --nofirststartwizard --norestore -env:UserInstallation=file:///tmp/tmp8ip81ibp --accept="socket,host=127.0.0.1,port=2002,tcpNoDelay=1;urp;StarOffice.ComponentContext"

@regebro
Copy link
Member

regebro commented Mar 4, 2022

Since that is literally all Unoserver does, I can't explain that.

@classifaddict
Copy link
Author

classifaddict commented Mar 4, 2022

Weird! I will let you know if I find an explanation.
Thanks.

@unbranched
Copy link

Had the same problem, solved by doing:

$ unoserver --daemon --executable /usr/lib/libreoffice/program/soffice

Please note it's not soffice.bin, and please don't start it with sudo!

Then unoconvert worked. Tested in a python virtual env.

@regebro
Copy link
Member

regebro commented May 23, 2023

Normally unoserver just calls libreoffice, but unless you have a broken install somewhere, that would be /usr/lib/libreoffice, which is a symlink to /usr/lib/libreoffice/program/soffice, so I'm curious to why --executable /usr/lib/libreoffice/program/soffice would make a difference.

@unbranched
Copy link

Normally unoserver just calls libreoffice, but unless you have a broken install somewhere, that would be /usr/lib/libreoffice, which is a symlink to /usr/lib/libreoffice/program/soffice, so I'm curious to why --executable /usr/lib/libreoffice/program/soffice would make a difference.

Yes it works too without specifying the executable.
I specified that in case the OP needs it.

@regebro
Copy link
Member

regebro commented May 23, 2023

True, they specified soffice.bin, I'll try to remember that if somebody else has this issue to see if that makes a difference.

@regebro regebro closed this as completed Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants