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
Updated by Maria Agaphontzev about 5 years ago
- Category set to Foreman plugin
- Assignee set to Maria Agaphontzev
Updated by John Beranek about 5 years ago
I'm thinking the task is rather stale, given the dates:
foreman=# select * from foreman_tasks_tasks where action = ''; id | type | label | started_at | ended_at | state | result | external_id | parent_task_id | start_at | start_before | action | state_updated_at | user_id --------------------------------------+---------------------------------+-------+------------+----------+---------+---------+--------------------------------------+----------------+----------------------------+--------------+--------+----------------------------+-------- - f8399e53-b1a2-445c-937f-315d0601d711 | ForemanTasks::Task::DynflowTask | | | | pending | success | 1eaea9eb-9101-41af-8b25-cc6598fdb65a | | 2019-09-07 00:00:22.441503 | | | 2019-09-07 00:00:23.451612 | (1 row)
Updated by The Foreman Bot about 5 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman-tasks/pull/498 added
Updated by The Foreman Bot about 5 years ago
- Fixed in Releases foreman-tasks-1.0.1 added
Updated by Maria Agaphontzev about 5 years ago
- Status changed from Ready For Testing to Closed
Applied in changeset e403ea9daa8d9bde98c542d1f77bbef5848804bd.
Actions