I’m running Jenkins on a redhat linux box. My build is a maven 2.2.1 project that contains selenium tests. I’ve got the same setup on a ubuntu box which works fine, but when I attempt to invoke the same top-level maven command on my redhat VM I get the following error.
org.apache.maven.surefire.booter.SurefireExecutionException: Unable to create file for report: /var/lib/jenkins/jobs/selenium/workspace/target/surefire-reports/com.MyComp.bio.PreferencesTest.txt (Permission denied); nested exception is java.io.FileNotFoundException: /var/lib/jenkins/jobs/selenium/workspace/target/surefire-reports/com.MyComp.bio.PreferencesTest.txt (Permission denied); nested exception is
org.apache.maven.surefire.report.ReporterException: Unable to create file for report: /var/lib/jenkins/jobs/selenium/workspace/target/surefire-reports/com.MyComp.bio.PreferencesTest.txt (Permission denied); nested exception is java.io.FileNotFoundException: /var/lib/jenkins/jobs/selenium/workspace/target/surefire-reports/com.MyComp.bio.PreferencesTest.txt (Permission denied)
org.apache.maven.surefire.report.ReporterException: Unable to create file for report: /var/lib/jenkins/jobs/selenium/workspace/target/surefire-reports/com.MyComp.bio.PreferencesTest.txt (Permission denied); nested exception is
java.io.FileNotFoundException: /var/lib/jenkins/jobs/selenium/workspace/target/surefire-reports/com.MyComp.bio.PreferencesTest.txt (Permission denied)
java.io.FileNotFoundException: /var/lib/jenkins/jobs/selenium/workspace/target/surefire-reports/com.MyComp.bio.PreferencesTest.txt (Permission denied)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:212)
at java.io.FileOutputStream.<init>(FileOutputStream.java:165)
at java.io.FileWriter.<init>(FileWriter.java:90)
at org.apache.maven.surefire.report.AbstractFileReporter.testSetStarting(AbstractFileReporter.java:57)
at org.apache.maven.surefire.report.ReporterManager.testSetStarting(ReporterManager.java:219)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:138)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] There are test failures.
In attempting to solve this problem I’ve restart Jenkins
sudo service jenkins restart
but it persists. Anyone run into this before?
Use
ls -alto display permissions of files.See this link for more information.
Read the service startup script to check the name of the user that Jenkins is running as.
less /etc/init.d/jenkinsYou may have manually installed jenkins to a Java EE container such as tomcat6.
If this is the case, you should use:
less /etc/init.d/tomcat6