1
I use SlimerJs as an headless browser on a server. Because the server have no xserver I used xvfb to run it.
The command goes something like this:
xvfb-run --server-args="-screen 0, 1024x768x24" slimerjs-0.10.0pre/slimerjs \
script.js --debug=yes "/tmp/file986Iww" "/tmp/file28bAEv" "pdf"
The file script.js
takes a file name for input, a file name for output and a format to convert to, using slimer's printer capability.
My problem is that when running as root, it works fine. But when I let apache do the work it fails and get stucks.
Apache runs under www-data
user and group. This is the output of the previous command:
slimerjs-0.10.0pre/xulrunner/xulrunner -app slimerjs-0.10.0pre/application.ini --profile /tmp/slimerjs.gRAJJar6 -no-remote script.js --debug=yes /tmp/file986Iww /tmp/file28bAEv pdf
Xlib: extension "RANDR" missing on display ":99".
JavaScript warning: resource://slimerjs/slUtils.jsm, line 154: JavaScript 1.7's let blocks are deprecated
JavaScript error: jar:file:///var/www/project/slimerjs-0.10.0pre/xulrunner/omni.ja!/components/XULStore.js, line 66: NS_ERROR_FAILURE: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIProperties.get]
** stuck forever here **
The line 66 of XULStore.js
is:
65. Services.obs.addObserver(this, "profile-before-change", true);
66. this._storeFile = Services.dirsvc.get("ProfD", Ci.nsIFile);
67. this._storeFile.append(STOREDB_FILENAME);
Trying to see what is wrong with strace show me that it is stuck in some kind of loop...
I see no reasons why this user can't run this binary.
How can I debug what permission is missing or what is going wrong with xulrunner ?
I did not post the strace because it's quite heavy, feel free to ask for it if you feel it may contain relevant informations.
$ uname -a
Linux *host* 3.10-0.bpo.2-amd64 #1 SMP Debian 3.10.5-1~bpo70+1 (2013-08-11) x86_64 GNU/Linux
Their was a lot more than that but you put me on the right track. By using
strace
andgrep EACC
I saw what where the files causing trouble. Profile was indeed involved. I had to create and chmod many files in order for it to work. – Cyrbil – 2015-07-28T09:48:02.950