Jump to content
Changes to the Jaspersoft community edition download ×

PhantomJS - Unable to open file '/phantomjsdriver.log'


bcook_1

Recommended Posts

Have installed JRS 6.2.1 to start planning for upgrade. One new feature is the ability to export dashboards to an output file....but requires installing the phantom JS libraries. I have installed these on the linux server and updated the js.config.properties file for JRS. I can see the phantomjs libraries getting called in the logs when I attempt to export but then it throws an error about being unable to open the phantomjsdriver.log. Has anyone else encountered this issue and know how to get around the error? 

May 26, 2016 2:20:16 PM org.apache.tomcat.util.http.Parameters processParameters
WARNING: Parameters: Invalid chunk '' ignored.
May 26, 2016 2:23:35 PM org.openqa.selenium.phantomjs.PhantomJSDriverService <init>
INFO: executable: /usr/local/bin/phantomjs
May 26, 2016 2:23:35 PM org.openqa.selenium.phantomjs.PhantomJSDriverService <init>
INFO: port: 9619
May 26, 2016 2:23:35 PM org.openqa.selenium.phantomjs.PhantomJSDriverService <init>
INFO: arguments: [--ssl-protocol=any, --ignore-ssl-errors=true, --disk-cache=true, --local-to-remote-url-access=true, --load-images=true, --webdriver=9619, --webdriver-logfile=/phantomjsdriver.log]
May 26, 2016 2:23:35 PM org.openqa.selenium.phantomjs.PhantomJSDriverService <init>
INFO: environment: {}
Unable to open file '/phantomjsdriver.log'

  phantomjs://platform/fs.js:79 in open
  phantomjs://platform/logger.js:95 in addLogFile
  phantomjs://platform/config.js:76 in apply
  phantomjs://platform/config.js:98 in init

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

I hadn't read that particular post from StackOverflow. Just wondering which user needs the write permissions? Jasper was installed and runs as user Tomcat whereas we installed the PhantomJS as root. Since Jasper is calling the PhantomJS would it be the tomcat user that needs wtire permissions and to the directory where the logs is getting written to?

Link to comment
Share on other sites

  • 2 months later...

Having the same trouble here. Running as root per the SO post is not an option and is an inappropriate solution for a production system. I would not even suggest this to our devops. The issue is with PhantomJS and its default log location being the file system root.

There is an option for phantomjs '--webdriver-logfile' which might be used to set the logfile location, but this would need to be done in the JRS code calling it.

Tried a couple ways to pass this:
- adding the arg in applicationContext-pro-remote-services.xml: <property name="phantomExec" value="${phantomjs.binary:} --webdriver-logfile=/tmp/phantomjsdriver.log"/>
- adding the option in js.config.properties: phantomjs.binary='/usr/bin/phatomjs --webdriver-logfile=/tmp/phantomjsdriver.log'

EDIT: both tries above cause it to fail immediately as an invalid path to phantomjs

Has anyone solved this without running tomcat as root?

UPDATE: Able to work around this by creating the logfile at /phantomjsdriver.log and making tomcat owner. It now writes to the log. It is rather verbose and it is really a pain to not have this located in a proper logs directory.

However, the export is empty when trying to export the dashboard. It works to export an individual chart. UPDATE: Solution to this is to set deploy.base.local.url in js.config.properties right below phantomjs.binary

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...