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

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

    • Blue Ocean - Candidates

      Testing notes
      kshultz 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.

          [JENKINS-48198] "TypeError: Cannot read property 'toLowerCase' of undefined" for i18n title

          Michael Neale added a comment -

          thanks godskalk - that is kind of interesting, although it won't make much sense. That is a failure of the pipeline graph somehow. Can you provide a Jenkinsfile possibly that shows this? as it looks specific to that. 

          Michael Neale added a comment - thanks godskalk - that is kind of interesting, although it won't make much sense. That is a failure of the pipeline graph somehow. Can you provide a Jenkinsfile possibly that shows this? as it looks specific to that. 

          Vivek Pandey added a comment -

          More logging info added in https://github.com/jenkinsci/blueocean-plugin/pull/1648, hopefully this should help diagnose whats causing this behavior.

          Vivek Pandey added a comment - More logging info added in  https://github.com/jenkinsci/blueocean-plugin/pull/1648 , hopefully this should help diagnose whats causing this behavior.

          Øyvind R added a comment -

          How is this issue now fixed?

          Øyvind R added a comment - How is this issue now fixed?

          Vivek Pandey added a comment -

          godskalk Not necessarily fixed. Josh has added some more server side logging to help see whats blowing up in server side resulting in to UI showing this error. sophistifunk do you have more ideas on what else can be done on it?

          Vivek Pandey added a comment - godskalk Not necessarily fixed. Josh has added some more server side logging to help see whats blowing up in server side resulting in to UI showing this error. sophistifunk do you have more ideas on what else can be done on it?

          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.

           

          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.  

          Øyvind R added a comment -

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

          Øyvind R added a comment - coervivek , but the issue has been "resolved" with status "fixed". Surely while the issue persists it should still be open?

          Vivek Pandey added a comment -

          godskalk 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.

          Vivek Pandey added a comment - godskalk 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.

          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

          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

          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)"
          

          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)"

          Anthony Chu added a comment - - edited

          I am still seeing this TypeError on BlueOcean 1.24.3, Jenkins 2.303.1. Right before this happened, we ran out of space in our /var/jenkins_home directory, and I ended up clearing out some of the folders in the /var/jenkins_home/workspace directory.

          Error fetching page TypeError: Cannot read properties of undefined (reading 'toLowerCase')
              at TimeHarmonizerUtil.getI18nTitle (blueocean-core-js.js:54653:75)
              at LiveStatusIndicator.render (blueocean-core-js.js:53961:25)
              at ReactCompositeComponentWrapper._renderValidatedComponentWithoutOwnerOrContext (jenkins-design-language.js:49570:30)
              at ReactCompositeComponentWrapper._renderValidatedComponent (jenkins-design-language.js:49593:32)
              at ReactCompositeComponentWrapper.performInitialMount (jenkins-design-language.js:49133:30)
              at ReactCompositeComponentWrapper.mountComponent (jenkins-design-language.js:49029:21)
              at Object.mountComponent (jenkins-design-language.js:55369:35)
              at ReactCompositeComponentWrapper.performInitialMount (jenkins-design-language.js:49142:34)
              at ReactCompositeComponentWrapper.mountComponent (jenkins-design-language.js:49029:21)
              at Object.mountComponent (jenkins-design-language.js:55369:35)
              at ReactDOMComponent.mountChildren (jenkins-design-language.js:54331:44)
              at ReactDOMComponent._createInitialChildren (jenkins-design-language.js:50457:32)
              at ReactDOMComponent.mountComponent (jenkins-design-language.js:50276:12)
              at Object.mountComponent (jenkins-design-language.js:55369:35)
              at ReactDOMComponent.mountChildren (jenkins-design-language.js:54331:44)
              at ReactDOMComponent._createInitialChildren (jenkins-design-language.js:50457:32)
              at ReactDOMComponent.mountComponent (jenkins-design-language.js:50276:12)
              at Object.mountComponent (jenkins-design-language.js:55369:35)
              at ReactCompositeComponentWrapper.performInitialMount (jenkins-design-language.js:49142:34)
              at ReactCompositeComponentWrapper.mountComponent (jenkins-design-language.js:49029:21)
              at Object.mountComponent (jenkins-design-language.js:55369:35)
              at ReactCompositeComponentWrapper.performInitialMount (jenkins-design-language.js:49142:34)
          

          Edit: I ended up finding JENKINS-50818 and saw ninjamog's comment about deleting the build that Jenkins was looking for, and afterwards the activity page rendered successfully (see his comment here).

          Anthony Chu added a comment - - edited I am still seeing this TypeError on BlueOcean 1.24.3, Jenkins 2.303.1. Right before this happened, we ran out of space in our /var/jenkins_home  directory, and I ended up clearing out some of the folders in the /var/jenkins_home/workspace directory. Error fetching page TypeError: Cannot read properties of undefined (reading 'toLowerCase') at TimeHarmonizerUtil.getI18nTitle (blueocean-core-js.js:54653:75) at LiveStatusIndicator.render (blueocean-core-js.js:53961:25) at ReactCompositeComponentWrapper._renderValidatedComponentWithoutOwnerOrContext (jenkins-design-language.js:49570:30) at ReactCompositeComponentWrapper._renderValidatedComponent (jenkins-design-language.js:49593:32) at ReactCompositeComponentWrapper.performInitialMount (jenkins-design-language.js:49133:30) at ReactCompositeComponentWrapper.mountComponent (jenkins-design-language.js:49029:21) at Object.mountComponent (jenkins-design-language.js:55369:35) at ReactCompositeComponentWrapper.performInitialMount (jenkins-design-language.js:49142:34) at ReactCompositeComponentWrapper.mountComponent (jenkins-design-language.js:49029:21) at Object.mountComponent (jenkins-design-language.js:55369:35) at ReactDOMComponent.mountChildren (jenkins-design-language.js:54331:44) at ReactDOMComponent._createInitialChildren (jenkins-design-language.js:50457:32) at ReactDOMComponent.mountComponent (jenkins-design-language.js:50276:12) at Object.mountComponent (jenkins-design-language.js:55369:35) at ReactDOMComponent.mountChildren (jenkins-design-language.js:54331:44) at ReactDOMComponent._createInitialChildren (jenkins-design-language.js:50457:32) at ReactDOMComponent.mountComponent (jenkins-design-language.js:50276:12) at Object.mountComponent (jenkins-design-language.js:55369:35) at ReactCompositeComponentWrapper.performInitialMount (jenkins-design-language.js:49142:34) at ReactCompositeComponentWrapper.mountComponent (jenkins-design-language.js:49029:21) at Object.mountComponent (jenkins-design-language.js:55369:35) at ReactCompositeComponentWrapper.performInitialMount (jenkins-design-language.js:49142:34) Edit: I ended up finding JENKINS-50818 and saw ninjamog 's comment about deleting the build that Jenkins was looking for, and afterwards the activity page rendered successfully (see his comment here ).

            sophistifunk Josh McDonald
            c3s4r Cesar Salazar
            Votes:
            9 Vote for this issue
            Watchers:
            17 Start watching this issue

              Created:
              Updated: