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

unoconv not working #61

Closed
LionSher opened this issue Jun 26, 2012 · 12 comments
Closed

unoconv not working #61

LionSher opened this issue Jun 26, 2012 · 12 comments
Assignees
Labels
Milestone

Comments

@LionSher
Copy link

I have been trying to fix this issue for a long time now but unable to figure out the fix. Please help.
$ unoconv -f pdf presentation_39.ppt
unoconv: UnoException during conversion in <class 'main.com.sun.star.lang.IllegalArgumentException'>: Unsupported URL file:///home/kern/my_rails_app/public/data/presentation_39/presentation_39.ppt: ""
Traceback (most recent call last):
File "/usr/bin/unoconv", line 790, in
main()
File "/usr/bin/unoconv", line 769, in main
convertor.convert(inputfn)
File "/usr/bin/unoconv", line 679, in convert
error("ERROR: The provided document cannot be converted to the desired format. (code: %s)" % e.ErrCode)
File "/usr/lib/python2.7/dist-packages/uno.py", line 337, in uno_struct__getattr_
return builtin.getattr(self.dict["value"],name)
AttributeError: ErrCode

So, i downloaded unoconv-0.5.tar.bz2 from https://github.com/dagwieers/unoconv/downloads, and extracted it in my rails app's public folder. Then i got this error:
$ /home/kern/my_rails_app/public/unoconv-0.5/unoconv -f pdf presentation_39.ppt
UNO IllegalArgument during import phase: Source file cannot be read. Unsupported URL file:///home/kern/my_rails_app/public/data/presentation_39/presentation_39.ppt: ""

Then i gave UNO_PATH= parameter as follows:
$ UNO_PATH=/usr/lib/libreoffice /home/kern/my_rails_app/public/unoconv-0.5/unoconv -f pdf presentation_39.ppt
UNO IllegalArgument during import phase: Source file cannot be read. Unsupported URL file:///home/kern/my_rails_app/public/data/presentation_39/presentation_39.ppt: ""
NOTE: i do not have libreoffice path at /opt/libreoffice3.5 as mentioned in #47
NOTE: I have tried the above with unoconv listener also as foolows:
$ unoconv --listener &
[1] 31574
$ ps -ef
root 31574 31503 3 07:27 pts/4 00:00:00 /usr/bin/python /usr/bin/unoconv --listener

The ppt file has 777 permissions as follows:
$ ls -l
total 260
-rwxrwxrwx 1 kern kern 258560 Jun 25 08:17 presentation_39.ppt

I have the following on my ubuntu 12.04 LTS 64-bit machine:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.04 LTS
Release: 12.04
Codename: precise

$ apt-cache policy libreoffice
libreoffice:
Installed: 1:3.5.3-0ubuntu1
Candidate: 1:3.5.3-0ubuntu1

$ apt-cache policy unoconv
unoconv:
Installed: 0.4-1
Candidate: 0.4-1
NOTE: i have tried to search for libreoffice-pyuno or libobasis3.5-pyuno for which i get:
$ apt-cache policy libreoffice-pyuno
N: Unable to locate package libreoffice-pyuno
N: Couldn't find any package by regex 'libreoffice-pyuno'
NOTE: i have python-uno

@dagwieers
Copy link
Member

Did you try it with any other files ?

Can you share the file so I can test it on my system ?

@LionSher
Copy link
Author

Thank you, for your reply. I had been trying to convert one particular .ppt file which was prepared by one of our clients. It seems there is some problem with the file itself. When I tried the process for other files, the conversion went on smooth. Also previously the conversion was not working for other .ppt files too, which i now figured out that the problem was with my app's environment. I have been able to fix it too. So now unoconv happily works for those files too. Thank you.

@ghost ghost assigned dagwieers Jun 28, 2012
@dagwieers
Copy link
Member

@LionSher: Do you mean it is fixed now ? Can you shed a light on what you changed in your environment to make it work so we can improve the documentation ? Thanks in advance.

@LionSher
Copy link
Author

I am not sure if the problem was with unoconv. Let me explain. In my local machine I ran my app in development mode with Webrick server as:
$ rails s
Here unoconv worked fine.

But unoconv gave me problem when I had my app running on Nginx-Passenger which was in production mode on Rackspace server where my /opt/nginx/conf/nginx.conf file had 'rails_env' parameter set to 'production'. This was where my ppts were not getting converted. Even after trying out all the solutions as I had mentioned, it didn't work. So I just changed 'rails_env' parameter to 'development' in my /opt/nginx/conf/nginx.conf file and now unoconv is running perfectly.
Has environment got anything to do with unoconv?

@sigmike
Copy link

sigmike commented Aug 17, 2012

I had the same problem. I had to kill a dead process of soffice.bin to make unoconv work again.

@tj
Copy link

tj commented Nov 5, 2012

killing soffice.bin fixed my issue as well

@dagwieers
Copy link
Member

@visionmedia This is one of the steps of the troubleshooting section of the README.

@tj
Copy link

tj commented Nov 5, 2012

yeah, glad it's working now, dependency hell <3

@tj
Copy link

tj commented Nov 12, 2012

something in our vm must have changed, it's no longer working, even after killing soffice.bin this time. looking into it..

   ∴ fixtures (master): unoconv -f pdf tobi.odt
Warning: -headless is deprecated.  Use --headless instead.
Warning: -invisible is deprecated.  Use --invisible instead.
Warning: -nodefault is deprecated.  Use --nodefault instead.
Warning: -nofirststartwizard is deprecated.  Use --nofirststartwizard instead.
Warning: -nologo is deprecated.  Use --nologo instead.
Warning: -norestore is deprecated.  Use --norestore instead.
Warning: -accept=socket,host=localhost,port=2002;urp;StarOffice.ComponentContext is deprecated.  Use --accept=socket,host=localhost,port=2002;urp;StarOffice.ComponentContext instead.
unoconv: UnoException during conversion in <class '__main__.com.sun.star.lang.IllegalArgumentException'>: Unsupported URL <file:///home/vagrant/projects/thumbs/test/fixtures/tobi.odt>: ""
Traceback (most recent call last):
  File "/usr/bin/unoconv", line 790, in <module>
    main()
  File "/usr/bin/unoconv", line 769, in main
    convertor.convert(inputfn)
  File "/usr/bin/unoconv", line 679, in convert
    error("ERROR: The provided document cannot be converted to the desired format. (code: %s)" % e.ErrCode)
  File "/usr/lib/python2.7/dist-packages/uno.py", line 337, in _uno_struct__getattr__
    return __builtin__.getattr(self.__dict__["value"],name)
AttributeError: ErrCode

@tj
Copy link

tj commented Nov 12, 2012

got it working again

@dagwieers
Copy link
Member

@visionmedia I would upgrade to v0.6 which fixes a lot of unrelated items from your output as well...

@synnyday
Copy link

I am using unoconv with no X display. I did:

$ sudo apt-get install openoffice.org xvfb 
$ xvfb-run -a /usr/lib/libreoffice/program/soffice -headless -nologo -norestore -nofirststartwizard
$ sudo apt-get install unoconv 

Then I converted different documents. I have problem with only one file ( http://fs01n4.sendspace.com/dl/15b0ce8bf0fcb31a330282361e414dd0/520e0aa80c7529e2/luqbs4/f.rtf ):

$ unoconv -f html f.rtf 
Warning: -headless is deprecated.  Use --headless instead.
Warning: -invisible is deprecated.  Use --invisible instead.
Warning: -nodefault is deprecated.  Use --nodefault instead.
Warning: -nofirststartwizard is deprecated.  Use --nofirststartwizard instead.
Warning: -nologo is deprecated.  Use --nologo instead.
Warning: -norestore is deprecated.  Use --norestore instead.
Warning: -accept=socket,host=localhost,port=2002;urp;StarOffice.ComponentContext is deprecated.  Use --accept=socket,host=localhost,port=2002;urp;StarOffice.ComponentContext instead.
unoconv: UnoException during conversion in : Binary URP bridge disposed during call
Traceback (most recent call last):
  File "/usr/bin/unoconv", line 790, in 
    main()
  File "/usr/bin/unoconv", line 769, in main
    convertor.convert(inputfn)
  File "/usr/bin/unoconv", line 679, in convert
    error("ERROR: The provided document cannot be converted to the desired format. (code: %s)" % e.ErrCode)
  File "/usr/lib/python2.7/dist-packages/uno.py", line 320, in _uno_struct__getattr__
    return __builtin__.getattr(self.__dict__["value"],name)
AttributeError: ErrCode

This is additional info:

$ unoconv --version
unoconv 0.4
Written by Dag Wieers 
Homepage at http://dag.wieers.com/home-made/unoconv/
platform posix/linux2
python 2.7.2+ (default, Oct  4 2011, 20:06:09) 
[GCC 4.6.1]
build revision $Rev$
$ apt-cache policy libreoffice
libreoffice:
Installed: 1:3.4.4-0ubuntu1.4
Candidate: 1:3.4.4-0ubuntu1.4
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 11.10
Release:    11.10
Codename:   oneiric

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants