sauce-java icon indicating copy to clipboard operation
sauce-java copied to clipboard

UNable to delete PID file causes subsequent invocations to fail until file is manually deleted.

Open eddiewebb opened this issue 8 years ago • 1 comments

  1. Create project that uses this plugin for integration tests with pre & post phase bindings
  2. Run the "integration-test" multiple times (i..e mvn clean integration-test -DtestGroup=A && mvn clean integration-test -DtestGroup=B)
  3. Watch as all subseqnet tests will fail when trying to open the tunnel (previous invocation did not properly shutdown tunnel because post-integration-test is never reached, but I would still expect the process to be able to recover by purging old pid and starting new, or leveraging existing tunnel)

In any case, the error is not helpful

Exception occurred retrieving tunnel information org.json.JSONException: JSONObject["tunnel_identifier"] not a string.

[INFO] --- sauce-connect-plugin:2.1.23:start-sauceconnect (start-sauceconnct) @ statuspage-banner-atlassian-server --- [INFO] Starting Sauce Connect May 03, 2017 5:44:56 PM com.saucelabs.ci.sauceconnect.AbstractSauceTunnelManager activeTunnelIdentifier WARNING: Exception occurred retrieving tunnel information org.json.JSONException: JSONObject["tunnel_identifier"] not a string. at org.json.JSONObject.getString(JSONObject.java:721) at com.saucelabs.ci.sauceconnect.AbstractSauceTunnelManager.activeTunnelIdentifier(AbstractSauceTunnelManager.java:440) at com.saucelabs.ci.sauceconnect.AbstractSauceTunnelManager.openConnection(AbstractSauceTunnelManager.java:289) at com.saucelabs.maven.StartSauceConnectMojo.execute(StartSauceConnectMojo.java:73) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:108) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213) at org.apache.maven.cli.MavenCli.main(MavenCli.java:157) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) May 03, 2017 5:44:56 PM com.saucelabs.ci.sauceconnect.AbstractSauceTunnelManager logMessage INFO: /root/sc-4.4.2-linux/bin/sc already exists, so not extracting May 03, 2017 5:44:56 PM com.saucelabs.ci.sauceconnect.SauceConnectFourManager prepAndCreateProcess INFO: Launching Sauce Connect 4.4.2 [/root/sc-4.4.2-linux/bin/sc, -u, eddiewebb, -k, 1e242a24-66c9-4326-8bcd-f917dad39073, -P, 4445] 3 May 17:44:56 - Sauce Connect 4.4.2, build 3154 c8dd102-dirty 3 May 17:44:56 - Using CA certificate bundle /etc/ssl/certs/ca-certificates.crt. 3 May 17:44:56 - Using CA certificate verify path /etc/ssl/certs. May 03, 2017 5:44:56 PM com.saucelabs.ci.sauceconnect.AbstractSauceTunnelManager$StreamGobbler processLine INFO: 3 May 17:44:56 - Sauce Connect 4.4.2, build 3154 c8dd102-dirty May 03, 2017 5:44:56 PM com.saucelabs.ci.sauceconnect.AbstractSauceTunnelManager$StreamGobbler processLine INFO: 3 May 17:44:56 - Using CA certificate bundle /etc/ssl/certs/ca-certificates.crt. 3 May 17:44:56 - Error creating pidfile /tmp/sc_client.pid. May 03, 2017 5:44:56 PM com.saucelabs.ci.sauceconnect.AbstractSauceTunnelManager$StreamGobbler processLine INFO: 3 May 17:44:56 - Using CA certificate verify path /etc/ssl/certs. May 03, 2017 5:44:56 PM com.saucelabs.ci.sauceconnect.AbstractSauceTunnelManager$StreamGobbler processLine INFO: 3 May 17:44:56 - Error creating pidfile /tmp/sc_client.pid. May 03, 2017 5:44:56 PM com.saucelabs.ci.sauceconnect.AbstractSauceTunnelManager$StreamGobbler processLine INFO: ERROR: can't lock pidfile /tmp/sc_client.pid. ERROR: can't lock pidfile /tmp/sc_client.pid. May 03, 2017 5:44:56 PM com.saucelabs.ci.sauceconnect.AbstractSauceTunnelManager logMessage INFO: Sauce Connect can't lock pidfile, attempting to close open Sauce Connect processes [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 15.692 s [INFO] Finished at: 2017-05-03T17:44:56+00:00 [INFO] Final Memory: 61M/475M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal com.saucelabs.maven.plugin:sauce-connect-plugin:2.1.23:start-sauceconnect (start-sauceconnct) on project statuspage-banner-atlassian-server: Execution start-sauceconnct of goal com.saucelabs.maven.plugin:sauce-connect-plugin:2.1.23:start-sauceconnect failed. NullPointerException -> [Help 1] [ERROR]

eddiewebb avatar May 03 '17 17:05 eddiewebb

@mehmetg I actually created a new issue as my problem occurs when I know the tunnel is not shutdown. So not the same as #39

But here's the full source, https://bitbucket.org/eddiewebb/statuspage-banner-atlassian-server/src

I think using mvn verify instead of mvn integration-test is ensuring the shutdown is called. But still think error message and recovery could be better regarding the pid file.

https://bitbucket.org/eddiewebb/statuspage-banner-atlassian-server/addon/pipelines/home#!/results/%7Ba2a74f01-f689-4f92-8021-c568f1a9f51a%7D

eddiewebb avatar May 03 '17 20:05 eddiewebb