OS - Linux pc64 3.19.0-32-generic #37~14.04.1-Ubuntu Mate Rosa 17.3 Libreoffice - Version: 5.0.3.2 Build ID: 1:5.0.3~rc2-0ubuntu1~trusty2 Locale: en-GB (en_GB.UTF-8) Installing an oxt extension as shared, registers and works for the superuser but not for other users. ../user/extensions/shared/log.txt ###### Progress log entry 2016-06-10 12:42:59 ###### ERROR: (com.sun.star.lang.IllegalArgumentException) { { { Message = "There is no such extension deployed: footswitch", Context = (com.sun.star.uno.XInterface) @2b4ee90 } }, ArgumentPosition = (short) -1 } ERROR: (com.sun.star.lang.IllegalArgumentException) { { { Message = "There is no such extension deployed: footswitch", Context = (com.sun.star.uno.XInterface) @2b4ee90 } }, ArgumentPosition = (short) -1 } Copying: footswitch.oxt ###### Progress log entry 2016-06-10 12:43:28 ###### The same extension can be installed for the user individually
It turns out that AddOns.xcu and its parent directory were still owned by root so: ~/.config/libreoffice/4/user/extensions/shared/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/lu178289vkw8g.tmp was owned by root in group root as was the AddOns.xcu in that directory Given that you have to be superuser to install an extension as shared, I deem it an error that the local files are left as owned as root.
Hi, (In reply to rolfofsaxony from comment #0) > Installing an oxt extension as shared, registers and works for the superuser > but not for other users. How did you do the installation?
(In reply to Cor Nouws from comment #2) > Hi, > > (In reply to rolfofsaxony from comment #0) > > Installing an oxt extension as shared, registers and works for the superuser > > but not for other users. > > How did you do the installation? it's been nearly a month, so I don't recall on that specific occasion. However, running through it again this afternoon I got the following: sudo su lowriter use extension manager add extension all users start lowriter as a user package is registered and menu items visible click a function and get the following error: A Scripting Framework error occurred while running the Python script vnd.sun.star.script:footswitch.oxt|footswitch|footswitch.py$EditConfigurationFile?language=Python&location=user:uno_packages. Message: <class 'KeyError'>: 'footswitch.oxt' /usr/lib/libreoffice/program/pythonscript.py:379 in function getStorageUrlFromPersistentUrl() [package = self.mapPackageName2Path[ packageName ]] /usr/lib/libreoffice/program/pythonscript.py:987 in function getScript() [self.provCtx.uriHelper.getStorageURI(scriptUri) );] files: /var/spool/libreoffice/uno_packages/cache/uno_packages/lu4412jaclz4.tmp_/ drwxr-xr-x 7 root root 4096 Aug 6 16:38 footswitch.oxt -rw-r--r-- 1 root root 0 Aug 6 16:38 footswitch.oxtproperties In the footswitch.oxt directory: -rw-r--r-- 1 root root 1216 Aug 6 16:38 51-footswitch.rules -rw-r--r-- 1 root root 105 Aug 6 16:38 51-microdialo.hwdb -rw-r--r-- 1 root root 109 Aug 6 16:38 51-microdialov220.hwdb -rw-r--r-- 1 root root 5076 Aug 6 16:38 Accelerators.xcu -rw-r--r-- 1 root root 7554 Aug 6 16:38 Addons.xcu -rw-r--r-- 1 root root 1413 Aug 6 16:38 description.xml drwxr-xr-x 2 root root 4096 Aug 6 16:38 footswitch -rw-r--r-- 1 root root 326 Aug 6 16:38 footswitch.ini -rw-r--r-- 1 root root 599560 Aug 6 16:38 footswitch.pdf drwxr-xr-x 2 root root 4096 Aug 6 16:38 icons -rw-r--r-- 1 root root 2792 Aug 6 16:38 messages_de.txt -rw-r--r-- 1 root root 2614 Aug 6 16:38 messages_en.txt -rw-r--r-- 1 root root 2855 Aug 6 16:38 messages_es.txt drwxr-xr-x 2 root root 4096 Aug 6 16:38 META-INF drwxr-xr-x 3 root root 4096 Aug 6 16:38 Office drwxr-xr-x 2 root root 4096 Aug 6 16:38 pkg-desc ~/.config/libreoffice/4/user/extensions/shared/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/lu4547jafah5.tmp $ drwxr-xr-x 2 rolf rolf 4096 Aug 6 16:40 . drwxr-xr-x 3 rolf rolf 4096 Aug 6 16:40 .. -rw-r--r-- 1 rolf rolf 8058 Aug 6 16:40 Addons.xcu I sent via email the extension, just in case the problem lies with it.
Hi, (In reply to rolfofsaxony from comment #0) > [...] > Installing an oxt extension as shared, registers and works for the superuser > but not for other users. Why do you think it is a bug ? Set status to NEEDINFO, please set it back to UNCONFIRMED once requested informations are provided. Best regards. JBF
Finally found a reference to what I assume is the same issue https://bz.apache.org/ooo/show_bug.cgi?id=102542 "The current URI specification for running a non-Basic script (JavaScript, BeanShell, Java, Python) is : vnd.sun.star.script:MACROREF?language=Language&location=[user|share|document] The consequence is that an extension containing a non-Basic script will contain URI's where the running level is fixed : either <user> or <shell>. These URI's are hard- written for example in the AddonUI.xcu file, or in the event tab of a dialog control. So if the extension designer wants its extension to be installed in user or shared levels, he/she must provide and maintain two variants of the same extension. " I assumed that I could add both URI's in Addons.xcu (for example like so) <prop oor:name="URL" oor:type="xs:string"> <value>vnd.sun.star.script:bookmarktoggle.oxt|bookmarktoggle|bookmarktoggle.py$BookmarkToggle?language=Python&location=user:uno_packages</value> <value>vnd.sun.star.script:bookmarktoggle.oxt|bookmarktoggle|bookmarktoggle.py$BookmarkToggle?language=Python&location=share:uno_packages</value> </prop> and depending on whether the extension was loaded as "user" or "all-users" the appropriate URI would be used. That does not appear to be the case. The bug https://bz.apache.org/ooo/show_bug.cgi?id=102542 seems to describe exactly the issue that I am having. I trust this clears up any doubts you have. Indeed given this information you may be able to come straight back with an answer, if this issue is now fixed in LibreOffice. Regards Rolf
I have investigated further and the issue seems to arise around the getPackageName2PathMap function in pythonscript.py Once the extension is installed for "All Users" it gets stored in /var/spool/libreoffice/uno_packages/cache/uno_packages under a *.tmp_ directory. Sudo'ing into lowriter once can see that this is recognised and loaded. Starting lowriter as a normal user, no initial attempt is made to load extensions in /var/spool/libreoffice/uno_packages/cache/uno_packages. However if you attempt to activate the extension, an attempt is made but returns 0 (Zero) extensions. Below is the Debug listing from lowriter first running as sudo and secondly as a normal user. sudo lowriter (soffice:6281): Gdk-WARNING **: gdk_window_set_icon_list: icons too large (soffice:6281): Gdk-WARNING **: gdk_window_set_icon_list: icons too large Sat Sep 23 14:42:35 2017 [DEBUG] pythonscript loading Sat Sep 23 14:42:35 2017 [DEBUG] pythonscript finished intializing Sat Sep 23 14:42:35 2017 [DEBUG] Entering PythonScriptProvider.ctorshare:uno_packages Sat Sep 23 14:42:35 2017 [DEBUG] initialized urihelper with baseUri=file:///var/spool/libreoffice/uno_packages/cache/uno_packages,m_scriptUriLocation=share:uno_packages Sat Sep 23 14:42:35 2017 [DEBUG] got urlHelper <pythonscript.MyUriHelper object at 0x7fcc01b895f8> Sat Sep 23 14:42:35 2017 [DEBUG] share:uno_packages transformed to file:///var/spool/libreoffice/uno_packages/cache/uno_packages Sat Sep 23 14:42:35 2017 [DEBUG] pythonscript: getPackageName2PathMap start getDeployedPackages Sat Sep 23 14:42:35 2017 [DEBUG] pythonscript: getPackageName2PathMap end getDeployedPackages (1) Sat Sep 23 14:42:35 2017 [DEBUG] inspecting package bookmarktoggle.oxt(bookmarktoggle) Sat Sep 23 14:42:35 2017 [ERROR] adding Package lu5912xamblb.tmp_ ('file:///var/spool/libreoffice/uno_packages/cache/uno_packages/lu5912xamblb.tmp_/bookmarktoggle.oxt/bookmarktoggle',) Sat Sep 23 14:42:35 2017 [DEBUG] hasByName called vnd.sun.star.expand:$UNO_SHARED_PACKAGES_CACHE/uno_packages/lu5912xamblb.tmp_/bookmarktoggle.oxt/bookmarktoggle Sat Sep 23 14:42:35 2017 [DEBUG] hasByName file:///var/spool/libreoffice/uno_packages/cache/uno_packages/lu5912xamblb.tmp_/bookmarktoggle.oxt/bookmarktoggle True Sat Sep 23 14:42:35 2017 [DEBUG] hasByName called vnd.sun.star.expand:$UNO_SHARED_PACKAGES_CACHE/uno_packages/lu5912xamblb.tmp_/bookmarktoggle.oxt/bookmarktoggle Sat Sep 23 14:42:35 2017 [DEBUG] hasByName file:///var/spool/libreoffice/uno_packages/cache/uno_packages/lu5912xamblb.tmp_/bookmarktoggle.oxt/bookmarktoggle True Sat Sep 23 14:42:35 2017 [DEBUG] hasByName called vnd.sun.star.expand:$UNO_SHARED_PACKAGES_CACHE/uno_packages/lu5912xamblb.tmp_/bookmarktoggle.oxt/bookmarktoggle Sat Sep 23 14:42:35 2017 [DEBUG] hasByName file:///var/spool/libreoffice/uno_packages/cache/uno_packages/lu5912xamblb.tmp_/bookmarktoggle.oxt/bookmarktoggle True ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ lowriter (soffice:6499): Gdk-WARNING **: gdk_window_set_icon_list: icons too large (soffice:6499): Gdk-WARNING **: gdk_window_set_icon_list: icons too large # #The following only happens after attempting to invoke the extension #whilst when running as sudo pythonscript is invoked upon startup of lowriter #for whatever reason the number of "deployedpackages" is returned as Zero, when #quite clearly, there is a package installed in /var/spool/libreoffice/uno_packages/cache/uno_packages # pythonloader.Loader ctor pythonloader.Loader.activate pythonloader: interpreting url vnd.openoffice.pymodule:pythonscript pythonloader: after expansion vnd.openoffice.pymodule:pythonscript Sat Sep 23 14:46:44 2017 [DEBUG] pythonscript loading Sat Sep 23 14:46:44 2017 [DEBUG] pythonscript finished intializing Fetched ImplHelper as <unohelper.ImplementationHelper object at 0x7fb3fb7e9630> Sat Sep 23 14:46:44 2017 [DEBUG] Entering PythonScriptProvider.ctorshare:uno_packages Sat Sep 23 14:46:44 2017 [DEBUG] initialized urihelper with baseUri=file:///var/spool/libreoffice/uno_packages/cache/uno_packages,m_scriptUriLocation=share:uno_packages Sat Sep 23 14:46:44 2017 [DEBUG] got urlHelper <pythonscript.MyUriHelper object at 0x7fb3fb7e9828> Sat Sep 23 14:46:44 2017 [DEBUG] share:uno_packages transformed to file:///var/spool/libreoffice/uno_packages/cache/uno_packages Sat Sep 23 14:46:44 2017 [DEBUG] pythonscript: getPackageName2PathMap start getDeployedPackages Sat Sep 23 14:46:44 2017 [DEBUG] pythonscript: getPackageName2PathMap end getDeployedPackages (0) Sat Sep 23 14:46:44 2017 [DEBUG] getScript vnd.sun.star.script:bookmarktoggle.oxt|bookmarktoggle|bookmarktoggle.py$BookmarkToggle?language=Python&location=share:uno_packages invoked Sat Sep 23 14:46:44 2017 [DEBUG] converting scriptURI=vnd.sun.star.script:bookmarktoggle.oxt|bookmarktoggle|bookmarktoggle.py$BookmarkToggle?language=Python&location=share:uno_packages to storageURI=file:///var/spool/libreoffice/uno_packages/cache/uno_packages/bookmarktoggle.oxt/bookmarktoggle/bookmarktoggle.py$BookmarkToggle Sat Sep 23 14:46:44 2017 [ERROR] <class 'KeyError'>: 'bookmarktoggle.oxt' /usr/lib/libreoffice/program/pythonscript.py:380 in function getStorageUrlFromPersistentUrl() [package = self.mapPackageName2Path[ packageName ]] /usr/lib/libreoffice/program/pythonscript.py:988 in function getScript() [self.provCtx.uriHelper.getStorageURI(scriptUri) );] (soffice:6499): Gdk-WARNING **: gdk_window_set_icon_list: icons too large ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ You will note that the normal user debug listing is looking for file:///var/spool/libreoffice/uno_packages/cache/uno_packages/bookmarktoggle.oxt/bookmarktoggle/bookmarktoggle.py$BookmarkToggle rather than file:///var/spool/libreoffice/uno_packages/cache/uno_packages/lu5912xamblb.tmp_/bookmarktoggle.oxt/bookmarktoggle if you need more information let me know. regards Rolf
I do this all the time, but yes - you can't run LibreOffice as sudo, otherwise the users files are owned as root. Here is the bash code that I use to install shared extensions as part of my machine rollout: # ------------------------------------------------------------------------------ # Set LibreOffice defaults with extension # ------------------------------------------------------------------------------ if [ -z "$(pgrep soffice)" ]; then LO_EXTENSION=LanguageTool-3.5.oxt if [ -e ${LO_EXTENSION} ]; then echo Adding ${LO_EXTENSION} extension unopkg add --shared ${LO_EXTENSION} else echo " ... unable to find ${LO_EXTENSION}" fi else echo " ... LibreOffice is running, so skipping adding any extensions" fi Marking as works for me. I've been doing this since 4.x, and most recently on 5.4.2. See the help file for how to install shared extensions at https://help.libreoffice.org/Common/Extension_Manager
(In reply to Justin L from comment #7) > I do this all the time, but yes - you can't run LibreOffice as sudo, > otherwise the users files are owned as root. Here is the bash code that I > use to install shared extensions as part of my machine rollout: > > # > ----------------------------------------------------------------------------- > - > # Set LibreOffice defaults with extension > # > ----------------------------------------------------------------------------- > - > if [ -z "$(pgrep soffice)" ]; then > LO_EXTENSION=LanguageTool-3.5.oxt > if [ -e ${LO_EXTENSION} ]; then > echo Adding ${LO_EXTENSION} extension > unopkg add --shared ${LO_EXTENSION} > else > echo " ... unable to find ${LO_EXTENSION}" > fi > else > echo " ... LibreOffice is running, so skipping adding any extensions" > fi > > Marking as works for me. I've been doing this since 4.x, and most recently > on 5.4.2. See the help file for how to install shared extensions at > https://help.libreoffice.org/Common/Extension_Manager This bug report is specifically about python extensions and as far as I know LanguageTool is not written in python. The command that you have provided, may well work with Basic or Java extensions but it fails with python. Installing as superuser, installs ONLY for superuser even if the install for all users option is selected. Installing using sudo and selecting install for all users, shows the extension for all users but than fails miserably, when asked to activate, being that it cannot find the path of the extension. I have even tried creating another version specifically for multiuser installation, where the Addons.xcu file contains location=share:uno_packages rather than the usual location=user:uno_packages entry but that fails too.
You can't confirm your own bugs. Moving it back to UNCONFIRMED until someone else confirms it.
> The bug https://bz.apache.org/ooo/show_bug.cgi?id=102542 seems to describe > exactly the issue that I am having. > I trust this clears up any doubts you have. Indeed given this information > you may be able to come straight back with an answer, if this issue is now > fixed in LibreOffice. Setting version to Inherit from OOo then
One idea: try to install as a "bundled extension" and see if that works. That is what I started doing in Ubuntu 18.04. LO_EXTENSION_DIR=/usr/lib/libreoffice/share/extensions unzip -q -d "${LO_EXTENSION_DIR}/${LO_EXTENSION}" "${LO_EXTENSION}.oxt"
(In reply to Justin L from comment #11) > One idea: try to install as a "bundled extension" and see if that works. > That is what I started doing in Ubuntu 18.04. > > LO_EXTENSION_DIR=/usr/lib/libreoffice/share/extensions > unzip -q -d "${LO_EXTENSION_DIR}/${LO_EXTENSION}" "${LO_EXTENSION}.oxt" Dear Reporter, Could you please try what Justin L is suggesting? I have set the bug's status to 'NEEDINFO'. Please change it back to 'UNCONFIRMED' once you have test it
(In reply to Xisco Faulí from comment #12) > (In reply to Justin L from comment #11) > > One idea: try to install as a "bundled extension" and see if that works. > > That is what I started doing in Ubuntu 18.04. > > > > LO_EXTENSION_DIR=/usr/lib/libreoffice/share/extensions > > unzip -q -d "${LO_EXTENSION_DIR}/${LO_EXTENSION}" "${LO_EXTENSION}.oxt" > > Dear Reporter, > Could you please try what Justin L is suggesting? > > I have set the bug's status to 'NEEDINFO'. Please change it back to > 'UNCONFIRMED' once you have test it Installed it as a bundled extension. chmod the directory structure and files of the extension in /usr/lib/libreoffice/share/extensions/ with +rx The extension displays in the Extension Manager as Locked (A padlock symbol) The extension does not display in the LibreOffice Macros or My Macros in the Run Macro dialog This option, sadly, doesn't help, unless someone knows how to resolve the permission issue. Arguably, one shouldn't have to jump through these sorts of hoops anyway.
I encounter this problem too, in Ubuntu 16.04 and LibreOffice 5.1 Is there anything I can do to help to fix it?
(In reply to altclava from comment #14) > I encounter this problem too, in Ubuntu 16.04 and LibreOffice 5.1 > Is there anything I can do to help to fix it? Edit the bugs status to confirmed, I guess.
(In reply to rolfofsaxony from comment #15) > (In reply to altclava from comment #14) > > I encounter this problem too, in Ubuntu 16.04 and LibreOffice 5.1 > > Is there anything I can do to help to fix it? > > Edit the bugs status to confirmed, I guess. I can't, I do not have enough privileges to do this. I am a newbie on his site.
(In reply to rolfofsaxony from comment #15) > (In reply to altclava from comment #14) > > I encounter this problem too, in Ubuntu 16.04 and LibreOffice 5.1 > > Is there anything I can do to help to fix it? > > Edit the bugs status to confirmed, I guess. I can't, I do not have enough privileges to do this. I am a newbie on his site.(In reply to rolfofsaxony from comment #15) Upd: I just discovered that my permissions on page https://bugs.documentfoundation.org/userprefs.cgi?tab=permissions say canconfirm Can confirm a bug. But when I press on Status button I do not get option "Confirmed". Any ideas?
(In reply to altclava from comment #17) [...] > But when I press on Status button I do not get option "Confirmed". > Any ideas? Confirmed == NEW Best regards. JBF
Hello, I don't know if it could help somebody. I tried to installed to install the Grammalecte (https://www.dicollecte.org/) extension as a shared one. [ A ] I tried using Justin L suggestion : $ LO_EXTENSION_DIR=/usr/lib/libreoffice/share/extensions $ sudo unzip -q -d "${LO_EXTENSION_DIR}/${LO_EXTENSION}" "${LO_EXTENSION}.oxt" > This did not work for me too ! [ B ] I tried using unopkg tool $ sudo unopkg add --shared Grammalecte-fr-v0.6.5.oxt As reported by rolfofsaxony@gmail.com extension is installed in /var/spool/libreoffice/uno_packages/cache/uno_packages/*tmpXXXX/Grammalecte-fr-v0.6.5.oxt . Only root can use it. No standard users can use the extension and the extension is even not loaded ... no additional menu in my case. So I moved all created files by unopkg from /libreoffice/uno_packages/cache/uno_packages/*tmpXXXX/* to /usr/lib/libreoffice/share/extensions > This worked well. Extension is listed, and all users can use it. Extension can't be removed by standard users and seen as bundled with LibreOffice. I tried to understand what are the differences between method [A] and [B] I compared the crc and content of all files - All files contained in oxt zip file remains exactly the same using unzip or unopkg - unopkg tool has created a new properties file named Grammalecte-fr-v0.6.5.oxtproperties which contains properties related to the extension as SUPPRESS_LICENSE=0 I tried to delete this file but the extension is still loaded. - unopkg created many __pycache__ folders which are cantaining files. I tried to delete these __pycache__ folders and then the extension is no more loaded. I tried same method with another extension and I got the same results. So I don't know why unopkg is doing it works in /var/spool/libreoffice/uno_packages/... I don't know if it will work for all extension. I hope this can help somebody. Kind Regards
For what is worth, I've just installed Grammalecte-fr-v1.9.0.oxt on Ubuntu 20.04 (with LibreOffice 6.4.3) using sudo unopkg add -f --suppress-license --shared /tmp/Grammalecte-fr-v1.9.0.oxt and it went flawlessly ; standard users can use the extension.
(In reply to Nicolas Girard from comment #20) > For what is worth, I've just installed Grammalecte-fr-v1.9.0.oxt on Ubuntu > 20.04 (with LibreOffice 6.4.3) using > > sudo unopkg add -f --suppress-license --shared > /tmp/Grammalecte-fr-v1.9.0.oxt > > and it went flawlessly ; standard users can use the extension. To be fair it's been so long that I haven't checked it in an age. I have just checked 2 of my python writer extensions and they can both be installed by the root user for all users, as long as they are packaged to be so. i.e. <prop oor:name="URL" oor:type="xs:string"> <value>vnd.sun.star.script:bookmarktoggle.oxt|bookmarktoggle|bookmarktoggle.py$BookmarkToggle?language=Python&location=share:uno_packages/cache/uno_packages</value> </prop> The key being the "location=share:uno_pac..." as opposed to "location=user:uno_pac..." LibreOffice writer version: Version: 6.0.7.3 Build ID: 1:6.0.7-0ubuntu0.18.04.10 OS: Linux 4.15; gtk2; Time to close this bug.
I'm happy to mark this bug as resolved 30/05/2020 I don't know when it got fixed but testing in Version: 6.0.7.3 Build ID: 1:6.0.7-0ubuntu0.18.04.10 it's fine.
(In reply to rolfofsaxony from comment #22) > I'm happy to mark this bug as resolved 30/05/2020 Thank you very much for re-testing. > I don't know when it got fixed [...] So correct status is WorksForMe. Best regards. JBF