Details
-
Bug
-
Status: Resolved (View Workflow)
-
Critical
-
Resolution: Fixed
-
Jenkins >= 1.601
Description
Please look at the following comment:
This behavior does not work anymore in Jenkins 1.601.
The queue item URL which is in the location header of the start-build URL returns HTTP status code 404.
Steps to reproduce the problem
Start build via Remote API
The initial request was:
http://myjenkins/job/zzz_dummy_a61d370a3954428a949b87fc3d8f3cf8/build
The HTTP header contains the correct location URL:
HTTP/1.1 201 Created
Date: ...
Server: ...
Location: http://myjenkins/queue/item/68/
Queue object while build is in the queue
That works in all used Jenkins versions.
URL: https://myjenkins:8081/queue/api/json
JSON response:
{ "items": [ { "actions": [ { "causes": [ { "shortDescription": "Started by user XYZ", "userId": "xyz", "userName": "xyz" } ] } ], "blocked": false, "buildable": false, "id": 68, "inQueueSince": 1425545634280, "params": "", "stuck": false, "task": { "name": "zzz_dummy_a61d370a3954428a949b87fc3d8f3cf8", "url": "https://myjenkins:8081/job/zzz_dummy_a61d370a3954428a949b87fc3d8f3cf8/", "color": "notbuilt" }, "url": "queue/item/68/", "why": "In the quiet period. Expires in 4.2 sec", "timestamp": 1425545639280 } ] }
Queue item object while build is in the queue
That does not work anymore in Jenkins 1.601. The following queue item URL is not found (HTTP status code 404).
URL: https://myjenkins:8081/queue/item/68/api/json
JSON response:
{ "actions": [ { "causes": [ { "shortDescription": "Started by user xyz "userId": "xyz", "userName": "xyz" } ] } ], "blocked": false, "buildable": false, "id": 68, "inQueueSince": 1425545634280, "params": "", "stuck": false, "task": { "name": "zzz_dummy_a61d370a3954428a949b87fc3d8f3cf8", "url": "https://myjenkins:8081/job/zzz_dummy_a61d370a3954428a949b87fc3d8f3cf8/", "color": "blue" }, "url": "queue/item/68/", "why": null, "cancelled": false, "executable": { "number": 1, "url": "https://myjenkins:8081/job/zzz_dummy_a61d370a3954428a949b87fc3d8f3cf8/1/" } }
Cause of the issue
The reasons of the problem could be:
- The quiet period parameter is ignored. (In our case in it is 5 seconds by default.) That would mean, that queue item is deleted very fast and could not be requested properly.
- Maybe the queue item URL is not yet created anymore.
Possible Solution
In my opinion the solution would be to make the queue item URL still accessible even if the queue item is deleted. For our build workflow that would be a fine solution.
Or is there any other way to request finished queue items?
Goal
Our goal is to track a Jenkins build via external tools. So if there is another way to safely track a started build, please let me know.
Code changed in jenkins
User: tfennelly
Path:
changelog.html
cli/pom.xml
core/pom.xml
core/src/main/java/hudson/model/AbstractItem.java
debian/debian/changelog
plugins/pom.xml
pom.xml
test/pom.xml
war/pom.xml
http://jenkins-ci.org/commit/jenkins/7e5063937c31ee33de29254f1f13f5d4aa0d6174
Log:
Merge branch 'master' into
JENKINS-27256Updated changelog
updated changelog as a part of the release
[maven-release-plugin] prepare for next development iteration
[maven-release-plugin] prepare release jenkins-1.604
Noting #1597
Noting #1593, #1579, move
JENKINS-22346, #1558Remove two fixes that were backported to RC
JENKINS-27183Avoid deadlock when using build-monitor-plugin