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

          Kamil created issue -
          Kamil made changes -
          Description Original: 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.

           

           

          {{{code:groovy}}}

          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'
           ])
           }
           }
           }
           }
          }{{}}

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

           

           

          {code:title=example|borderStyle=solid}
          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'
                              ])
                          }
                      }
                  }
              }
          }{code}
          Ulli Hafner made changes -
          Component/s Original: warnings-plugin [ 15513 ]
          Kamil made changes -
          Description Original: 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.

           

           

          {code:title=example|borderStyle=solid}
          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'
                              ])
                          }
                      }
                  }
              }
          }{code}
          New: 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.

           

           

          {code:title=example|borderStyle=solid}
          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'
                              ])
                          }
                      }
                  }
              }
          }{code}

          Here is the console ouitput
          {code}
          [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.
          {code}
          Kamil made changes -
          Description Original: 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.

           

           

          {code:title=example|borderStyle=solid}
          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'
                              ])
                          }
                      }
                  }
              }
          }{code}

          Here is the console ouitput
          {code}
          [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.
          {code}
          New: 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.

           

           

          {code:title=example|borderStyle=solid}
          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'
                              ])
                          }
                      }
                  }
              }
          }{code}


           @EDIT
          Here is the console log
          {code}
          [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.
          {code}

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

              Created:
              Updated: