saucelabs / ci-sauce

A project where shared logic between our Java based CI plugins (Jenkins, Bamboo) is kept
Apache License 2.0
15 stars 22 forks source link

Jenkins/Sauce Connect on windows yields NullPointerException #12

Closed thiagoalves closed 9 years ago

thiagoalves commented 9 years ago

I configured the Jenkins plugin following the instructions on:

https://docs.saucelabs.com/ci-integrations/jenkins/#configuring-the-jenkins-sauce-ondemand-plugin

When I configure and run a project, I get:

Starting pre-build for Sauce Labs plugin Starting Sauce Connect on master node using identifier: default Launching Sauce Connect on dev-nirvana FATAL: null java.lang.NullPointerException at java.io.File.(Unknown Source) at >com.saucelabs.ci.sauceconnect.SauceConnectFourManager.getSauceConnectLogFile(SauceConnectFourManager.java:347) at com.saucelabs.ci.sauceconnect.AbstractSauceTunnelManager.openConnection(AbstractSauceTunnelManager.java:352)

After inspecting the source code, I found this line:

private static final String WINDOWS_TEMP_DIR = System.getProperty("java.io.tempdir"); (com/saucelabs/ci/sauceconnect/SauceConnectFourManager.java:127)

When I go to Jenkins Script Console, there's no java.io.tempdir property, only java.io.tmpdir.

To validate it, I ran jenkins setting java.io.tempdir, and it works:

java -jar -Djava.io.tempdir=C:\Temp jenkins.war

I suspect this an error in the source code, because when I search for "java.io.tmpdir" in Google I get 174,000 results, and only 956 results for "java.io.tempdir". Can you confirm whether this is a bug or not? Thanks

rossrowe commented 9 years ago

Thanks for letting me know, I'll include a fix for this in the next version of the Jenkins plugin

On Fri, Jul 31, 2015 at 7:25 AM, Thiago Alves notifications@github.com wrote:

I configured the Jenkins plugin following the instructions on:

https://docs.saucelabs.com/ci-integrations/jenkins/#configuring-the-jenkins-sauce-ondemand-plugin

When I configure and run a project, I get:

Starting pre-build for Sauce Labs plugin Starting Sauce Connect on master node using identifier: default Launching Sauce Connect on dev-nirvana FATAL: null java.lang.NullPointerException at java.io.File.(Unknown Source) at

com.saucelabs.ci.sauceconnect.SauceConnectFourManager.getSauceConnectLogFile(SauceConnectFourManager.java:347) at com.saucelabs.ci.sauceconnect.AbstractSauceTunnelManager.openConnection(AbstractSauceTunnelManager.java:352)

After inspecting the source code, I found this line:

private static final String WINDOWS_TEMP_DIR = System.getProperty("java.io.tempdir"); (com/saucelabs/ci/sauceconnect/SauceConnectFourManager.java:127)

When I go to Jenkins Script Console, there's no java.io.tempdir property, only java.io.tmpdir.

To validate it, I ran jenkins setting java.io.tempdir, and it works:

java -jar -Djava.io.tempdir=C:\Temp jenkins.war

I suspect this an error in the source code, because when I search for "java.io.tmpdir" in Google I get 174,000 results, and only 956 results for "java.io.tempdir". Can you confirm whether this is a bug or not? Thanks

— Reply to this email directly or view it on GitHub https://github.com/saucelabs/ci-sauce/issues/12.

renatoch commented 9 years ago

@rossrowe Hey Ross, any idea when the next version will be available? I need this fix as well. Cheers!

rossrowe commented 9 years ago

@rnatoch Can you tell me what plugin you're using? The fix should've been included in version 1.137 of the Sauce Jenkins plugin.

renatoch commented 9 years ago

Hey Ross,

I didn't realize there was already a new version, I was looking at the changelog and latest was 1.134, so I assumed it was the latest release.

I'll install and let you know. Thanks!

renatoch commented 9 years ago

Hey Ross, it worked great! Thanks!