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

Jenkins pipeline - HTML Publusher stage/step show success but it's failed

      HTML Publisher may fail due to non existing source and/or target directory, the console log will then show an error, but the stage will be marked as succeeded. It leads to failed pipeline (which is correct), but all stages/steps are marked as succeded. It makes the debugging very difficult to find the problem.

       

       

      example
      stage('Generage and Build') {
          parallel {
              stage('regular step') {
                  steps {
                      bat 'do stuff'
                  }
              }
              stage('publish results') {
                  steps {
                      dir('C:/fancy/path') {
                          dir('c:/another/fancy/path') {
                              bat 'echo Creating Directory c:/another/fancy/path'
                          }
                          bat 'run_my_script.bat'
                          publishHTML([
                                  allowMissing         : false,
                                  alwaysLinkToLastBuild: false,
                                  keepAll              : false,
                                  reportDir            : 'c:\\GeneratedOutput\\pandocOutput\\HTML',
                                  reportFiles          : 'index.html',
                                  reportName           : 'my report name',
                                  reportTitles         : 'my report titles'
                          ])
                      }
                  }
              }
          }
      }

      @EDIT
      Here is the console log

      [htmlpublisher] Archiving HTML reports...
      [htmlpublisher] Archiving at BUILD level O:\GeneratedOutput\pandocOutput\HTML to D:\Jenkins\Jenkins.jenkins\jobs\test\builds\86\htmlreports\OPAR_20Documentation_20CoPm
      ERROR: Specified HTML directory 'O:\GeneratedOutput\pandocOutput\HTML' does not exist.
      

          [JENKINS-64771] Jenkins pipeline - HTML Publusher stage/step show success but it's failed

          Hi wintermute - are you able to share the console output you get from that job on your system as it might give me some clues on where the problem might lie. Thanks!

          Richard Bywater added a comment - Hi wintermute  - are you able to share the console output you get from that job on your system as it might give me some clues on where the problem might lie. Thanks!

          Kamil added a comment - - edited

          r2b2_nz Hi Richard, I edited the issue description and added there a console log - even if it's not much. If you need more information, please let me know.

          Kamil added a comment - - edited r2b2_nz Hi Richard, I edited the issue description and added there a console log - even if it's not much. If you need more information, please let me know.

            r2b2_nz Richard Bywater
            wintermute Kamil
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: