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

Intermittent: Unhandled Rejection: "TypeError: Cannot read property '_links' of undefined

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Component/s: blueocean-plugin
    • Labels:
    • Environment:
      Jenkins:
      Core: 2.136
      Blue Ocean 1.8.2
      All other plugins at experimental update center levels
    • Similar Issues:
    • Released As:
      1.14.0

      Description

      Summary
      Intermittently, when running a simple Declarative Pipeline, a stage which I know to have steps in it will be shown as having no steps. The browser console reports two errors in quick succession when this takes place.

      Frequency
      Probably 50% of the time.

      Steps to recreate
      1. Create a new, empty repository in an SCM you already have set up for use with Blue Ocean. In my case this is a Bitbucket server.

      2. Go through the Blue Ocean create flow, specifying the project and repo.

      3. Create a new Pipeline using the Pipeline Editor. This doesn't need to be anything fancy - mine looks exactly like this:

      pipeline {
        agent any
        stages {
          stage('I won a hat last year') {
            steps {
              echo 'I have not won another since, though.'
              sh 'cat /var/log/jenkins/jenkins.log.1'
            }
          }
        }
      }
      

      4. Run the pipeline several times, and look for the "live" pipeline view to report that the stage doesn't have any steps in it, as seen in this screenshot:

      5. This is when the error has occurred. The browser console will show the following:

      There has been an error while trying to get the run data. TypeError: newArray.slice is not a function
          at LogConsole.componentWillReceiveProps (jenkins-js-extension.js:93380)
          at ReactCompositeComponentWrapper.updateComponent (jenkins-design-language.js:49436)
          at ReactCompositeComponentWrapper.receiveComponent (jenkins-design-language.js:49369)
          at Object.receiveComponent (jenkins-design-language.js:55499)
          at ReactCompositeComponentWrapper._updateRenderedComponent (jenkins-design-language.js:49576)
          at ReactCompositeComponentWrapper._performComponentUpdate (jenkins-design-language.js:49546)
          at ReactCompositeComponentWrapper.updateComponent (jenkins-design-language.js:49467)
          at ReactCompositeComponentWrapper.receiveComponent (jenkins-design-language.js:49369)
          at Object.receiveComponent (jenkins-design-language.js:55499)
          at Object.updateChildren (jenkins-design-language.js:48731)
          at ReactDOMComponent._reconcilerUpdateChildren (jenkins-design-language.js:54357)
          at ReactDOMComponent._updateChildren (jenkins-design-language.js:54456)
          at ReactDOMComponent.updateChildren (jenkins-design-language.js:54443)
          at ReactDOMComponent._updateDOMChildren (jenkins-design-language.js:50747)
          at ReactDOMComponent.updateComponent (jenkins-design-language.js:50565)
          at ReactDOMComponent.receiveComponent (jenkins-design-language.js:50527)
          at Object.receiveComponent (jenkins-design-language.js:55499)
          at Object.updateChildren (jenkins-design-language.js:48731)
          at ReactDOMComponent._reconcilerUpdateChildren (jenkins-design-language.js:54357)
          at ReactDOMComponent._updateChildren (jenkins-design-language.js:54456)
          at ReactDOMComponent.updateChildren (jenkins-design-language.js:54443)
          at ReactDOMComponent._updateDOMChildren (jenkins-design-language.js:50747)
      

      Followed immediately (0.006 seconds later) by:

      blueocean.js:58096 Unhandled Rejection: "TypeError: Cannot read property '_links' of undefined
          at PipelineService.updateLatestRun (http://172.18.40.95:8080/adjuncts/ce7d142d/io/jenkins/blueocean/blueocean-core-js.js:58396:45)
          at executeAction (http://172.18.40.95:8080/adjuncts/ce7d142d/io/jenkins/blueocean/blueocean-core-js.js:40729:19)
          at PipelineService.res (http://172.18.40.95:8080/adjuncts/ce7d142d/io/jenkins/blueocean/blueocean-core-js.js:40701:16)
          at http://172.18.40.95:8080/adjuncts/ce7d142d/io/jenkins/blueocean/blueocean-core-js.js:57603:40"
      logUnhandledPromiseRejection @ blueocean.js:58096
      

        Attachments

          Issue Links

            Activity

            Hide
            kshultz Karl Shultz added a comment -

            If I can find a reliable way to recreate this, I'll grab a .har file and attach it.

            Show
            kshultz Karl Shultz added a comment - If I can find a reliable way to recreate this, I'll grab a .har file and attach it.
            Hide
            kshultz Karl Shultz added a comment -

            Got it. Har file is here.

            Of note - when I hit this problem, the X icon at top left (to close the Run Details page) is inop. The only way to get the screen to respond again is via a full page refresh.

            Show
            kshultz Karl Shultz added a comment - Got it. Har file is here . Of note - when I hit this problem, the X icon at top left (to close the Run Details page) is inop. The only way to get the screen to respond again is via a full page refresh.
            Hide
            kshultz Karl Shultz added a comment -

            While the browser is not responding, it's still possible to check things out in the dev console. Mostly there's nothing going on when I click around, but occasionally, I'll see the following 404:

            blueocean-core-js.js:54767 GET http://172.18.40.95:8080/blue/rest/organizations/jenkins/pipelines/jenkins-42995/branches/master/runs/14/blueTestSummary/ 404 (Not Found)
            

            Another har file has been attached for that one now as well. Might be a separate issue, that's unclear.

            Show
            kshultz Karl Shultz added a comment - While the browser is not responding, it's still possible to check things out in the dev console. Mostly there's nothing going on when I click around, but occasionally, I'll see the following 404: blueocean-core-js.js:54767 GET http://172.18.40.95:8080/blue/rest/organizations/jenkins/pipelines/jenkins-42995/branches/master/runs/14/blueTestSummary/ 404 (Not Found) Another har file has been attached for that one now as well. Might be a separate issue, that's unclear.
            Hide
            kshultz Karl Shultz added a comment -

            I'd like to bump the severity of this up. It's more easily found than I first thought, and when you do hit it, the screen going non-responsive is pretty severe.

            Show
            kshultz Karl Shultz added a comment - I'd like to bump the severity of this up. It's more easily found than I first thought, and when you do hit it, the screen going non-responsive is pretty severe.
            Hide
            olamy Olivier Lamy added a comment - - edited

            404 for blueTestSummary should be fixed (see branch bug/JENKINS-53175 https://github.com/jenkinsci/blueocean-plugin/tree/bug/JENKINS-53175 )

            but as investigated by Nicolae Pascu there might an other 404 (sometimes) for url such:

            http://localhost:8080/jenkins/blue/rest/organizations/jenkins/pipelines/temp3/runs/63/ 

            Did you get this 404 as well?

            Show
            olamy Olivier Lamy added a comment - - edited 404 for blueTestSummary should be fixed (see branch bug/ JENKINS-53175 https://github.com/jenkinsci/blueocean-plugin/tree/bug/JENKINS-53175  ) but as investigated by Nicolae Pascu there might an other 404 (sometimes) for url such: http: //localhost:8080/jenkins/blue/ rest /organizations/jenkins/pipelines/temp3/runs/63/ Did you get this 404 as well?
            Hide
            olamy Olivier Lamy added a comment -

            Did some debug on the branch bug/JENKINS-53175 .

            It looks for some reasons I don't know

            RunList<? extends hudson.model.Run> runList = job.getBuilds();
            do not contains the current build which is running 
            For some debug I added triple try to get the build and in the middle there is even a check to look in the queue but still cannot be find.

            Code with many tries is here: https://github.com/jenkinsci/blueocean-plugin/blob/bug%2FJENKINS-53175/blueocean-rest-impl/src/main/java/io/jenkins/blueocean/service/embedded/rest/RunContainerImpl.java#L63

            The job is a WorkflowJob instance.

            cc Andrew Bayer

            Show
            olamy Olivier Lamy added a comment - Did some debug on the branch  bug/JENKINS-53175  . It looks for some reasons I don't know RunList<? extends hudson.model.Run> runList = job.getBuilds(); do not contains the current build which is running For some debug I added triple try to get the build and in the middle there is even a check to look in the queue but still cannot be find. Code with many tries is here: https://github.com/jenkinsci/blueocean-plugin/blob/bug%2FJENKINS-53175/blueocean-rest-impl/src/main/java/io/jenkins/blueocean/service/embedded/rest/RunContainerImpl.java#L63 The job is a WorkflowJob instance. cc Andrew Bayer
            Hide
            olamy Olivier Lamy added a comment -

            Some investigations with an instrumented version and using [~npascu] (as I cannot reproduce locally).
            Code is here https://github.com/jenkinsci/blueocean-plugin/blob/bug%2FJENKINS-53175/blueocean-rest-impl/src/main/java/io/jenkins/blueocean/service/embedded/rest/RunContainerImpl.java#L83
            Branch bug/JENKINS-53175
            So as you can see in the code we try to get the build from the job runList but not there so we try to get it from the queue but not there neither. Fair enough it has maybe just moved out of the queue to running state.
            So we try again and again but not there....
            logs

            WARNING: Cannot find run with number: 213, runId: 213, job.name: temp3 in runList: [temp3 #212, temp3 #211, temp3 #210, temp3 #209, temp3 #208, temp3 #207, temp3 #206, temp3 #205, temp3 #204, temp3 #203, temp3 #202, temp3 #201, temp3 #200, temp3 #199, temp3 #198, temp3 #197, temp3 #196, temp3 #195, temp3 #194, temp3 #193, temp3 #192, temp3 #191, temp3 #190, temp3 #189, temp3 #188, temp3 #187, temp3 #186, temp3 #185, temp3 #184, temp3 #183, temp3 #182, temp3 #181, temp3 #180, temp3 #179, temp3 #178, temp3 #177, temp3 #176, temp3 #175, temp3 #174, temp3 #173, temp3 #172, temp3 #171, temp3 #170, temp3 #169, temp3 #168, temp3 #167, temp3 #166, temp3 #165, temp3 #164, temp3 #163, temp3 #162, temp3 #161, temp3 #160, temp3 #159, temp3 #158, temp3 #157, temp3 #156, temp3 #155, temp3 #154, temp3 #153, temp3 #152, temp3 #151, temp3 #150, temp3 #149, temp3 #148, temp3 #147, temp3 #146, temp3 #145, temp3 #144, temp3 #143, temp3 #142, temp3 #141, temp3 #140, temp3 #139, temp3 #138, temp3 #137, temp3 #136, temp3 #135, temp3 #134, temp3 #133, temp3 #132, temp3 #131, temp3 #130, temp3 #129, temp3 #128, temp3 #127, temp3 #126, temp3 #125, temp3 #124, temp3 #123, temp3 #122, temp3 #121, temp3 #120, temp3 #119, temp3 #118, temp3 #117, temp3 #116, temp3 #115, temp3 #114, temp3 #113, temp3 #112, temp3 #111, temp3 #110, temp3 #109, temp3 #108, temp3 #107, temp3 #106, temp3 #105, temp3 #104, temp3 #103, temp3 #102, temp3 #101, temp3 #100, temp3 #99, temp3 #98, temp3 #97, temp3 #96, temp3 #95, temp3 #94, temp3 #93, temp3 #92, temp3 #91, temp3 #90, temp3 #89, temp3 #88, temp3 #87, temp3 #86, temp3 #85, temp3 #84, temp3 #83, temp3 #82, temp3 #81, temp3 #80, temp3 #79, temp3 #78, temp3 #77, temp3 #76, temp3 #75, temp3 #74, temp3 #73, temp3 #72, temp3 #71, temp3 #70, temp3 #69, temp3 #68, temp3 #67, temp3 #66, temp3 #65, temp3 #64, temp3 #63, temp3 #62, temp3 #61, temp3 #60, temp3 #59, temp3 #58, temp3 #57, temp3 #56, temp3 #55, temp3 #54, temp3 #53, temp3 #52, temp3 #51, temp3 #50, temp3 #49, temp3 #48, temp3 #47, temp3 #46, temp3 #45, temp3 #44, temp3 #43, temp3 #42, temp3 #41, temp3 #40, temp3 #39, temp3 #38, temp3 #37, temp3 #36, temp3 #35, temp3 #34, temp3 #33, temp3 #32, temp3 #31, temp3 #30, temp3 #29, temp3 #28, temp3 #27, temp3 #26, temp3 #25, temp3 #24, temp3 #23, temp3 #22, temp3 #21, temp3 #20, temp3 #19, temp3 #18, temp3 #17, temp3 #16, temp3 #15, temp3 #14, temp3 #13, temp3 #12, temp3 #11, temp3 #10, temp3 #9, temp3 #8, temp3 #7, temp3 #6, temp3 #5, temp3 #4, temp3 #3, temp3 #2, temp3 #1], queueList: [], jenkinsQueue: [], job.isBuilding false, job.isInQueue false
            Aug 23, 2018 9:14:47 PM org.jenkinsci.plugins.workflow.job.WorkflowRun finish
            INFO: temp3 #213 completed: SUCCESS
            

            you can see the list content it's not there. More interesting not building neither in the queue.
            but then it's marked as completed SUCCESS.
            So really no idea where the build was...
            BUT adding Thread.sleep fix the problem (see the code)
            So this might be a multi thread synchro issue somewhere in core.
            Not sure exactly how to write a unit test to reproduce.
            But might be an old issue never reported in a Jira? or maybe happen since recent core upgrade?
            but definitely heisenbug...

             

            Show
            olamy Olivier Lamy added a comment - Some investigations with an instrumented version and using [~npascu] (as I cannot reproduce locally). Code is here https://github.com/jenkinsci/blueocean-plugin/blob/bug%2FJENKINS-53175/blueocean-rest-impl/src/main/java/io/jenkins/blueocean/service/embedded/rest/RunContainerImpl.java#L83 Branch bug/ JENKINS-53175 So as you can see in the code we try to get the build from the job runList but not there so we try to get it from the queue but not there neither. Fair enough it has maybe just moved out of the queue to running state. So we try again and again but not there.... logs WARNING: Cannot find run with number: 213, runId: 213, job.name: temp3 in runList: [temp3 #212, temp3 #211, temp3 #210, temp3 #209, temp3 #208, temp3 #207, temp3 #206, temp3 #205, temp3 #204, temp3 #203, temp3 #202, temp3 #201, temp3 #200, temp3 #199, temp3 #198, temp3 #197, temp3 #196, temp3 #195, temp3 #194, temp3 #193, temp3 #192, temp3 #191, temp3 #190, temp3 #189, temp3 #188, temp3 #187, temp3 #186, temp3 #185, temp3 #184, temp3 #183, temp3 #182, temp3 #181, temp3 #180, temp3 #179, temp3 #178, temp3 #177, temp3 #176, temp3 #175, temp3 #174, temp3 #173, temp3 #172, temp3 #171, temp3 #170, temp3 #169, temp3 #168, temp3 #167, temp3 #166, temp3 #165, temp3 #164, temp3 #163, temp3 #162, temp3 #161, temp3 #160, temp3 #159, temp3 #158, temp3 #157, temp3 #156, temp3 #155, temp3 #154, temp3 #153, temp3 #152, temp3 #151, temp3 #150, temp3 #149, temp3 #148, temp3 #147, temp3 #146, temp3 #145, temp3 #144, temp3 #143, temp3 #142, temp3 #141, temp3 #140, temp3 #139, temp3 #138, temp3 #137, temp3 #136, temp3 #135, temp3 #134, temp3 #133, temp3 #132, temp3 #131, temp3 #130, temp3 #129, temp3 #128, temp3 #127, temp3 #126, temp3 #125, temp3 #124, temp3 #123, temp3 #122, temp3 #121, temp3 #120, temp3 #119, temp3 #118, temp3 #117, temp3 #116, temp3 #115, temp3 #114, temp3 #113, temp3 #112, temp3 #111, temp3 #110, temp3 #109, temp3 #108, temp3 #107, temp3 #106, temp3 #105, temp3 #104, temp3 #103, temp3 #102, temp3 #101, temp3 #100, temp3 #99, temp3 #98, temp3 #97, temp3 #96, temp3 #95, temp3 #94, temp3 #93, temp3 #92, temp3 #91, temp3 #90, temp3 #89, temp3 #88, temp3 #87, temp3 #86, temp3 #85, temp3 #84, temp3 #83, temp3 #82, temp3 #81, temp3 #80, temp3 #79, temp3 #78, temp3 #77, temp3 #76, temp3 #75, temp3 #74, temp3 #73, temp3 #72, temp3 #71, temp3 #70, temp3 #69, temp3 #68, temp3 #67, temp3 #66, temp3 #65, temp3 #64, temp3 #63, temp3 #62, temp3 #61, temp3 #60, temp3 #59, temp3 #58, temp3 #57, temp3 #56, temp3 #55, temp3 #54, temp3 #53, temp3 #52, temp3 #51, temp3 #50, temp3 #49, temp3 #48, temp3 #47, temp3 #46, temp3 #45, temp3 #44, temp3 #43, temp3 #42, temp3 #41, temp3 #40, temp3 #39, temp3 #38, temp3 #37, temp3 #36, temp3 #35, temp3 #34, temp3 #33, temp3 #32, temp3 #31, temp3 #30, temp3 #29, temp3 #28, temp3 #27, temp3 #26, temp3 #25, temp3 #24, temp3 #23, temp3 #22, temp3 #21, temp3 #20, temp3 #19, temp3 #18, temp3 #17, temp3 #16, temp3 #15, temp3 #14, temp3 #13, temp3 #12, temp3 #11, temp3 #10, temp3 #9, temp3 #8, temp3 #7, temp3 #6, temp3 #5, temp3 #4, temp3 #3, temp3 #2, temp3 #1], queueList: [], jenkinsQueue: [], job.isBuilding false , job.isInQueue false Aug 23, 2018 9:14:47 PM org.jenkinsci.plugins.workflow.job.WorkflowRun finish INFO: temp3 #213 completed: SUCCESS you can see the list content it's not there. More interesting not building neither in the queue. but then it's marked as completed SUCCESS. So really no idea where the build was... BUT adding Thread.sleep fix the problem (see the code) So this might be a multi thread synchro issue somewhere in core. Not sure exactly how to write a unit test to reproduce. But might be an old issue never reported in a Jira? or maybe happen since recent core upgrade? but definitely heisenbug...  

              People

              • Assignee:
                olamy Olivier Lamy
                Reporter:
                kshultz Karl Shultz
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: