Actions
Bug #28748
closedJavascript errors in Foreman Tasks when a task has empty Action
Difficulty:
Triaged:
No
Pull request:
Description
Initially discussed at https://community.theforeman.org/t/javascript-errors-on-tasks-page-with-foreman-1-24-1-katello-3-14-0/16937
I discovered that when I went to the Foreman Tasks page for our Katello installation, the page would end up blank with Javascript errors:
Uncaught (in promise) {rejected: true, message: {…}} Promise.then (async) (anonymous) @ content-script.js:89 Promise.then (async) (anonymous) @ content-script.js:61 react-dom.production.min.js:187 TypeError: Cannot read property ‘replace’ of null at foreman-tasks-9de90616613ba2fa3547.js:1 at Array.map () at Array. (seamless-immutable.development.js:132) at t.selectResults (foreman-tasks-9de90616613ba2fa3547.js:1) at Function.mapToProps (foreman-tasks-9de90616613ba2fa3547.js:1) at r (wrapMapToProps.js:41) at f (selectorFactory.js:44) at selectorFactory.js:63 at Object.run (connectAdvanced.js:21) at s.l.onStateChange (connectAdvanced.js:199)
It was suggested in the discussion that this was due to a task withn an empty Action, and this did turn out to be the case:
-------------------------------------|------------------------------------------------------------------|-----------|---------|---------------------|---------------------|---------------|------------ ID | ACTION | STATE | RESULT | STARTED AT | ENDED AT | OWNER | TASK ERRORS -------------------------------------|------------------------------------------------------------------|-----------|---------|---------------------|---------------------|---------------|------------ f8399e53-b1a2-445c-937f-315d0601d711 | | pending | success | | | |
This is with:
CentOS 7.7 server
Foreman 1.24.1
Katello 3.14.0
foreman-tasks 0.17.5
Actions