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

http request not sent, with no log and pipeline end directly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • http-request-plugin
    • None
    • CloudBees Jenkins Enterprise 2.73.3.1-rolling
      http request plugin 1.8.21
      Google Chrome is up to date
      Version 62.0.3202.94 (Official Build) (64-bit)
      Java version java-1.8.0-openjdk-1.8.0.141-2.b16.el6_9.x86_64

      When we execute inside a pipeline this method :

       

      // Jenkins DSL Pipeline as code
      
      /**
       * Retrieve the release Id which contains the application Id in the content with the correct version to deploy
       * @param applicationId application Id define in CDD
       * @param applicationVersion application version to deploy define in the content of the CDD release
       * @param applicationName application name to deploy define in the content of the CDD release
       * @return the release Id
       */
      def getReleaseId(String applicationId, String applicationVersion, String applicationName) {
          // Get All releases which contains the application id
          def responseGetReleaseId = steps.httpRequest acceptType: 'APPLICATION_JSON',
                  consoleLogResponseBody: true,
                  authentication: 'CDD',
                  responseHandle: 'NONE',
                  url: "${BASE_URL}${CDD_RELEASES_ENDPOINT}?status=DESIGN&status=RUNNING&status=RUNNING_WITH_ERRORS&application=${applicationId}"
          def responseGetReleaseIdJSON = new JsonSlurper().parseText(responseGetReleaseId.getContent())
          def releaseID
          def numberOfReleasesRunning = responseGetReleaseIdJSON.totalResultsCount
      
          if (numberOfReleasesRunning == 0) {
              steps.error("There is no CDD releases define with this application: " + applicationName + ".")
          } else if (numberOfReleasesRunning == 1) {
              releaseID = responseGetReleaseIdJSON.data.id[0]
          } else {
              // if Application name is define in multiple release :
              // Retrieve only the Release Id linked to the correct Application version in the content of the correct release
              steps.echo("numberOfReleasesRunning :"+numberOfReleasesRunning)
              for (int i = 0; i < numberOfReleasesRunning; i++) {
                  releaseID = responseGetReleaseIdJSON.data.id[i]
                  steps.echo("i: "+i+", releaseID :"+releaseID)
                  steps.echo("i: "+i+", applicationId :"+applicationId)
                  def responseApplicationVersion = steps.httpRequest acceptType: 'APPLICATION_JSON',
                          consoleLogResponseBody: true,
                          authentication: 'CDD',
                          responseHandle: 'NONE',
                          url: "${BASE_URL}${CDD_RELEASES_ENDPOINT}/${releaseID}/applications/${applicationId}/application-versions"
                  def responseGetApplicationVersionJSON = new JsonSlurper().parseText(responseApplicationVersion.getContent())
                  def appVersion = responseGetApplicationVersionJSON.data.name
                  if (appVersion == applicationVersion) {
                      break
                  }
              }
          }
          steps.echo("CDD Release Id selected for the deployment :" + releaseID)
          return releaseID
      }
      

      Then the pipeline exit with no log or stacktrace available

      // Jenkins console log
      [Pipeline] httpRequest
      HttpMethod: GET
      URL: http://cde.axa.be/cdd/design/0000/v1/releases?status=DESIGN&status=RUNNING&status=RUNNING_WITH_ERRORS&application=558
      Accept: application/json
      Using authentication: CDD
      Sending request to url: http://cde.axa.be/cdd/design/0000/v1/releases?status=DESIGN&status=RUNNING&status=RUNNING_WITH_ERRORS&application=558
      Response Code: HTTP/1.1 200 
      Response: 
      {"pageNumber":0,"totalResultsCount":2,"pageSize":10,"data":[{"executionData":{"allowedStatuses":[],"releaseId":660,"status":"DESIGN","revision":3,"id":660,"className":"ReleaseExecutionDto"},"applications":[{"deletable":true,"sourceName":"Local","name":"be.axa.toolinghub.bsail003.etl-zip","id":558,"className":"ApplicationDto"}],"applicationVersions":[],"creationDate":1510756806000,"ownerParties":[{"email":"lesly.bernaola.external@axa.be","notificationEnabled":true,"firstName":"Lesly","lastName":"Bernaola","superUser":false,"role":"SYSTEM_ADMINISTRATOR","name":"lesly.bernaola.external@axa.be","id":22,"className":"UserDto"}],"version":"DM100002","description":"","name":"ETL On boarding 2","id":660,"className":"ReleaseDto"},{"executionData":{"allowedStatuses":["DONE"],"releaseId":654,"status":"RUNNING","revision":6,"id":654,"className":"ReleaseExecutionDto"},"applications":[{"deletable":true,"sourceName":"Local","name":"be.axa.toolinghub.bsail003.etl-zip","id":558,"className":"ApplicationDto"}],"applicationVersions":[],"creationDate":1510653395000,"startDate":1510656859000,"ownerParties":[{"email":"lesly.bernaola.external@axa.be","notificationEnabled":true,"firstName":"Lesly","lastName":"Bernaola","superUser":false,"role":"SYSTEM_ADMINISTRATOR","name":"lesly.bernaola.external@axa.be","id":22,"className":"UserDto"}],"version":"DM100001","description":"","name":"ETL On boarding","id":654,"className":"ReleaseDto"}]}
      Success code from [100‥399]
      [Pipeline] echo
      numberOfReleasesRunning :2
      [Pipeline] echo
      i: 0, releaseID :660
      [Pipeline] echo
      i: 0, applicationId :558
      [Pipeline] httpRequest
      [Pipeline] }
      [Pipeline] // stage
      [Pipeline] }
      [Pipeline] // node
      

      Please note that same or other HTTP call work in other stages running in same node and same pipeline execution.

      Kr,

      Tarik.

            tarik_djebien Tarik Djebien
            tarik_djebien Tarik Djebien
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: