You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Jenkins environment I run against recently received an update which resulted in the queue IDs returning as random long values instead of sequential integers. As a result, calls to jobsApi().buildWithParameters and attempting to retrieve the queue ID will fail/return null.
Example: url=queue/item/1424517224752202436/
Current Behavior
As a result of the queue ID being returned as a long value, the jenkins-rest api fails (no queue id is returned and attempting to access it results in an error from the json processor).
23-Oct-2023 11:04:37 | Caused by: java.lang.NumberFormatException: Expected an int but was 325127458841757426 at line 1 column 951 path $.items[0].id
23-Oct-2023 11:04:37 | at io.github.cdancy.jenkins.rest.shaded.com.google.gson.stream.JsonReader.nextInt(JsonReader.java:1171) ~[jenkins-rest-1.0.2-all.jar!/:1.0.2]
...snip...
23-Oct-2023 11:04:37 | at io.github.cdancy.jenkins.rest.shaded.com.google.common.reflect.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:86) ~[jenkins-rest-1.0.2-all.jar!/:1.0.2]
23-Oct-2023 11:04:37 | at com.sun.proxy.$Proxy107.queue(Unknown Source) ~[na:na]
Steps to Reproduce (for bugs)
I don't have any insight into how the Jenkins environment I'm running against is configured and I can't control how the queue IDs are returned. Looking at the official API, it appears the queue ID is expected to be a long:
Queue ID is returning from Jenkins as a Long value, not an Integer as expected by the jenkins-rest AP. Due to a recent update which resulted in the queue IDs returning a random long values instead of sequential integers. As a result, calls to jobsApi().buildWithParameters and attempting to retrieve the queue ID will fail/return null.
This PR fixes the JobsApi and QueueApi to deal with the new long values.
Please refer to issue [315](cdancy#315)
amehra
pushed a commit
to amehra/jenkins-rest
that referenced
this issue
Jul 13, 2024
Queue ID retured from Jenkins can be a Long value. This is due to a recent update which resulted in the queue IDs returning a random long values instead of sequential integers. The jenkins-rest API expects this to be an Integer value. As a result, calls to jobsApi().buildWithParameters and then attempting to retrieve the queue ID will fail/return null.
This PR fixes the JobsApi and QueueApi to deal with the new long values.
Please refer to issue [315](cdancy#315)
Expected Behavior
The Jenkins environment I run against recently received an update which resulted in the queue IDs returning as random long values instead of sequential integers. As a result, calls to
jobsApi().buildWithParameters
and attempting to retrieve the queue ID will fail/return null.Example:
url=queue/item/1424517224752202436/
Current Behavior
As a result of the queue ID being returned as a long value, the jenkins-rest api fails (no queue id is returned and attempting to access it results in an error from the json processor).
Steps to Reproduce (for bugs)
I don't have any insight into how the Jenkins environment I'm running against is configured and I can't control how the queue IDs are returned. Looking at the official API, it appears the queue ID is expected to be a long:
https://javadoc.jenkins-ci.org/hudson/model/Queue.Item.html#getId()
Your Environment
Jenkins version 2.414.2
The text was updated successfully, but these errors were encountered: