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

Connection refused error does not fail the step

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • ftppublisher-plugin
    • None

      We use ftpPublisher with 

      continueOnError: false, failOnError: true

      so we would expect that the step fails when an error occurs during publishing. 

      However, we get 

      ERROR: Exception when publishing, exception message [Connection refused (Connection refused)]

      but the step does not fail but ends with SUCCESS. 

      This is a problem, because other jobs fail that depend on the published artifacts, and the actual cause goes unnoticed. Instead, we have to check the console logs manually.

      Is there anything else that needs to be configured? Otherwise, I'd say this is a bug.

          [JENKINS-71705] Connection refused error does not fail the step

          Alexander Ukolov added a comment - - edited

          I faced with this issue as well. Could you please fix it?

          I would like to set the stage and build results via catchError:

          catchError(buildResult: '...', stageResult: '...') {...}

          what will be more flexible how to handle the error. But it doesn't work now.

          Alexander Ukolov added a comment - - edited I faced with this issue as well. Could you please fix it? I would like to set the stage and build results via catchError: catchError(buildResult: '...' , stageResult: '...' ) {...} what will be more flexible how to handle the error. But it doesn't work now.

          mesa added a comment -

          I've implemented the following work-around using the Text Finder plugin:

                          // Search console log for error text and set build unstable if found
                          findText(textFinders: [
                               textFinder(
                                   regexp: 'ERROR: Exception when publishing', 
                                   alsoCheckConsoleOutput: true, 
                                   buildResult: 'UNSTABLE'
                               )
                          ])  
                          script {
                              if (currentBuild.result == 'UNSTABLE') {
                                  catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') {
                                      error("FTP publishing build artifacts failed") 
                                  }
                              }
                          }
           

          Perhaps it helps others, too.

          mesa added a comment - I've implemented the following work-around using the Text Finder plugin :                 // Search console log for error text and set build unstable if found                 findText(textFinders: [                      textFinder(                          regexp: 'ERROR: Exception when publishing' ,                           alsoCheckConsoleOutput: true ,                           buildResult: 'UNSTABLE'                      )                 ])                   script {                     if (currentBuild.result == 'UNSTABLE' ) {                         catchError(buildResult: 'UNSTABLE' , stageResult: 'FAILURE' ) {                             error( "FTP publishing build artifacts failed" )                          }                     }                 } Perhaps it helps others, too.

            benjaminjaton benjaminjaton
            mesa mesa
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: