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

Got "Error rendering PipelineRunGraph: TypeError: nodeStage is undefined" when removed steps from previous run

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

      Release 1.2.0

      I have multiple stages and steps in each stage. If I run first time, we can get all stages and steps graph are working find. However, if I remove/add a step in any stage, it gets stuck on that steps and see "Error rendering PipelineRunGraph: TypeError: nodeStage is undefined". It cannot go further at all.

       

      even try to go to classic view (not blue ocean) also doesn't help to go further. This is a blocker issue for me since we have updated stages and steps quite often.

          [JENKINS-46532] Got "Error rendering PipelineRunGraph: TypeError: nodeStage is undefined" when removed steps from previous run

          Nat Sr added a comment - - edited

          Additional info:

          I rerun it and still got the same error but this time it doesn't stuck on the steps. after go further stages and steps, graph is back with new stages/steps. So it seems to be the issue for the time after updating Jenkinsfile.

          Nat Sr added a comment - - edited Additional info: I rerun it and still got the same error but this time it doesn't stuck on the steps. after go further stages and steps, graph is back with new stages/steps. So it seems to be the issue for the time after updating Jenkinsfile.

          Michael Neale added a comment -

          I don't quite understand this ticket, there isn't enough information to act on it. Will need a Jenkinsfile and console errors at least. 

          Michael Neale added a comment - I don't quite understand this ticket, there isn't enough information to act on it. Will need a Jenkinsfile and console errors at least. 

          Nat Sr added a comment -

          Actually, it's not a blocker now and no need Jenkinsfile. It happens every times if you adjust the stage parallel or the numbers of stages.

          Ex.    FROM    stage 1 has 2 parallel stages + stage 2 has 5 parallel stages    TO      stage 1 has 2 parallel stages + stage 2 has 3 parallel stages

          since the graph showing stage has changed it won't be able to recreate new graph of the job. Then you will get  "Error rendering PipelineRunGraph: TypeError: nodeStage is undefined".

          Nat Sr added a comment - Actually, it's not a blocker now and no need Jenkinsfile. It happens every times if you adjust the stage parallel or the numbers of stages. Ex.    FROM    stage 1 has 2 parallel stages + stage 2 has 5 parallel stages    TO      stage 1 has 2 parallel stages + stage 2 has 3 parallel stages since the graph showing stage has changed it won't be able to recreate new graph of the job. Then you will get  "Error rendering PipelineRunGraph: TypeError: nodeStage is undefined".

          Michael Neale added a comment -

          comscience15 not able to understand that. An example would make it understandable.

          Michael Neale added a comment - comscience15 not able to understand that. An example would make it understandable.

          James Dumay added a comment -

          Hey comscience15,

          If you could give us a step by step reproduction with a Jenkinsfile I'd be happy to dig into this. Please reopen if you can provide it

          Thanks for reporting!

          James

          James Dumay added a comment - Hey comscience15 , If you could give us a step by step reproduction with a Jenkinsfile I'd be happy to dig into this. Please reopen if you can provide it Thanks for reporting! James

          Nat Sr added a comment - - edited

          Hi James,

          The steps are if you have steps' nodes in graph, especially using parallel steps and builds are pass for a couple run. Then you updated your Jenkinsfile to either reduce or add more parallel steps in. Once you run, you can see "Error rendering PipelineRunGraph: TypeError: nodeStage is undefined".  NOTE:  you need to remove or add multiple parallel steps to be able to see.  I tried to remove or add for a couple, it seems to work fine still.  

          I think it is because the node graph is changed from the previous run. So it cannot regenerate the new graph immediately. I will attach a screenshot for this error for you.

          However, if I keep going to steps in the same run, eventually, the graph is back.

          Thanks,
          Nat

          Nat Sr added a comment - - edited Hi James, The steps are if you have steps' nodes in graph, especially using parallel steps and builds are pass for a couple run. Then you updated your Jenkinsfile to either reduce or add more parallel steps in. Once you run, you can see "Error rendering PipelineRunGraph: TypeError: nodeStage is undefined".  NOTE:  you need to remove or add multiple parallel steps to be able to see.  I tried to remove or add for a couple, it seems to work fine still.   I think it is because the node graph is changed from the previous run. So it cannot regenerate the new graph immediately. I will attach a screenshot for this error for you. However, if I keep going to steps in the same run, eventually, the graph is back. Thanks, Nat

          Michael Neale added a comment -

          comscience15 not sure there is enough reproduction details in there - need some Jenkinsfiles ideally. There were some changes released recently in this area too. 

          Michael Neale added a comment - comscience15 not sure there is enough reproduction details in there - need some Jenkinsfiles ideally. There were some changes released recently in this area too. 

          Nat Sr added a comment -
          // code pipeline {
              agent any
              stages {
                  stage("1) Test") {
                      steps {
                          script {
                              try {
                                  input 'Test open google Photots\n\n' +
                                        '1) Open https://www.google.com/search?q=photo+test&source=lnms&tbm=isch&sa=X&ved=0ahUKEwiK172Zp_PUAhUHrVQKHeD4CREQ_AUICigB&biw=1421&bih=895\n' +
                                        '2) Please open one of these photos and see which one you like\n\n\n\n' +
                                        'Click "Proceed" to continue....'
                              } catch(err) {
                                  currentBuild.result = "FAILURE"
                                    mail body: "unable to open",
                                    from: "test@aloha.com",
                                    replyTo: "",
                                    subject: "CANNOT OPEN GOOGLE PHOTOS!!!",
                                    to: "test@aloha.com"
                                  throw err
                              }
                          }
                      }
                  }
              }
          }
          

          you can use this sample Jenkinsfile code and add a lot more steps then remove some steps.

          Nat Sr added a comment - // code pipeline {     agent any     stages {         stage( "1) Test" ) {             steps {                 script {                     try {                         input 'Test open google Photots\n\n' +                               '1) Open https: //www.google.com/search?q=photo+test&source=lnms&tbm=isch&sa=X&ved=0ahUKEwiK172Zp_PUAhUHrVQKHeD4CREQ_AUICigB&biw=1421&bih=895\n' +                               '2) Please open one of these photos and see which one you like\n\n\n\n' +                               'Click "Proceed" to continue ....'                     } catch (err) {                         currentBuild.result = "FAILURE"                           mail body: "unable to open" ,                           from: "test@aloha.com" ,                           replyTo: "",                           subject: "CANNOT OPEN GOOGLE PHOTOS!!!" ,                           to: "test@aloha.com"                         throw err                     }                 }             }         }     } } you can use this sample Jenkinsfile code and add a lot more steps then remove some steps.

          James Dumay added a comment -

          comscience15 dont use the script block to do things like setting the current build result. Try something like this instead:

          // Good practice to split your scripts out into functions, improves readability
          def sendEmail() {
            mail  body: "unable to open",
                  from: "test@aloha.com",
                  replyTo: "",
                  subject: "CANNOT OPEN GOOGLE PHOTOS!!!",
                  to: "test@aloha.com"
          }
          
          stages {
            stage('1) Test') {
              steps {
                input 'Test open google Photots\n\n' +
                    '1) Open https://www.google.com/search?q=photo+test&source=lnms&tbm=isch&sa=X&ved=0ahUKEwiK172Zp_PUAhUHrVQKHeD4CREQ_AUICigB&biw=1421&bih=895\n' +
                    '2) Please open one of these photos and see which one you like\n\n\n\n' +
                    'Click "Proceed" to continue....'
              }
              post {
                failure {
                  sendEmail()
                }
              }
            }
          }
          

          James Dumay added a comment - comscience15 dont use the script block to do things like setting the current build result. Try something like this instead: // Good practice to split your scripts out into functions, improves readability def sendEmail() { mail body: "unable to open" , from: "test@aloha.com" , replyTo: "", subject: "CANNOT OPEN GOOGLE PHOTOS!!!" , to: "test@aloha.com" } stages { stage( '1) Test' ) { steps { input 'Test open google Photots\n\n' + '1) Open https: //www.google.com/search?q=photo+test&source=lnms&tbm=isch&sa=X&ved=0ahUKEwiK172Zp_PUAhUHrVQKHeD4CREQ_AUICigB&biw=1421&bih=895\n' + '2) Please open one of these photos and see which one you like\n\n\n\n' + 'Click "Proceed" to continue ....' } post { failure { sendEmail() } } } }

          Nat Sr added a comment -

          Thanks, yes I updated it.

          Nat Sr added a comment - Thanks, yes I updated it.

            jamesdumay James Dumay
            comscience15 Nat Sr
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: