Jenkins HttpRequest插件 - 找不到404

时间:2017-09-20 10:17:55

标签: jenkins proxy get httprequest

我在Jenkins for HTTPRequest插件中找不到404 Gig Request for HTTP。 我正在使用https://httpbin.org/get进行测试。它基本上是一个GET请求调用。

请注意,我的Jenkins正在代理服务器后面运行。我在Manage Jenkins中为jenkins设置了代理 - >管理插件 - >高级选项卡。插件下载工作正常。

请参阅以下jenkins构建控制台的日志:

>

 Building in workspace C:\Users\bcn8cob\.jenkins\workspace\TestWebservice
HttpMethod: GET
URL: https://httpbin.org/get
Sending request to url: https://httpbin.org/get
Treating UnknownHostException(httpbin.org) as 404 Not Found
ERROR: Build step failed with exception
hudson.AbortException: Fail: the returned code 404 is not in the accepted range: [[100?399]]
    at jenkins.plugins.http_request.HttpRequestExecution.responseCodeIsValid(HttpRequestExecution.java:299)
    at jenkins.plugins.http_request.HttpRequestExecution.processResponse(HttpRequestExecution.java:309)
    at jenkins.plugins.http_request.HttpRequestExecution.authAndRequest(HttpRequestExecution.java:225)
    at jenkins.plugins.http_request.HttpRequestExecution.call(HttpRequestExecution.java:191)
Caused: java.lang.IllegalStateException
    at jenkins.plugins.http_request.HttpRequestExecution.call(HttpRequestExecution.java:194)
    at jenkins.plugins.http_request.HttpRequestExecution.call(HttpRequestExecution.java:65)
    at hudson.remoting.LocalChannel.call(LocalChannel.java:45)
    at jenkins.plugins.http_request.HttpRequest.perform(HttpRequest.java:304)
    at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:735)
    at hudson.model.Build$BuildExecution.build(Build.java:206)
    at hudson.model.Build$BuildExecution.doRun(Build.java:163)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:490)
    at hudson.model.Run.execute(Run.java:1735)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:97)
    at hudson.model.Executor.run(Executor.java:405)
Build step 'HTTP Request' marked build as failure
[IBM Cloud DevOps] Not building Deployable Message.
Finished: FAILURE

我是否还需要为HttpRequest插件设置代理?你觉得怎么样?

1 个答案:

答案 0 :(得分:0)

现在支持代理配置,它使用manage-plugin->中的代理设置。进展。

https://github.com/jenkinsci/http-request-plugin/pull/29

但是,仍未考虑无代理或异常,在这种情况下使用curl。