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
What Operating System are you using (both controller, and any agents involved in the problem)?
Ubuntu 22.04
Reproduction steps
Instantiate a JenkinsServer (default config, just URL, username and api token)
Obtain a JobWithDetails by name
Starting a build with parameters (job.build(parameters) ) three time in a row, with the same parameters
Expected Results
Three different builds, or a single build, but no errors
Actual Results
A HttpResponseException in the HttpResponseValidator, caused by a 404 Not Found, caused by following the Location header of the second or third consecutive build call.
Anything else?
The first call returns always a 200-something code, the second or the third returns a 303 with a queue item url in the Location header. The backing HTTP client follows the Location url, that is invalid because it has no /api/json suffix.
After disabling the redirect handling in the HTTP client, the result is a single build, without any exception. The QueueReferenceinstances returned by the three calls to .build have the same queueItem value.
This is my workaround. I think that this should be the default configuration for the HttpClient, as the Location header in the 303 response is not a valid redirect location.
this.jenkinsServer = new JenkinsServer(
new JenkinsHttpClient(
new URI(jenkinsProperties.getUrl()),
HttpClientBuilder.create().disableRedirectHandling(),
jenkinsProperties.getUsername(),
jenkinsProperties.getPassword()
)
);
The text was updated successfully, but these errors were encountered:
Jenkins and plugins versions report
Environment
What Operating System are you using (both controller, and any agents involved in the problem)?
Ubuntu 22.04
Reproduction steps
JenkinsServer
(default config, just URL, username and api token)JobWithDetails
by namejob.build(parameters)
) three time in a row, with the same parametersExpected Results
Three different builds, or a single build, but no errors
Actual Results
A
HttpResponseException
in theHttpResponseValidator
, caused by a 404 Not Found, caused by following the Location header of the second or third consecutivebuild
call.Anything else?
The first call returns always a 200-something code, the second or the third returns a 303 with a queue item url in the Location header. The backing HTTP client follows the Location url, that is invalid because it has no /api/json suffix.
After disabling the redirect handling in the HTTP client, the result is a single build, without any exception. The
QueueReference
instances returned by the three calls to.build
have the same queueItem value.This is my workaround. I think that this should be the default configuration for the HttpClient, as the Location header in the 303 response is not a valid redirect location.
The text was updated successfully, but these errors were encountered: