Getting Http 400 error while pushing Jenkins build event to Saas cluster

I am getting 401 Error while pushing the Jenkins event to Saas.The stacktrace is as below:

16:44:25 [INFO] ------------------------------------------------------------------------<br>16:44:25 HttpMethod: POST<br>16:44:25 URL: https://xxxxxxxx.live.dynatrace.com/api/v1/events...<br>16:44:25 Content-type: application/json<br>16:44:25 Accept: application/json<br>16:44:25 Authorization: *****<br>16:44:25 Using authentication: da161e53-ea53-48bd-adb5-fc8da72d461b<br>16:44:25 Sending request to url: https://xxxxxxx.live.dynatrace.com/api/v1/events...<br>16:44:27 Response Code: HTTP/1.1 400 Bad Request<br>16:44:27 ERROR: Build step failed with exception<br>16:44:27 hudson.AbortException: Fail: the returned code 400 is not in the accepted range: [[100?399]]<br>16:44:27       at jenkins.plugins.http_request.HttpRequestExecution.responseCodeIsValid(HttpRequestExecution.java:306)<br>16:44:27       at jenkins.plugins.http_request.HttpRequestExecution.processResponse(HttpRequestExecution.java:316)<br>16:44:27       at jenkins.plugins.http_request.HttpRequestExecution.authAndRequest(HttpRequestExecution.java:232)<br>16:44:27       at jenkins.plugins.http_request.HttpRequestExecution.call(HttpRequestExecution.java:195)<br>16:44:27 Caused: java.lang.IllegalStateException<br>16:44:27       at jenkins.plugins.http_request.HttpRequestExecution.call(HttpRequestExecution.java:198)<br>16:44:27       at jenkins.plugins.http_request.HttpRequestExecution.call(HttpRequestExecution.java:67)<br>16:44:27       at hudson.remoting.LocalChannel.call(LocalChannel.java:45)<br>16:44:27       at jenkins.plugins.http_request.HttpRequest.perform(HttpRequest.java:328)<br>16:44:27       at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)<br>16:44:27       at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)<br>16:44:27       at hudson.model.Build$BuildExecution.build(Build.java:206)<br>16:44:27       at hudson.model.Build$BuildExecution.doRun(Build.java:163)<br>16:44:27       at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)<br>16:44:27       at hudson.model.Run.execute(Run.java:1794)<br>16:44:27       at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)<br>16:44:27       at hudson.model.ResourceController.execute(ResourceController.java:97)<br>16:44:27       at hudson.model.Executor.run(Executor.java:429)<br>16:44:27 Build step 'HTTP Request' marked build as failure<br>16:44:27 [BFA] Scanning build for known causes...<br>16:44:27 [BFA] No failure causes found<br>16:44:27 [BFA] Done. 0s<br>16:44:27 Started calculate disk usage of build<br>16:44:27 Finished Calculation of disk usage of build in 0 seconds<br>16:44:27 Started calculate disk usage of workspace<br>16:44:31 Finished Calculation of disk usage of workspace in  3 second<br>16:44:32 Extended Email Publisher is currently disabled in project settings<br>16:44:32 Finished: FAILURE<br><br>

PFB Plugin configuration in Jenkins.

According to this doc

https://www.dynatrace.com/support/help/dynatrace-a…

you should not configure authorization section, only headers.

Sebastian

Thanks Sebastian.

SaaS Event API works in bidirectional mode. We can use the HTTP GET for Pulling the JSON and consume it for actions.

POST should be used with following setting in Jenkins:

Regards, Rajesh

Event will present on host and process tabs in event tab. You have to select proper timeframe that will cover this event.

Sebastian

Hi Sebastian, I can’t see the event.

You can always try to send the same payload via Postman and check where the problem is. Generally if there was no error this deployment should be visible there.

Sebastian

Hi Sebastian,

What are some cools things we can do with integration?

Thanks,

Rajesh