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

buildWithParameters does not return queue location

    • 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).

          [JENKINS-23235] buildWithParameters does not return queue location

          Joe Littlejohn created issue -
          Joe Littlejohn made changes -
          Description Original: 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:

          {code}
          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
          {code}

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

          {code}
          $ 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
          {code}
          New: 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:

          {code}
          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
          {code}

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

          {code}
          $ 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
          {code}

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

          Daniel Beck added a comment -

          Jenkins version?

          Daniel Beck added a comment - Jenkins version?
          Joe Littlejohn made changes -
          Environment Original: CentOS 6.4
          Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
          New: Jenkins 1.559
          CentOS 6.4
          Java(TM) SE Runtime Environment (build 1.7.0_25-b15)

          Ah sorry, the 'Affected Version/s' field wouldn't accept the version and I forgot to add it to the description. It's Jenkins 1.559.

          Joe Littlejohn added a comment - Ah sorry, the 'Affected Version/s' field wouldn't accept the version and I forgot to add it to the description. It's Jenkins 1.559.

          Daniel Beck added a comment -

          Between Jenkins and almost a thousand plugins, Jira simply cannot handle the possible versions.

          Issue duplicates JENKINS-13546 which was fixed in 1.561.

          Daniel Beck added a comment - Between Jenkins and almost a thousand plugins, Jira simply cannot handle the possible versions. Issue duplicates JENKINS-13546 which was fixed in 1.561.
          Daniel Beck made changes -
          Resolution New: Duplicate [ 3 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 155796 ] New: JNJira + In-Review [ 195246 ]

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

              Created:
              Updated:
              Resolved: