Unable to determine job for pipeline queue items "waiting for next available executor" using the API

54 views
Skip to first unread message

Rob Williams

unread,
Nov 9, 2017, 2:09:31 PM11/9/17
to Jenkins Users
This is related to this bug in the python api: https://github.com/pycontribs/jenkinsapi/issues/530

I have pipeline jobs which often end up waiting to allocate a node. The queue API displays them like this:

{
 
"_class" : "hudson.model.Queue",
 
"discoverableItems" : [
   
 
],
 
"items" : [
   
{
     
"_class" : "hudson.model.Queue$BuildableItem",
     
"actions" : [
       
{
         
       
}
     
],
     
"blocked" : False,
     
"buildable" : True,
     
"id" : 14555,
     
"inQueueSince" : 1510235372385,
     
"params" : "",
     
"stuck" : False,
     
"task" : {
       
"_class" : "org.jenkinsci.plugins.workflow.support.steps.ExecutorStepExecution$PlaceholderTask"
     
},
     
"url" : "queue/item/14555/",
     
"why" : "Waiting for next available executor on platform-d8-1",
     
"buildableStartMilliseconds" : 1510235372386,
     
"pending" : False
   
},
   
{
     
"_class" : "hudson.model.Queue$BuildableItem",
     
"actions" : [
       
{
         
       
}
     
],
     
"blocked" : False,
     
"buildable" : True,
     
"id" : 14554,
     
"inQueueSince" : 1510235367366,
     
"params" : "",
     
"stuck" : False,
     
"task" : {
       
"_class" : "org.jenkinsci.plugins.workflow.support.steps.ExecutorStepExecution$PlaceholderTask"
     
},
     
"url" : "queue/item/14554/",
     
"why" : "Waiting for next available executor on platform-d8-1",
     
"buildableStartMilliseconds" : 1510235367367,
     
"pending" : False
   
},
   
{
     
"_class" : "hudson.model.Queue$BuildableItem",
     
"actions" : [
       
{
         
       
}
     
],
     
"blocked" : False,
     
"buildable" : True,
     
"id" : 14553,
     
"inQueueSince" : 1510235359789,
     
"params" : "",
     
"stuck" : False,
     
"task" : {
       
"_class" : "org.jenkinsci.plugins.workflow.support.steps.ExecutorStepExecution$PlaceholderTask"
     
},
     
"url" : "queue/item/14553/",
     
"why" : "Waiting for next available executor on platform-d8-1",
     
"buildableStartMilliseconds" : 1510235359813,
     
"pending" : False
   
}
 
]
}

With this information, I'm unable to determine which job they are associated with. The associated contains nothing that I can relate back to these tasks either:


{
 
"_class" : "org.jenkinsci.plugins.workflow.job.WorkflowRun",
 
"actions" : [
   
{
     
"_class" : "hudson.model.CauseAction",
     
"causes" : [
       
{
         
"_class" : "hudson.model.Cause$UpstreamCause",
         
"shortDescription" : "Started by upstream project \"Daily Autorigs\" build number 679",
         
"upstreamBuild" : 679,
         
"upstreamProject" : "Daily Autorigs",
         
"upstreamUrl" : "job/Daily%20Autorigs/"
       
}
     
]
   
},
   
{
     
"_class" : "hudson.model.ParametersAction",
     
"parameters" : [
       
{
         
"_class" : "hudson.model.StringParameterValue",
         
"name" : "PROJECT_NAME",
         
"value" : "cornet"
       
},
       
{
         
"_class" : "hudson.model.StringParameterValue",
         
"name" : "PROJECT_NUMBER",
         
"value" : "3.4650"
       
},
       
{
         
"_class" : "hudson.model.StringParameterValue",
         
"name" : "BUILD_DATE",
         
"value" : "2017-11-09"
       
},
       
{
         
"_class" : "org.jvnet.jenkins.plugins.nodelabelparameter.LabelParameterValue",
         
"name" : "AUTORIG_NODE",
         
"value" : "platform-d8-1"
       
},
       
{
         
"_class" : "hudson.model.StringParameterValue",
         
"name" : "ADMIN_IP",
         
"value" : "172.16.19.146"
       
},
       
{
         
"_class" : "hudson.model.StringParameterValue",
         
"name" : "TEST_IDS_FILE",
         
"value" : ""
       
}
     
]
   
},
   
{
     
   
},
   
{
     
"_class" : "hudson.plugins.mercurial.MercurialTagAction",
     
"mercurialNodeName" : "4ed0350a7c5068177183a90d4f3195198df471a0",
     
"mercurialRevisionBranch" : None,
     
"mercurialRevisionNumber" : "1186",
     
"subdir" : None
   
},
   
{
     
   
},
   
{
     
   
},
   
{
     
"_class" : "org.jenkinsci.plugins.workflow.cps.EnvActionImpl"
   
},
   
{
     
"_class" : "hudson.plugins.mercurial.MercurialTagAction",
     
"mercurialNodeName" : "4ed0350a7c5068177183a90d4f3195198df471a0",
     
"mercurialRevisionBranch" : None,
     
"mercurialRevisionNumber" : "1186",
     
"subdir" : None
   
},
   
{
     
   
},
   
{
     
   
},
   
{
     
   
},
   
{
     
   
},
   
{
     
   
},
   
{
     
"_class" : "org.jenkinsci.plugins.workflow.job.views.FlowGraphAction"
   
},
   
{
     
   
},
   
{
     
   
}
 
],
 
"artifacts" : [
   
 
],
 
"building" : True,
 
"description" : None,
 
"displayName" : "cornet/3.4650:2017-11-09 #39",
 
"duration" : 0,
 
"estimatedDuration" : 12850257,
 
"executor" : {
   
"_class" : "hudson.model.OneOffExecutor"
 
},
 
"fullDisplayName" : "platform-access-control cornet/3.4650:2017-11-09 #39",
 
"id" : "39",
 
"keepLog" : False,
 
"number" : 39,
 
"queueId" : 14449,
 
"result" : None,
 
"timestamp" : 1510222062411,
 
"url" : "http://jenkins.dev.bluearc.com/job/platform-access-control/39/",
  "nextBuild" : None,
 
"previousBuild" : {
   
"number" : 38,
   
"url" : "http://jenkins.dev.bluearc.com/job/platform-access-control/38/"
 
}
}

(I've stripped out the changeSets)

These queue items are displayed as "part of <job name>" so there must be some way to determine a link. It doesn't appear to be exposed by the API. 

Reply all
Reply to author
Forward
0 new messages