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

HTTP Request Issue on URL redirect


    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • http-request-plugin
    • None
    • Jenkins 2.254
      httpRequest  plugin v. 1.8.26
      RHEL 7.x

      I have a Jenkins pipeline downloading artifacts from a Nexus using its API.

      To avoid using platform dependent tools (e.g. wget), I have looked into using the httpRequest  plugin (v. 1.8.26 on Jenkins 2.254).

      When using the following a stage steps

      def artifactFilename = "${ARTIFACT_ID}.${artifactExtension}"
      def artifactURL = "${nexus3BaseUrl}/service/rest/v1/search/assets/download?repository=${NEXUS_REPO}&group=${GROUP_ID}&name=${ARTIFACT_ID}&maven.baseVersion=${versionFilter}&maven.extension=${artifactExtension}&maven.classifier&sort=version&direction=desc"
      def response = httpRequest httpMode: 'GET', url: artifactURL, consoleLogResponseBody: true , outputFile: "${env.WORKSPACE}/tmp/${artifactFilename}"

      The console shows the following outputs and stay stuck there:

      HttpMethod: GET
      URL: [the nexus API URL]
      Sending request to url: [the nexus API URL]
      Response Code: HTTP/1.1 200 OK

      The same logic using WGET takes seconds, whereas with the HTTP Request plugin it stays stuck there until the build execution times out (even if the Nexus server in on the local host)

            janario Janario Oliveira
            ceddaerrix Cedric H
            0 Vote for this issue
            1 Start watching this issue