cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

rswarnka
Helper

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

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

PFB Plugin configuration in Jenkins.

 

6 REPLIES 6

skrystosik
DynaMight Guru
DynaMight Guru

According to this doc

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

you should not configure authorization section, only headers.

Sebastian


Regards, Sebastian

Hi Sebastian,

What are some cools things we can do with integration?

Thanks,

Rajesh


rswarnka
Helper

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


Regards, 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


Regards, Sebastian

Featured Posts