[snap] Cannot use PyUno connector

Bug #1806514 reported by Tim Edwards
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libreoffice (Ubuntu)
Confirmed
Low
Unassigned

Bug Description

It's not possible to use pyoo, which uses the Uno connector to Libreoffice, on a machine where the Libreoffice Snap is installed. The pyoo/Uno connector works fine with the libreoffice Apt packages.

To reproduce run this script:
#!/usr/bin/env python3
import pyoo
import subprocess
import time
import shlex

# PyOO needs a running Libreoffice process to do its work
lo_proc = subprocess.Popen(shlex.split("soffice --accept=\"socket,host=localhost,port=2002;urp;\" --norestore --nologo --nodefault"))
time.sleep(3) # give Libreoffice time to actually start before trying to connect to it
lo_instance = pyoo.Desktop('localhost', 2002)
lo_instance.create_spreadsheet()

Expected results (seen with the Libreoffice DEB-packages from Ubuntu): A new Calc window opens up showing a spreadsheet

Actual results:
$ ./test.py
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/pyoo.py", line 1833, in _get_remote_context
    return resolver.resolve(url)
uno.NoConnectException: Connector : couldn't connect to socket (Success)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./test.py", line 10, in <module>
    lo_instance = pyoo.Desktop('localhost', 2002)
  File "/usr/local/lib/python3.6/dist-packages/pyoo.py", line 1853, in __init__
    self.remote_context = _get_remote_context(resolver, url)
  File "/usr/local/lib/python3.6/dist-packages/pyoo.py", line 1835, in _get_remote_context
    raise IOError(resolver, url)
OSError: [Errno pyuno object (com.sun.star.uno.XInterface)0x1ff9450{implementationName=com.sun.star.comp.bridge.UnoUrlResolver, supportedServices={com.sun.star.bridge.UnoUrlResolver}, supportedInterfaces={com.sun.star.lang.XServiceInfo,com.sun.star.bridge.XUnoUrlResolver,com.sun.star.lang.XTypeProvider,com.sun.star.uno.XWeak}}] uno:socket,host=localhost,port=2002;urp;StarOffice.ComponentContext

Actual results if you specify the path to the soffice binary:
lo_proc = subprocess.Popen(shlex.split("soffice --accept=\"socket,host=localhost,port=2002;urp;\" --norestore --nologo --nodefault"))

$ ./test.py
/snap/libreoffice/90/lib/libreoffice/program/soffice.bin: error while loading shared libraries: libicuuc.so.55: cannot open shared object file: No such file or directory
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/pyoo.py", line 1833, in _get_remote_context
    return resolver.resolve(url)
uno.NoConnectException: Connector : couldn't connect to socket (Success)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./test.py", line 10, in <module>
    lo_instance = pyoo.Desktop('localhost', 2002)
  File "/usr/local/lib/python3.6/dist-packages/pyoo.py", line 1853, in __init__
    self.remote_context = _get_remote_context(resolver, url)
  File "/usr/local/lib/python3.6/dist-packages/pyoo.py", line 1835, in _get_remote_context
    raise IOError(resolver, url)
OSError: [Errno pyuno object (com.sun.star.uno.XInterface)0x1b11450{implementationName=com.sun.star.comp.bridge.UnoUrlResolver, supportedServices={com.sun.star.bridge.UnoUrlResolver}, supportedInterfaces={com.sun.star.lang.XServiceInfo,com.sun.star.bridge.XUnoUrlResolver,com.sun.star.lang.XTypeProvider,com.sun.star.uno.XWeak}}] uno:socket,host=localhost,port=2002;urp;StarOffice.ComponentContext

Tags: snap
Revision history for this message
Tim Edwards (tkedwards) wrote :

The second error message is when specifying the exact path in the script like this:
lo_proc = subprocess.Popen(shlex.split("/snap/libreoffice/current/lib/libreoffice/program/soffice --accept=\"socket,host=localhost,port=2002;urp;\" --norestore --nologo --nodefault"))

Olivier Tilloy (osomon)
summary: - Cannot use PyUno connector with Libreoffice snap
+ [snap] Cannot use PyUno connector
tags: added: snap
Olivier Tilloy (osomon)
Changed in libreoffice (Ubuntu):
status: New → Confirmed
Changed in libreoffice (Ubuntu):
importance: Undecided → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.