Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-51776

com.google.inject.CreationException with Sauce OnDemand Plugin 1.175 and later

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: sauce-ondemand-plugin
    • Labels:
      None
    • Environment:
      Jenkins 2.237
      Sauce OnDemand 1.188
    • Similar Issues:

      Description

      Hey there

      When upgrading from 1.174 to 1.175 or 1.176, we face the following issue when running pipelines that make use of the sauceconnect step:

      hudson.remoting.ProxyException: com.google.inject.CreationException: Unable to create injector, see the following errors:
      1) A just-in-time binding to com.saucelabs.jenkins.pipeline.SauceConnectStep was already configured on a parent injector.
        at org.jenkinsci.plugins.workflow.steps.ContextParameterModule.configure(ContextParameterModule.java:45)
      

      The same pipelines work flawlessly with 1.174 (hence we're sticking to that version for now).

        Attachments

          Activity

          Hide
          halkeye Gavin Mogan added a comment -

          please don't tag people randomly. I havn't been at sauce labs in over 4 years.

          Contact their support and escalate it directly with them. Mention you've had trouble getting in contact with people and they should update the docs to reflect how to report issues (it no longer has to be this jira)

          Show
          halkeye Gavin Mogan added a comment - please don't tag people randomly. I havn't been at sauce labs in over 4 years. Contact their support and escalate it directly with them. Mention you've had trouble getting in contact with people and they should update the docs to reflect how to report issues (it no longer has to be this jira)
          Hide
          agauthiez Alexis Gauthiez added a comment -

          I can still reproduce the issue today with Jenkins 2.254 and Sauce OnDemand plugin 1.192 and I have came up with a scenario to reproduce:

          1. Launch a Jenkins build using the following Jenkins pipeline:
            pipeline {
                agent any
                stages {
                    stage('Test')  {
                        steps {
                            sauce('sauce-labs') {
                                sauceconnect(useGeneratedTunnelIdentifier: true, verboseLogging: true) {
                                    sleep 60
                                }   
                            }
                        }
                    }
                }
            }
            
          2. Wait for the build to reach the sleep step
          3. While Jenkins executes the sleep step for a minute, restart Jenkins using <your Jenkins instance URL>/restart
          4. Wait for Jenkins to be ready
          5. Launch a Jenkins build using the same pipeline as 1.
          6. Notice it fails with the aforementioned exception

          The only known workaround is to restart the impacted Jenkins instance again. I believe it should be fairly easy to fix as other Jenkins plugins had similar issues (e.g. GitLab's: https://github.com/jenkinsci/gitlab-plugin/pull/622).

          Show
          agauthiez Alexis Gauthiez added a comment - I can still reproduce the issue today with Jenkins 2.254 and Sauce OnDemand plugin 1.192 and I have came up with a scenario to reproduce: Launch a Jenkins build using the following Jenkins pipeline: pipeline { agent any stages { stage( 'Test' ) { steps { sauce( 'sauce-labs' ) { sauceconnect(useGeneratedTunnelIdentifier: true , verboseLogging: true ) { sleep 60 } } } } } } Wait for the build to reach the sleep step While Jenkins executes the sleep step for a minute, restart Jenkins using <your Jenkins instance URL>/restart Wait for Jenkins to be ready Launch a Jenkins build using the same pipeline as 1. Notice it fails with the aforementioned exception The only known workaround is to restart the impacted Jenkins instance again. I believe it should be fairly easy to fix as other Jenkins plugins had similar issues (e.g. GitLab's: https://github.com/jenkinsci/gitlab-plugin/pull/622 ).
          Hide
          agauthiez Alexis Gauthiez added a comment -

          I have escalated the issue to Sauce Labs support. I have been informed it's tracked on their side (internal reference PERF-2361) and that they have no ETA for a fix. I'll keep you updated here as I have more information.

          Show
          agauthiez Alexis Gauthiez added a comment - I have escalated the issue to Sauce Labs support. I have been informed it's tracked on their side (internal reference PERF-2361) and that they have no ETA for a fix. I'll keep you updated here as I have more information.
          Hide
          agauthiez Alexis Gauthiez added a comment -

          I found an extra workaround for this: set

          options { disableResume() }

          on pipelines. It prevents pipelines from resuming after Jenkins' master restart. As a result, builds for jobs that are configured as such do fail if they were pending when Jenkins restarts, with the following logs:

          Failing build: shutting down master and build is marked to not resume
          Terminating sleep
          [Pipeline] }
          Decremented process count for Test-1603098080631, now 0
          Flushing Sauce Connect Input Stream
          Flushing Sauce Connect Error Stream
          Closing Sauce Connect process
          Sauce Connect stopped for: Test-1603098080631
          Resuming build at Mon Oct 19 11:02:12 CEST 2020 after Jenkins restart
          [Pipeline] End of Pipeline
          java.lang.IllegalStateException: JENKINS-50407: no loaded shell in CpsFlowExecution[Owner[Test/16:Test #16]]
          

          Build right after this and it succeeds.

          Show
          agauthiez Alexis Gauthiez added a comment - I found an extra workaround for this: set options { disableResume() } on pipelines. It prevents pipelines from resuming after Jenkins' master restart. As a result, builds for jobs that are configured as such do fail if they were pending when Jenkins restarts, with the following logs: Failing build: shutting down master and build is marked to not resume Terminating sleep [Pipeline] } Decremented process count for Test-1603098080631, now 0 Flushing Sauce Connect Input Stream Flushing Sauce Connect Error Stream Closing Sauce Connect process Sauce Connect stopped for : Test-1603098080631 Resuming build at Mon Oct 19 11:02:12 CEST 2020 after Jenkins restart [Pipeline] End of Pipeline java.lang.IllegalStateException: JENKINS-50407: no loaded shell in CpsFlowExecution[Owner[Test/16:Test #16]] Build right after this and it succeeds.
          Hide
          timja Tim Jacomb added a comment -

          Alexis Gauthiez I've created a PR at https://github.com/jenkinsci/sauce-ondemand-plugin/pull/83, this has plagued us for years and it was quite an easy small fix.

          Show
          timja Tim Jacomb added a comment - Alexis Gauthiez I've created a PR at https://github.com/jenkinsci/sauce-ondemand-plugin/pull/83 , this has plagued us for years and it was quite an easy small fix.

            People

            Assignee:
            timja Tim Jacomb
            Reporter:
            agauthiez Alexis Gauthiez
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: