Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Blocker
    • Resolution: Cannot Reproduce
    • Component/s: http-request-plugin
    • Labels:
    • Environment:
      Jenkins ver. 2.107.3,
      HTTP Request Plugin 1.8.22,
      Docker Base Image FROM jenkins/jenkins:lts
    • Similar Issues:

      Description

      Trying to make a httpRequest to our IssueSystem:

          def responseCreateIssue = httpRequest contentType: 'APPLICATION_JSON', timeout: 30, httpMode: 'POST', requestBody: createIssueRequestBody, url: createIssueUrl
      

      We are getting the following Exception:

      java.lang.SecurityException: Rejected: org.apache.http.HttpHost; see https://jenkins.io/redirect/class-filter/
      at hudson.remoting.ClassFilter.check(ClassFilter.java:76)
      at hudson.remoting.MultiClassLoaderSerializer$Input.resolveClass(MultiClassLoaderSerializer.java:129)
      at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1866)
      at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1749)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2040)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1571)
      at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2285)
      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2209)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2067)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1571)
      at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2285)
      at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:561)
      at java.lang.Throwable.readObject(Throwable.java:914)
      at sun.reflect.GeneratedMethodAccessor32.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1158)
      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2176)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2067)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1571)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:431)
      at hudson.remoting.UserRequest.deserialize(UserRequest.java:277)
      at hudson.remoting.UserResponse.retrieve(UserRequest.java:310)
      at hudson.remoting.Channel.call(Channel.java:952)
      Caused: java.io.IOException: Failed to deserialize response to UserRequest:jenkins.plugins.http_request.HttpRequestExecution@2425b21a
      at hudson.remoting.Channel.call(Channel.java:960)
      at jenkins.plugins.http_request.HttpRequestStep$Execution.run(HttpRequestStep.java:303)
      at jenkins.plugins.http_request.HttpRequestStep$Execution.run(HttpRequestStep.java:285)
      at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
      at hudson.security.ACL.impersonate(ACL.java:290)
      at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      at java.lang.Thread.run(Thread.java:748)

        Attachments

          Activity

          Hide
          oleg_nenashev Oleg Nenashev added a comment -

          I confirm the issue after the quick code review.
          It happens only if proxy is set: https://github.com/jenkinsci/http-request-plugin/blob/733e60a62c1c26ecdd257aa18623f2a0571ad35b/src/main/java/jenkins/plugins/http_request/HttpRequestExecution.java#L73

          There may be other affected fields, needs more review

          Show
          oleg_nenashev Oleg Nenashev added a comment - I confirm the issue after the quick code review. It happens only if proxy is set: https://github.com/jenkinsci/http-request-plugin/blob/733e60a62c1c26ecdd257aa18623f2a0571ad35b/src/main/java/jenkins/plugins/http_request/HttpRequestExecution.java#L73 There may be other affected fields, needs more review
          Hide
          oleg_nenashev Oleg Nenashev added a comment -

          CC Martin d'Anjou as a second maintainer

          Show
          oleg_nenashev Oleg Nenashev added a comment - CC Martin d'Anjou as a second maintainer
          Hide
          janario Janario Oliveira added a comment -

          I was not able to reproduce

          I tried with the versions:

          jenkins

          • lts 2.121.3
          • 2.107.3

          docker run --rm -p 8080:8080 -p 50000:50000 -v $PWD/jenkins_home:/var/jenkins_home jenkins/jenkins:2.107.3

          Http request plugin 1.8.22

          Launched an aws instance to use as a slave

          Created a new job:

          def createIssueUrl = 'https://janario.free.beeceptor.com'
          def createIssueRequestBody = 'body'
           
          node('slave') {
           
            def responseCreateIssue = httpRequest contentType: 'APPLICATION_JSON', timeout: 30, httpMode: 'POST', requestBody: createIssueRequestBody, url: createIssueUrl, httpProxy: 'http://localhost:3128'
          }
          
          

          And no error

          Started by user Started by use Janario Oliveira
          Running in Durability level: MAX_SURVIVABILITY
          [Pipeline] node
          Running on slave in /jenkins-slave/workspace/slave
          [Pipeline] {
          [Pipeline] httpRequest
          HttpMethod: POST
          URL: https://janario.free.beeceptor.com
          Content-type: application/json
          Sending request to url: https://janario.free.beeceptor.com
          Response Code: HTTP/1.1 200 OK
          Success code from [100‥399]
          [Pipeline] }
          [Pipeline] // node
          [Pipeline] echo
          Status: 200
          [Pipeline] End of Pipeline
          Finished: SUCCESS
          

          Klaus Wienert
          Could you give more details on how to reproduce it?

          Show
          janario Janario Oliveira added a comment - I was not able to reproduce I tried with the versions: jenkins lts 2.121.3 2.107.3 docker run --rm -p 8080:8080 -p 50000:50000 -v $PWD/jenkins_home:/var/jenkins_home jenkins/jenkins:2.107.3 Http request plugin 1.8.22 Launched an aws instance to use as a slave Created a new job: def createIssueUrl = 'https: //janario.free.beeceptor.com' def createIssueRequestBody = 'body' node( 'slave' ) { def responseCreateIssue = httpRequest contentType: 'APPLICATION_JSON' , timeout: 30, httpMode: 'POST' , requestBody: createIssueRequestBody, url: createIssueUrl, httpProxy: 'http: //localhost:3128' } And no error Started by user Started by use Janario Oliveira Running in Durability level: MAX_SURVIVABILITY [Pipeline] node Running on slave in /jenkins-slave/workspace/slave [Pipeline] { [Pipeline] httpRequest HttpMethod: POST URL: https://janario.free.beeceptor.com Content-type: application/json Sending request to url: https://janario.free.beeceptor.com Response Code: HTTP/1.1 200 OK Success code from [100‥399] [Pipeline] } [Pipeline] // node [Pipeline] echo Status: 200 [Pipeline] End of Pipeline Finished: SUCCESS Klaus Wienert Could you give more details on how to reproduce it?
          Hide
          turbolift Klaus Wienert added a comment -

          We did not use HTTP request module anymore. But we were either not able to reproduce the problem on our systems. The Exception has been gone.

          def createIssueUrl = 'https://jira-server/jira/rest/api/2/issue'
          def createIssueRequestBody = 'body'
          
          node('linux') {
              def responseCreateIssue = httpRequest contentType: 'APPLICATION_JSON', timeout: 30, httpMode: 'POST', requestBody: createIssueRequestBody, url: createIssueUrl
          }
          
          Started by user Me
          Running in Durability level: MAX_SURVIVABILITY
          [Pipeline] node
          Running on hv-t-lxidac001 in /home/jenkins/agent/workspace/http-request-plugin-test
          [Pipeline] {
          [Pipeline] httpRequest
          HttpMethod: POST
          URL: https://jira-server/jira/rest/api/2/issue
          Content-type: application/json
          Sending request to url: https://jira-server/jira/rest/api/2/issue
          Response Code: HTTP/1.1 400 Bad Request
          [Pipeline] }
          [Pipeline] // node
          [Pipeline] End of Pipeline
          ...
          

          I will close this issue. Thanks for your support.

          Show
          turbolift Klaus Wienert added a comment - We did not use HTTP request module anymore. But we were either not able to reproduce the problem on our systems. The Exception has been gone. def createIssueUrl = 'https: //jira-server/jira/ rest /api/2/issue' def createIssueRequestBody = 'body' node( 'linux' ) { def responseCreateIssue = httpRequest contentType: 'APPLICATION_JSON' , timeout: 30, httpMode: 'POST' , requestBody: createIssueRequestBody, url: createIssueUrl } Started by user Me Running in Durability level: MAX_SURVIVABILITY [Pipeline] node Running on hv-t-lxidac001 in /home/jenkins/agent/workspace/http-request-plugin-test [Pipeline] { [Pipeline] httpRequest HttpMethod: POST URL: https://jira-server/jira/rest/api/2/issue Content-type: application/json Sending request to url: https://jira-server/jira/rest/api/2/issue Response Code: HTTP/1.1 400 Bad Request [Pipeline] } [Pipeline] // node [Pipeline] End of Pipeline ... I will close this issue. Thanks for your support.

            People

            • Assignee:
              janario Janario Oliveira
              Reporter:
              turbolift Klaus Wienert
            • Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: