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

"TypeError: Cannot read property 'toLowerCase' of undefined" for i18n title

    XMLWordPrintable

    Details

    • Sprint:
      Blue Ocean - Candidates
    • Similar Issues:

      Description

      Testing notes
      Karl Shultz has prepared testing notes

      See also the linked duplicate ticket for another example of the stack trace. It seems related to time harmonizer - but more investigation needed.  

      Reproduction instructions: not clear. 

      This likely may be valid data and it just needs to be hardened a bit to undefined fields. 

      Original request
      For some reason one of the builds has the result "undefined" (probably because the server restarted while running? or probably because I deleted some jobs because I was running out of disk space?)... Anyways, that issue causes the activity screen on blue ocean to fail loading with the following error:

      blueocean.js:6247 Error fetching page TypeError: Cannot read property 'toLowerCase' of undefined

      The problem seems to be in this line: https://github.com/jenkinsci/blueocean-plugin/blob/9d3cdedef981803eeb3c7931124187c903876c6f/blueocean-core-js/src/js/components/LiveStatusIndicator.jsx#L11

      Attached screenshots of the error. I deleted all the jobs from Jenkins and the error was still happening. The only workaround I've found was to delete and re-create the pipeline.

        Attachments

          Issue Links

            Activity

            Hide
            sophistifunk Josh McDonald added a comment -

            Not really. Once we have per-property skipability, it will get better in that we won't have partially-formed runs bringing the UI down, but instead we would just get a 500 (or some runs would be missing from the response completely, if it's a list). But I don't really know enough to diagnose why those runs' executions can't be iterated properly when attempting to create the nodes - the root exception is coming from non-BlueOcean code, so I'm not particularly familiar with it. Somebody on the pipeline team might have something more useful to add, though.

             

            Show
            sophistifunk Josh McDonald added a comment - Not really. Once we have per-property skipability, it will get better in that we won't have partially-formed runs bringing the UI down, but instead we would just get a 500 (or some runs would be missing from the response completely, if it's a list). But I don't really know enough to diagnose why those runs' executions can't be iterated properly when attempting to create the nodes - the root exception is coming from non-BlueOcean code, so I'm not particularly familiar with it. Somebody on the pipeline team might have something more useful to add, though.  
            Hide
            godskalk Øyvind R added a comment -

            Vivek Panday, but the issue has been "resolved" with status "fixed". Surely while the issue persists it should still be open?

            Show
            godskalk Øyvind R added a comment - Vivek Panday , but the issue has been "resolved" with status "fixed". Surely while the issue persists it should still be open?
            Hide
            vivek Vivek Pandey added a comment -

            Øyvind R oh sorry, my intent was not to just close the ticket. As you can see comments/evaluation from Josh, we did what we could as it’s not something we can fix in blueocean and this error will go away. Fix made here is to report better error so that you know where/which plugin is failing and with that info we can fix appropriate plugin.

            If you disagree you can reopen but we did what we could as explained in this ticket.

            Show
            vivek Vivek Pandey added a comment - Øyvind R oh sorry, my intent was not to just close the ticket. As you can see comments/evaluation from Josh, we did what we could as it’s not something we can fix in blueocean and this error will go away. Fix made here is to report better error so that you know where/which plugin is failing and with that info we can fix appropriate plugin. If you disagree you can reopen but we did what we could as explained in this ticket.
            Hide
            cellule Michael Ferris added a comment -

            I have been able to track down a bit more where the problem occurs.

            In Activity details (https://github.com/jenkinsci/blueocean-plugin/blob/77960a8dc21840ae5f6df784a26f91e09d7da621/blueocean-dashboard/src/main/js/components/ActivityDetailsRow.jsx#L33)

            There is the following 

             

            const resultRun = run.result === 'UNKNOWN' ? run.state : run.result;
            

            resultRun is later used with .toLowerCase() to show in the page. 

             

            However, it is possible (not sure how) for run.state to be undefined when run.result is "UNKNOWN" probably should change the check to

            const resultRun = (run.result === 'UNKNOWN' && typeof run.state === "string") ? run.state : run.result;
            

            This way Blue Ocean would be more resilient to builds' data

            Show
            cellule Michael Ferris added a comment - I have been able to track down a bit more where the problem occurs. In Activity details ( https://github.com/jenkinsci/blueocean-plugin/blob/77960a8dc21840ae5f6df784a26f91e09d7da621/blueocean-dashboard/src/main/js/components/ActivityDetailsRow.jsx#L33) There is the following    const resultRun = run.result === 'UNKNOWN' ? run.state : run.result; resultRun is later used with .toLowerCase() to show in the page.    However, it is possible (not sure how) for run.state to be undefined when run.result is "UNKNOWN" probably should change the check to const resultRun = (run.result === 'UNKNOWN' && typeof run.state === "string" ) ? run.state : run.result; This way Blue Ocean would be more resilient to builds' data
            Hide
            ifernandezcalvo Ivan Fernandez Calvo added a comment -

            This issue still happens on BO 1.9.0, Jenkins Core 2.153, and Google Chrome Version 70.0.3538.102 (Official Build) (64-bit)

            blueocean.js:58096 Unhandled Rejection: "TypeError: Cannot read property 'toLowerCase' of undefined\n    at TimeHarmonizerUtil.getI18nTitle (https://jenkins.example.com/adjuncts/753fab46/io/jenkins/blueocean/blueocean-core-js.js:54379:75)\n    at LiveStatusIndicator.render (https://jenkins.example.com/adjuncts/753fab46/io/jenkins/blueocean/blueocean-core-js.js:53687:25)\n    at ReactCompositeComponentWrapper._renderValidatedComponentWithoutOwnerOrContext (https://jenkins.example.com/adjuncts/753fab46/io/jenkins/blueocean/jenkins-design-language.js:49621:30)\n    at ReactCompositeComponentWrapper._renderValidatedComponent (https://jenkins.example.com/adjuncts/753fab46/io/jenkins/blueocean/jenkins-design-language.js:49644:32)\n    at ReactCompositeComponentWrapper.performInitialMount (https://jenkins.example.com/adjuncts/753fab46/io/jenkins/blueocean/jenkins-design-language.js:49184:30)\n    at ReactCompositeComponentWrapper.mountComponent (https://jenkins.example.com/adjuncts/753fab46/io/jenkins/blueocean/jenkins-design-language.js:49080:21)\n    at Object.mountComponent (https://jenkins.example.com/adjuncts/753fab46/io/jenkins/blueocean/jenkins-design-language.js:55420:35)\n    at ReactCompositeComponentWrapper.performInitialMount (https://jenkins.example.com/adjuncts/753fab46/io/jenkins/blueocean/jenkins-design-language.js:49193:34)\n    at ReactCompositeComponentWrapper.mountComponent (https://jenkins.example.com/adjuncts/753fab46/io/jenkins/blueocean/jenkins-design-language.js:49080:21)\n    at Object.mountComponent (https://jenkins.example.com/adjuncts/753fab46/io/jenkins/blueocean/jenkins-design-language.js:55420:35)\n    at ReactDOMComponent.mountChildren (https://jenkins.example.com/adjuncts/753fab46/io/jenkins/blueocean/jenkins-design-language.js:54382:44)\n    at ReactDOMComponent._createInitialChildren (https://jenkins.example.com/adjuncts/753fab46/io/jenkins/blueocean/jenkins-design-language.js:50508:32)\n    at ReactDOMComponent.mountComponent (https://jenkins.example.com/adjuncts/753fab46/io/jenkins/blueocean/jenkins-design-language.js:50327:12)\n    at Object.mountComponent (https://jenkins.example.com/adjuncts/753fab46/io/jenkins/blueocean/jenkins-design-language.js:55420:35)\n    at ReactCompositeComponentWrapper.performInitialMount (https://jenkins.example.com/adjuncts/753fab46/io/jenkins/blueocean/jenkins-design-language.js:49193:34)\n    at ReactCompositeComponentWrapper.mountComponent (https://jenkins.example.com/adjuncts/753fab46/io/jenkins/blueocean/jenkins-design-language.js:49080:21)\n    at Object.mountComponent (https://jenkins.example.com/adjuncts/753fab46/io/jenkins/blueocean/jenkins-design-language.js:55420:35)\n    at ReactCompositeComponentWrapper.performInitialMount (https://jenkins.example.com/adjuncts/753fab46/io/jenkins/blueocean/jenkins-design-language.js:49193:34)\n    at ReactCompositeComponentWrapper.mountComponent (https://jenkins.example.com/adjuncts/753fab46/io/jenkins/blueocean/jenkins-design-language.js:49080:21)\n    at Object.mountComponent (https://jenkins.example.com/adjuncts/753fab46/io/jenkins/blueocean/jenkins-design-language.js:55420:35)\n    at ReactDOMComponent.mountChildren (https://jenkins.example.com/adjuncts/753fab46/io/jenkins/blueocean/jenkins-design-language.js:54382:44)\n    at ReactDOMComponent._createInitialChildren (https://jenkins.example.com/adjuncts/753fab46/io/jenkins/blueocean/jenkins-design-language.js:50508:32)"
            
            Show
            ifernandezcalvo Ivan Fernandez Calvo added a comment - This issue still happens on BO 1.9.0, Jenkins Core 2.153, and Google Chrome Version 70.0.3538.102 (Official Build) (64-bit) blueocean.js:58096 Unhandled Rejection: "TypeError: Cannot read property 'toLowerCase' of undefined\n at TimeHarmonizerUtil.getI18nTitle (https: //jenkins.example.com/adjuncts/753fab46/io/jenkins/blueocean/blueocean-core-js.js:54379:75)\n at LiveStatusIndicator.render (https://jenkins.example.com/adjuncts/753fab46/io/jenkins/blueocean/blueocean-core-js.js:53687:25)\n at ReactCompositeComponentWrapper._renderValidatedComponentWithoutOwnerOrContext (https://jenkins.example.com/adjuncts/753fab46/io/jenkins/blueocean/jenkins-design-language.js:49621:30)\n at ReactCompositeComponentWrapper._renderValidatedComponent (https://jenkins.example.com/adjuncts/753fab46/io/jenkins/blueocean/jenkins-design-language.js:49644:32)\n at ReactCompositeComponentWrapper.performInitialMount (https://jenkins.example.com/adjuncts/753fab46/io/jenkins/blueocean/jenkins-design-language.js:49184:30)\n at ReactCompositeComponentWrapper.mountComponent (https://jenkins.example.com/adjuncts/753fab46/io/jenkins/blueocean/jenkins-design-language.js:49080:21)\n at Object .mountComponent (https://jenkins.example.com/adjuncts/753fab46/io/jenkins/blueocean/jenkins-design-language.js:55420:35)\n at ReactCompositeComponentWrapper.performInitialMount (https://jenkins.example.com/adjuncts/753fab46/io/jenkins/blueocean/jenkins-design-language.js:49193:34)\n at ReactCompositeComponentWrapper.mountComponent (https://jenkins.example.com/adjuncts/753fab46/io/jenkins/blueocean/jenkins-design-language.js:49080:21)\n at Object .mountComponent (https://jenkins.example.com/adjuncts/753fab46/io/jenkins/blueocean/jenkins-design-language.js:55420:35)\n at ReactDOMComponent.mountChildren (https://jenkins.example.com/adjuncts/753fab46/io/jenkins/blueocean/jenkins-design-language.js:54382:44)\n at ReactDOMComponent._createInitialChildren (https://jenkins.example.com/adjuncts/753fab46/io/jenkins/blueocean/jenkins-design-language.js:50508:32)\n at ReactDOMComponent.mountComponent (https://jenkins.example.com/adjuncts/753fab46/io/jenkins/blueocean/jenkins-design-language.js:50327:12)\n at Object .mountComponent (https://jenkins.example.com/adjuncts/753fab46/io/jenkins/blueocean/jenkins-design-language.js:55420:35)\n at ReactCompositeComponentWrapper.performInitialMount (https://jenkins.example.com/adjuncts/753fab46/io/jenkins/blueocean/jenkins-design-language.js:49193:34)\n at ReactCompositeComponentWrapper.mountComponent (https://jenkins.example.com/adjuncts/753fab46/io/jenkins/blueocean/jenkins-design-language.js:49080:21)\n at Object .mountComponent (https://jenkins.example.com/adjuncts/753fab46/io/jenkins/blueocean/jenkins-design-language.js:55420:35)\n at ReactCompositeComponentWrapper.performInitialMount (https://jenkins.example.com/adjuncts/753fab46/io/jenkins/blueocean/jenkins-design-language.js:49193:34)\n at ReactCompositeComponentWrapper.mountComponent (https://jenkins.example.com/adjuncts/753fab46/io/jenkins/blueocean/jenkins-design-language.js:49080:21)\n at Object .mountComponent (https://jenkins.example.com/adjuncts/753fab46/io/jenkins/blueocean/jenkins-design-language.js:55420:35)\n at ReactDOMComponent.mountChildren (https://jenkins.example.com/adjuncts/753fab46/io/jenkins/blueocean/jenkins-design-language.js:54382:44)\n at ReactDOMComponent._createInitialChildren (https://jenkins.example.com/adjuncts/753fab46/io/jenkins/blueocean/jenkins-design-language.js:50508:32)"

              People

              • Assignee:
                sophistifunk Josh McDonald
                Reporter:
                c3s4r Cesar Salazar
              • Votes:
                5 Vote for this issue
                Watchers:
                12 Start watching this issue

                Dates

                • Created:
                  Updated: