Bug 14046 - unoconv command doesn't work at all
Summary: unoconv command doesn't work at all
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 4
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: QA Team
QA Contact:
URL:
Whiteboard: has_procedure MGA4-64-OK MGA4-32-OK a...
Keywords: validated_update
: 13125 15337 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-09-03 14:53 CEST by igor ivanov
Modified: 2015-03-10 17:49 CET (History)
7 users (show)

See Also:
Source RPM: unoconv-0.4-3.mga4
CVE:
Status comment:


Attachments

Description igor ivanov 2014-09-03 14:53:30 CEST
Description of problem: the command unoconv doesn't work at all


Version-Release number of selected component (if applicable):


How reproducible:some examples:

[toto@mageia4_64 ~]$ unoconv -f doc 24032014_1.pdf 
unoconv: Cannot find the pyuno library in sys.path and known paths.
ERROR: Please locate this library and send your feedback to: <tools@lists.rpmforge.net>.
[toto@mageia4_64 ~]$ unoconv --show
unoconv: Cannot find the pyuno library in sys.path and known paths.
ERROR: Please locate this library and send your feedback to: <tools@lists.rpmforge.net>.
[toto@mageia4_64 ~]$ unoconv -f --show doc 24032014_1.pdf 
unoconv: Cannot find the pyuno library in sys.path and known paths.
ERROR: Please locate this library and send your feedback to: <tools@lists.rpmforge.net>.
[toto@mageia4_64 ~]$ unoconv -f odt HorsTemazcal.doc 
unoconv: Cannot find the pyuno library in sys.path and known paths.
ERROR: Please locate this library and send your feedback to: <tools@lists.rpmforge.net>.
[toto@mageia4_64 ~]$ unoconv -f doc lettre.odt 
unoconv: Cannot find the pyuno library in sys.path and known paths.
ERROR: Please locate this library and send your feedback to: <tools@lists.rpmforge.net>.



Steps to Reproduce:try to covert files frome one format to another one with the command unoconv
1.
2.
3.


Reproducible: 

Steps to Reproduce:
Comment 1 igor ivanov 2014-09-03 15:31:13 CEST
pyuno lib does exist:
[toto@mageia4_64 ~]$ rpm -qa | grep pyuno
libreoffice-pyuno-4.1.5.3-1.mga4
David Walser 2014-09-03 20:07:52 CEST

CC: (none) => mageia
Assignee: bugsquad => olav

Comment 2 igor ivanov 2014-09-05 12:24:44 CEST
progress in the bug's resolution:

in line 23 of /usr/bin/unoconv:
23  extrapaths = glob.glob('/usr/lib*/openoffice*/program') + \

if I replace 'openoffice' by 'libreoffice', I obtain:

[toto@mageia4_64 ~]$ unoconv --show
No module named uno
WARNING: Found pyuno.so in /usr/lib64/libreoffice/program, but could not import it.
unoconv: Cannot find the pyuno library in sys.path and known paths.
ERROR: Please locate this library and send your feedback to: <tools@lists.rpmforge.net>.

I am unable to go ahead, due to my lack in knowledge of linux machinery, but I strongly suspect that the bug is due to openoffice which has to be replaced by libreoffice, oolibpath by something like lolibpath,...

good luck!

CC: (none) => algaraad

Comment 3 Rémi Verschelde 2014-09-17 14:02:31 CEST
Most likely the issue is that unoconv 0.4 is really old and was not made for LibreOffice (it dates back to October 2010, LibreOffice was just forked then and had no release).

Updating unoconv to version 0.6 from September 2012 or a later development snapshot should fix the issue: https://github.com/dagwieers/unoconv/releases

Keywords: (none) => Junior_job
CC: (none) => remi

Comment 4 igor ivanov 2014-09-18 01:18:01 CEST
(In reply to Rémi Verschelde from comment #3)
> Most likely the issue is that unoconv 0.4 is really old and was not made for
> LibreOffice (it dates back to October 2010, LibreOffice was just forked then
> and had no release).
> 
> Updating unoconv to version 0.6 from September 2012 or a later development
> snapshot should fix the issue: https://github.com/dagwieers/unoconv/releases

Unfortunately not:

[toto@mageia4_64 ~]$ ./Téléchargements/unoconv/unoconv-0.6/unoconv --show
unoconv: Cannot find a suitable pyuno library and python binary combination in /usr/lib64/libreoffice
ERROR: No module named uno

unoconv: Cannot find a suitable office installation on your system.
ERROR: Please locate your office installation and send your feedback to:
       http://github.com/dagwieers/unoconv/issues
franck villaume 2015-02-21 18:43:55 CET

See Also: (none) => https://bugs.mageia.org/show_bug.cgi?id=15337

Comment 5 Rémi Verschelde 2015-02-21 19:52:40 CET
*** Bug 15337 has been marked as a duplicate of this bug. ***

CC: (none) => franck.villaume

Comment 6 Rémi Verschelde 2015-02-21 19:55:59 CET
I had a look and indeed the pyuno modules in Mageia are located in /usr/lib/python3.4/site-packages while unoconv is a Python 2 script...

Changing the shebang to point to /usr/bin/python3 seems to solve the above-mentioned issue, but then it seems that unoconv is kind of broken, I don't manage to process any file.

Judging by the fact that upstream has 19 open pull requests, I guess we're not the only ones with problems with pyuno: https://github.com/dagwieers/unoconv

I think I'll drop unoconv from Cauldron to prevent propagating this bug further to Mageia 5.
Comment 7 Rémi Verschelde 2015-02-21 21:53:04 CET
Actually it seems that Python 3 support was added in the master branch, so I'll just do a snapshot of it and enforce Python 3 usage.

I still get issues when using unoconv, but that might be because I'm not using it correctly :-)
"unoconv -f odt test.pdf" works fine on a PDF file produced in LibreOffice.
Rémi Verschelde 2015-02-21 21:53:27 CET

Hardware: x86_64 => All
Version: 4 => Cauldron
Assignee: olav => remi
Whiteboard: (none) => MGA4TOO

Comment 8 Rémi Verschelde 2015-02-21 22:14:04 CET
Franck, could you try unoconv-0.6-4.20140923.1.mga5 ?
If it works for you I'll prepare an update for Mageia 4.
Comment 9 franck villaume 2015-02-22 13:47:14 CET
Hi Rémi,

just updated my box with latest unoconv package you provide. Here are the results I get:

[root@mga5 ~]# unoconv 
unoconv: you have to provide a filename as argument
Try `unoconv -h' for more information.
[root@mga5 ~]# unoconv -f pdf /home/franck/tests.xlsx 
Error: Unable to connect or start own listener. Aborting.
[root@mga5 ~]# unoconv -f pdf /home/franck/tests.xlsx 
[root@mga5 ~]# cd /home/franck/
[root@mga5 franck]# ll
total 56
drwxr-xr-x 2 franck franck  4096 févr. 21 15:39 Bureau/
drwxr-xr-x 2 franck franck  4096 févr. 21 15:39 Documents/
drwxr-xr-x 2 franck franck  4096 févr. 21 15:39 Images/
drwxr-xr-x 2 franck franck  4096 févr. 21 15:39 Modèles/
drwxr-xr-x 2 franck franck  4096 févr. 21 15:39 Musique/
drwxr-xr-x 2 franck franck  4096 févr. 21 15:39 Téléchargements/
-rw-r--r-- 1 root   root   13364 févr. 22 12:40 tests.pdf
-rw-rw-r-- 1 franck franck  4874 févr. 22 12:39 tests.xlsx
drwx------ 2 franck franck  4096 oct.  16 10:37 tmp/
drwxr-xr-x 2 franck franck  4096 févr. 21 15:39 Vidéos/
[root@mga5 franck]# file tests.pdf 
tests.pdf: PDF document, version 1.4


The generated pdf is OK.
The funny thing is first you get: "Error: Unable to connect or start own listener. Aborting."
Then it works.
Comment 10 Rémi Verschelde 2015-02-22 14:44:30 CET
It looks like this issue which was opened a few days ago: https://github.com/dagwieers/unoconv/issues/241
Can you confirm that it works everytime now?
Comment 11 franck villaume 2015-02-22 16:33:17 CET
just rebooted my box, rerun unoconv. I confirm it works now.
Comment 12 Rémi Verschelde 2015-02-22 16:40:54 CET
Nice :-) I'll push the update as is to Mageia 4 then, since there is no workaround yet to the bug linked in comment 10.
Comment 13 Rémi Verschelde 2015-02-22 17:07:40 CET
Pushing unoconv-0.6-1.20140923.2.mga4 as an update to Mageia 4, to solve this very bug report: unoconv does not work at all.

Suggested advisory:
===================

Updated unoconv package makes it usable

  unoconv 0.4 as shipped in Mageia 4 is not usable, since it is a Python 2 
  script that depends on Libreoffice's pyuno module, but the latter is Python 3
  only (mga#14046).

  This update provides a development snapshot of unoconv's master branch (there
  has not been any stable release since the 0.6 release in 2012), which includes
  among other fixes the needed Python 3 compatibility.

  Known issues: On the first invocation, unoconv might fail with "Error: Unable
  to connect or start own listener. Aborting." because it does not find its
  config file. It will nevertheless generate it and work on subsequent calls
  (github#241).


References:
===========
 - https://bugs.mageia.org/show_bug.cgi?id=14046
 - https://github.com/dagwieers/unoconv/tree/2a5cfb8133f1aeccc212ac10e67946772dc925ab
 - https://github.com/dagwieers/unoconv/issues/241


RPM in core/updates_testing:
============================
 - unoconv-0.6-1.20140923.2.mga4.noarch.rpm

SRPM:
=====
 - unoconv-0.6-1.20140923.2.mga4.src.rpm

Keywords: Junior_job => (none)
Version: Cauldron => 4
Assignee: remi => qa-bugs
Whiteboard: MGA4TOO => (none)

Comment 14 claire robinson 2015-02-27 16:39:02 CET
Testing mga4 64

Before
------
$ unoconv -f odt example.pdf
unoconv: Cannot find the pyuno library in sys.path and known paths.
ERROR: Please locate this library and send your feedback to: <tools@lists.rpmforge.net>.


After
-----
$ unoconv -f odt example.pdf
$

Verified the odt document.

$ mv example.odt example2.odt
$ unoconv -f doc example2.odt
unoconv: UnoException during export phase:
Unable to store document to file:///home/claire/example2.doc (ErrCode 3088)

Properties: ((com.sun.star.beans.PropertyValue){ Name = (string)"FilterName", Handle = (long)0x0, Value = (any){ (string)"MS Word 97" }, State = (com.sun.star.beans.PropertyState)DIRECT_VALUE }, (com.sun.star.beans.PropertyValue){ Name = (string)"Overwrite", Handle = (long)0x0, Value = (any){ (boolean)true }, State = (com.sun.star.beans.PropertyState)DIRECT_VALUE }, (com.sun.star.beans.PropertyValue){ Name = (string)"OutputStream", Handle = (long)0x0, Value = (any){ (com.sun.star.uno.XInterface)0x27f9fe8{, supportedInterfaces={com.sun.star.io.XOutputStream,com.sun.star.lang.XTypeProvider}} }, State = (com.sun.star.beans.PropertyState)DIRECT_VALUE })

Whiteboard: (none) => has_procedure feedback

Comment 15 Rémi Verschelde 2015-02-27 17:09:49 CET
(In reply to claire robinson from comment #14)
> Testing mga4 64
> 
> $ mv example.odt example2.odt
> $ unoconv -f doc example2.odt
> unoconv: UnoException during export phase:
> Unable to store document to file:///home/claire/example2.doc (ErrCode 3088)
> 
Yes, from my quick tests I also found that unoconv is far from being bug-free. Upstream seems relatively dead, with 19 open pull requests and 100 open bug reports.

The ErrCode 3088 bug looks like: https://github.com/dagwieers/unoconv/issues/226

No fix so far apart from a hint that it works on 32bit so it might be an arch-dependent issue.

Here I managed to convert an odt to doc, but not a pdf to doc.


Anyway, this updates brings unoconv from an unusable state to a "usable for some formats but not all of them" state, so I guess it's still an improvement for Mageia 4. I don't really plan to try to fix the code myself, I don't know the code and upstream doesn't seem to care much.

Maybe I should drop unoconv for mga5 though, WDYT?
Comment 16 Rémi Verschelde 2015-03-08 19:33:04 CET
(In reply to Rémi Verschelde from comment #15)
> 
> Anyway, this updates brings unoconv from an unusable state to a "usable for
> some formats but not all of them" state, so I guess it's still an
> improvement for Mageia 4. I don't really plan to try to fix the code myself,
> I don't know the code and upstream doesn't seem to care much.
> 
WDYT Claire? Should we go on with this update?
Comment 17 claire robinson 2015-03-09 16:36:07 CET
Yes. It's a 100% improvement over the current package.

Whiteboard: has_procedure feedback => has_procedure mga4-64-ok

Comment 18 Herman Viaene 2015-03-10 11:46:36 CET
MGA4-32 on AcerD620 Xfce.
No installation issues.
I created a small document testunoconv.odt with LibreOffice Writer.
At the CLI:
$ unoconv -f doc testunoconv.odt
just returned. In thunar I see a file testunoconv.doc, marked as a Microsoft Office document.
I open the doc file in LibreOffice Writer and save it, and the usual warning on saving in a foreign format occurs, so OK to me.

CC: (none) => herman.viaene
Whiteboard: has_procedure mga4-64-ok => has_procedure MGA4-64-OK MGA-32-OK

Comment 19 Marek Laane 2015-03-10 12:08:09 CET
there seems to be little typo in whiteboard

Whiteboard: has_procedure MGA4-64-OK MGA-32-OK => has_procedure MGA4-64-OK MGA4-32-OK

Comment 20 Rémi Verschelde 2015-03-10 12:37:13 CET
Advisory uploaded, validating. Please push to 4 core/updates.

Keywords: (none) => validated_update
Whiteboard: has_procedure MGA4-64-OK MGA4-32-OK => has_procedure MGA4-64-OK MGA4-32-OK advisory
CC: (none) => sysadmin-bugs

Comment 21 Philippe Makowski 2015-03-10 13:11:22 CET
*** Bug 13125 has been marked as a duplicate of this bug. ***

CC: (none) => ingolf.schaefer

Comment 22 Mageia Robot 2015-03-10 17:49:00 CET
An update for this issue has been pushed to Mageia Updates repository.

http://advisories.mageia.org/MGAA-2015-0026.html

Status: NEW => RESOLVED
Resolution: (none) => FIXED


Note You need to log in before you can comment on or make changes to this bug.