0

I'm trying to run an Xvfb server on an Amazon EC2 instance and then have a selenium Firefox driver use the virtual display to save screenshots of websites. I was formerly using PhantomJS, but it can not load all of the types of pages that I need it to.

This server works fine when I run it on my local user on a remote Amazon EC2 instance, but when I try to run it as "qauser", my selenium Firefox driver cannot connect to the virtual display; it simply hangs when I try to initialize the webdriver. If I attempt to launch firefox using the virtual display, I get "Error: Access was denied while trying to open files in your profile directory."

If I su into qauser, and then run Xvfb and my application, it works fine. If I run Xvfb as qauser, and run the webdriver as my own user, it works. The problem occurs when I run both Xvfb and my application as qauser. Does anyone have any idea of that might be wrong?

My Xvfb server, and application which creates the webdriver are run with supervisord. The config is posted here:

[program:QaServer]
command = python /opt/corp/qa_tool/main.py
environment = PATH='$PATH:/opt/bin:/usr/local/bin:/usr/bin', DISPLAY='localhost:99'
user = qauser
directory = /home/qauser
priority = 1
stdout_logfile = /opt/corp/qaData/qaTool.log
redirect_stderr = true

[program:Xvfb]
command = Xvfb :99
user = qauser
directory = /home/qauser
priority = 2
stdout_logfile = /opt/corp/qaData/qvfb.log
redirect_stderr = true
zalpha314
  • 1,444
  • 4
  • 19
  • 34

2 Answers2

0

You could try wrapping Firefox with a script that runs it with strace. After that, reproduce the problem and search the logs for symptoms, e.g. grep for (stat|open).*EPERM (for the profile access permission denied case).

Segora
  • 1
  • I made a simple test script to run as qauser. Strace didn't seem to return anything useful. http://pastebin.com/SsvHz7F4 – zalpha314 Jul 16 '13 at 18:23
0

I had a similar issue when trying to run Chrome on RHEL and it was due to SELinux. You could try disabling SELinux and then test your setup.

According to this chromium issue, the SELinux bug is fixed in latest Fedora and likely backported to RHEL.

Tom Skunca
  • 21
  • 1