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

java.lang.InterruptedException: sleep interrupted

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Not A Defect
    • Labels:
      None
    • Environment:
    • Similar Issues:

      Description

      I sometimes get the below error from the anchore plugin. The anchore server doesn't report any errors and says the image is analyzed. 

      {{15:13:42 2018-08-09T15:13:42.918 INFO AnchoreWorker Jenkins version: 2.125
      15:13:42 2018-08-09T15:13:42.918 INFO AnchoreWorker Anchore Container Image Scanner Plugin version: 1.0.17
      15:13:42 2018-08-09T15:13:42.918 INFO AnchoreWorker [global] debug: false
      15:13:42 2018-08-09T15:13:42.918 INFO AnchoreWorker [global] enginemode: anchoreengine
      15:13:42 2018-08-09T15:13:42.918 INFO AnchoreWorker [build] engineurl: http://anchore.platform.vivint.com/v1
      15:13:42 2018-08-09T15:13:42.918 INFO AnchoreWorker [build] engineuser: admin
      15:13:42 2018-08-09T15:13:42.918 INFO AnchoreWorker [build] enginepass: ****
      15:13:42 2018-08-09T15:13:42.919 INFO AnchoreWorker [build] engineverify: false
      15:13:42 2018-08-09T15:13:42.919 INFO AnchoreWorker [build] name: anchore_images
      15:13:42 2018-08-09T15:13:42.919 INFO AnchoreWorker [build] engineRetries: 1000
      15:13:42 2018-08-09T15:13:42.919 INFO AnchoreWorker [build] policyBundleId:
      15:13:42 2018-08-09T15:13:42.919 INFO AnchoreWorker [build] bailOnFail: true
      15:13:42 2018-08-09T15:13:42.919 INFO AnchoreWorker [build] bailOnPluginFail: true
      15:13:42 2018-08-09T15:13:42.926 INFO AnchoreWorker Submitting tp-registry.vivint.com:5005/test/vivint-base-prod:2.feature-pl-6145-xconfig-65bd876 for analysis
      15:13:43 2018-08-09T15:13:43.696 INFO AnchoreWorker Analysis request accepted, received image digest sha256:9a1ee582d150bbd9f1b0338e04f9f439e671d1c8fbe10039e2e2d7b35734a17b
      15:13:43 2018-08-09T15:13:43.697 INFO AnchoreWorker Waiting for analysis of tp-registry.vivint.com:5005/test/vivint-base-prod:2.feature-pl-6145-xconfig-65bd876, polling status periodically
      15:14:45 2018-08-09T15:14:45.465 ERROR AnchoreWorker Failed to execute anchore-engine policy evaluation due to an unexpected error
      15:14:45 java.lang.InterruptedException: sleep interrupted
      15:14:45 at java.lang.Thread.sleep(Native Method)
      15:14:45 at com.anchore.jenkins.plugins.anchore.BuildWorker.runGatesEngine(BuildWorker.java:395)
      15:14:45 at com.anchore.jenkins.plugins.anchore.BuildWorker.runGates(BuildWorker.java:343)
      15:14:45 at com.anchore.jenkins.plugins.anchore.AnchoreBuilder.perform(AnchoreBuilder.java:338)
      15:14:45 at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:80)
      15:14:45 at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:67)
      15:14:45 at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1$1.call(SynchronousNonBlockingStepExecution.java:50)
      15:14:45 at hudson.security.ACL.impersonate(ACL.java:290)
      15:14:45 at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1.run(SynchronousNonBlockingStepExecution.java:47)
      15:14:45 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      15:14:45 at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      15:14:45 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      15:14:45 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      15:14:45 at java.lang.Thread.run(Thread.java:745)
      15:14:45 2018-08-09T15:14:45.465 ERROR AnchorePlugin Failing Anchore Container Image Scanner Plugin step due to errors in plugin execution
      15:14:45 hudson.AbortException: Failed to execute anchore-engine policy evaluation due to an unexpected error. Please refer to above logs for more information
      15:14:45 at com.anchore.jenkins.plugins.anchore.BuildWorker.runGatesEngine(BuildWorker.java:508)
      15:14:45 at com.anchore.jenkins.plugins.anchore.BuildWorker.runGates(BuildWorker.java:343)
      15:14:45 at com.anchore.jenkins.plugins.anchore.AnchoreBuilder.perform(AnchoreBuilder.java:338)
      15:14:45 at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:80)
      15:14:45 at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:67)
      15:14:45 at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1$1.call(SynchronousNonBlockingStepExecution.java:50)
      15:14:45 at hudson.security.ACL.impersonate(ACL.java:290)
      15:14:45 at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1.run(SynchronousNonBlockingStepExecution.java:47)
      15:14:45 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      15:14:45 at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      15:14:45 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      15:14:45 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      15:14:45 at java.lang.Thread.run(Thread.java:745)
      15:14:45 2018-08-09T15:14:45.467 INFO AnchorePlugin Completed Anchore Container Image Scanner step}}

        Attachments

          Activity

          Hide
          swathigangisetty Swathi Gangisetty added a comment -

          Ben Mathews, how is the anchore plugin invoked? And how often do you notice this failure? From the stack trace it looks like the thread executing the plugin was interrupted. I'm not sure by what at this point but some context around how the plugin was invoked might help dig into it. 

          Show
          swathigangisetty Swathi Gangisetty added a comment - Ben Mathews , how is the anchore plugin invoked? And how often do you notice this failure? From the stack trace it looks like the thread executing the plugin was interrupted. I'm not sure by what at this point but some context around how the plugin was invoked might help dig into it. 
          Hide
          benm Ben Mathews added a comment -

          Most of the time the scan works. I'd hesitate to give a percentage, but say 90-95% of the time it works. The plugin is called from a Jenkinsfile that looks like this. Lots of stuff cut out, but hopefully this is the pertinant parts. 

          #!groovy

          timestamps {
          stage('build images')

          Unknown macro: { //build stuff }

          stage('unit tests, rpm building, check for upgrades') {
          builders = [:]
          builders['unit-tests'] =

          Unknown macro: { node(vivdocker.build_node())Unknown macro}

          }

          builders['rpms'] =

          Unknown macro: { node(vivdocker.build_node())Unknown macro}

          }

          builders['upgrades'] =

          Unknown macro: { node(vivdocker.build_node())Unknown macro}

          }

          builders['anchore-verification'] = {
          node(vivdocker.build_node())

          Unknown macro: { tryUnknown macro}

          catch (e)
          Unknown macro: { notifyBuildFailure() throw e }
          }
          }

          builders['failFast'] = true

          parallel builders
          }
          }

          Show
          benm Ben Mathews added a comment - Most of the time the scan works. I'd hesitate to give a percentage, but say 90-95% of the time it works. The plugin is called from a Jenkinsfile that looks like this. Lots of stuff cut out, but hopefully this is the pertinant parts.  #!groovy timestamps { stage('build images') Unknown macro: { //build stuff } stage('unit tests, rpm building, check for upgrades') { builders = [:] builders ['unit-tests'] = Unknown macro: { node(vivdocker.build_node())Unknown macro} } builders ['rpms'] = Unknown macro: { node(vivdocker.build_node())Unknown macro} } builders ['upgrades'] = Unknown macro: { node(vivdocker.build_node())Unknown macro} } builders ['anchore-verification'] = { node(vivdocker.build_node()) Unknown macro: { tryUnknown macro} catch (e) Unknown macro: { notifyBuildFailure() throw e } } } builders ['failFast'] = true parallel builders } }
          Hide
          swathigangisetty Swathi Gangisetty added a comment -

          I think failFast aborts all parallel stages when one of them reports a failure. Is there any chance a different stage has failed for some reason and caused the in-progress anchore-verification stage to abort? Console log for the pipeline build (not the anchore plugin) will probably contain more information about stage interrupts and the extraneous cause if any. Look for something like "Sending interrupt signal to process" and the logs around that. 

          Show
          swathigangisetty Swathi Gangisetty added a comment - I think failFast aborts all parallel stages when one of them reports a failure. Is there any chance a different stage has failed for some reason and caused the in-progress anchore-verification stage to abort? Console log for the pipeline build (not the anchore plugin) will probably contain more information about stage interrupts and the extraneous cause if any. Look for something like "Sending interrupt signal to process" and the logs around that. 
          Hide
          benm Ben Mathews added a comment -

          No, it is definitely anchore that is failing. The other parallel sections will have a message like this.
          Sending interrupt signal to process
          sh: line 1: 25850 Terminated
           

          Show
          benm Ben Mathews added a comment - No, it is definitely anchore that is failing. The other parallel sections will have a message like this. Sending interrupt signal to process sh: line 1: 25850 Terminated  
          Hide
          swathigangisetty Swathi Gangisetty added a comment -

          You are right about the anchore stage failing. Anchore plugin logs indicate that the plugin received an interrupt signal and bailed. I'm trying to figure out what/who triggered this interrupt signal in the first place. It sounds like you've ruled out another stage failing and triggering the interrupt. Another potential for termination would be a timeout if its enforced on the anchore plugin stage. I would need to look through the build console logs to investigate this further

          Show
          swathigangisetty Swathi Gangisetty added a comment - You are right about the anchore stage failing. Anchore plugin logs indicate that the plugin received an interrupt signal and bailed. I'm trying to figure out what/who triggered this interrupt signal in the first place. It sounds like you've ruled out another stage failing and triggering the interrupt. Another potential for termination would be a timeout if its enforced on the anchore plugin stage. I would need to look through the build console logs to investigate this further
          Hide
          swathigangisetty Swathi Gangisetty added a comment -

          Closing issue due to inactivity. Can be reopened if the user responds back to the last comment

          Show
          swathigangisetty Swathi Gangisetty added a comment - Closing issue due to inactivity. Can be reopened if the user responds back to the last comment

            People

            Assignee:
            swathigangisetty Swathi Gangisetty
            Reporter:
            benm Ben Mathews
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: