Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-23235

buildWithParameters does not return queue location

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • core
    • Jenkins 1.559
      CentOS 6.4
      Java(TM) SE Runtime Environment (build 1.7.0_25-b15)

      When creating builds using /build, the result is a 201 response where the Location header points to the queue item that represents the new build. Example:

      curl -X POST -v "http://jenkins.mycompany.com/job/test-job/build"
      * Adding handle: conn: 0xf28b90
      * Adding handle: send: 0
      * Adding handle: recv: 0
      * Curl_addHandleToPipeline: length: 1
      * - Conn 0 (0xf28b90) send_pipe: 1, recv_pipe: 0
      * About to connect() to jenkins.mycompany.com port 80 (#0)
      *   Trying 10.10.10.10...
      * Connected to jenkins.mycompany.com (10.10.10.10) port 80 (#0)
      > POST /job/test-job/build HTTP/1.1
      > User-Agent: curl/7.32.0
      > Host: jenkins.mycompany.com
      > Accept: */*
      > 
      < HTTP/1.1 201 Created
      < Date: Thu, 29 May 2014 16:38:29 GMT
      * Server Jetty(8.y.z-SNAPSHOT) is not blacklisted
      < Server: Jetty(8.y.z-SNAPSHOT)
      < Location: http://jenkins.mycompany.com/queue/item/3901/
      < Content-Length: 0
      < Connection: close
      < Content-Type: text/plain; charset=UTF-8
      < 
      * Closing connection 0
      

      For parameterized builds we must use /buildWithParameters instead, however the response from /buildWithParameters does not contain the queue location:

      $ curl -X POST -v "http://jenkins.mycompany.com/job/parameterized-test-job/buildWithParameters"
      * Adding handle: conn: 0xa63c30
      * Adding handle: send: 0
      * Adding handle: recv: 0
      * Curl_addHandleToPipeline: length: 1
      * - Conn 0 (0xa63c30) send_pipe: 1, recv_pipe: 0
      * About to connect() to jenkins.mycompany.com port 80 (#0)
      *   Trying 10.10.10.10...
      * Connected to jenkins.mycompany.com (10.10.10.10) port 80 (#0)
      > POST /job/parameterized-test-job/buildWithParameters HTTP/1.1
      > User-Agent: curl/7.32.0
      > Host: jenkins.mycompany.com
      > Accept: */*
      > 
      < HTTP/1.1 302 Found
      < Date: Thu, 29 May 2014 16:41:09 GMT
      * Server Jetty(8.y.z-SNAPSHOT) is not blacklisted
      < Server: Jetty(8.y.z-SNAPSHOT)
      < Location: http://jenkins.mycompany.com/job/parameterized-test-job/
      < Content-Length: 0
      < Connection: close
      < Content-Type: text/plain; charset=UTF-8
      < 
      * Closing connection 0
      

      The expected response to this request is a 201 with the Location header containing the URL of a queue item (exactly what /build does).

            Unassigned Unassigned
            joelittlejohn Joe Littlejohn
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: