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

Can't run unoconv as www-data user in Ubuntu 14.04LTS #336

Closed
thepurpleblob opened this issue May 12, 2016 · 7 comments
Closed

Can't run unoconv as www-data user in Ubuntu 14.04LTS #336

thepurpleblob opened this issue May 12, 2016 · 7 comments
Labels

Comments

@thepurpleblob
Copy link

thepurpleblob commented May 12, 2016

Basically...

$ sudo -H -u www-data bash -c "./unoconv -f pdf ~/pomo\ essay.doc"
Error: Unable to connect or start own listener. Aborting.

Running the same (unoconv) command as myself works perfectly. Running sudo as another normal user works fine.

The is Ubuntu 14.04 which ships with 0.6 but I am testing with 0.7 straight from Github. The only thing I changed is the top line to use python3. It seems peculiar to www-data and this kills it when called using exec() in PHP (output from that is the same listener error)

-vvv version:
Verbosity set to level 3
Using office base path: /usr/lib/libreoffice
Using office binary path: /usr/lib/libreoffice/program
DEBUG: Connection type: socket,host=127.0.0.1,port=2002,tcpNoDelay=1;urp;StarOffice.ComponentContext
DEBUG: Existing listener not found.
DEBUG: Launching our own listener using /usr/lib/libreoffice/program/soffice.bin.
LibreOffice listener successfully started. (pid=7166)
DEBUG: Process /usr/lib/libreoffice/program/soffice.bin (pid=7166) exited with 77.
Error: Unable to connect or start own listener. Aborting.

@rrusso
Copy link

rrusso commented May 12, 2016

Running into the same problem here on 14.04LTS.

I'm also running .7 from the master branch here on github as well as the latest (5.1) LibreOffice.

The only change to unoconv is specifying python3 in the top line.

@rrusso
Copy link

rrusso commented May 12, 2016

Adding the $pythonhome and setting it to /usr/bin/python3 seems to solve this for me. I'll dig deeper.

@thepurpleblob
Copy link
Author

Sorry for my ignorance, but my Python skills are basic. Where did you add $pythonhome? I see a lot of code in the script working with a variable 'pythonhome'

@thepurpleblob
Copy link
Author

Ahh.... the problem was that, on Ubuntu at least, the running user's home directory has to be writable (by them) to create a couple of hidden directories. Unfortunately, www-data's home directory is /var/www and that is only writeable by root. Sorting the permissions to enable www-data to write sorts it out.

I assume it was libreoffice trying to create the directories, but a more helpful message wouldn't have hurt.

@dagwieers
Copy link
Member

It helps to read the documentation, as people have run into the same issue before: https://github.com/dagwieers/unoconv#problems-running-unoconv-from-nginxapachephp

@thepurpleblob
Copy link
Author

Yes, yes - I don't know how many times I read that and still missed it :) :)

@thepurpleblob
Copy link
Author

Working fine now.. thanks

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

3 participants