Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid root for alerts payload #86

Closed
bzurkowski opened this issue Sep 1, 2020 · 0 comments · Fixed by #87
Closed

Invalid root for alerts payload #86

bzurkowski opened this issue Sep 1, 2020 · 0 comments · Fixed by #87
Assignees
Labels
bug Something isn't working

Comments

@bzurkowski
Copy link
Member

bzurkowski commented Sep 1, 2020

After deployment in testbed, alerts dashboard fails with error:

TypeError: Cannot read property 'map' of undefined
    at Alerts.js:26

Code:

  loadData() {
    axios.get(process.env.REACT_APP_BACKEND_HOST + '/v1/alerts')
      .then((response) => {
        const alerts = response.data.alerts.map(alert => {
          alert.updated_at = new Date(1000 * alert.updated_at);
          return alert;
        });
...

There is no alerts root in alerts payload:

[
    {
        "id": "falco-alert-attach/exec-pod-pod-arangodb-7fc5bc8fbc-bz7w2-rca",
        "origin": "falco",
        "name": "Attach/Exec Pod",
        "message": "18:27:54.593231872: Notice Attach/Exec to pod (user=kubernetes-admin pod=arangodb-7fc5bc8fbc-bz7w2 ns=rca action=exec command=python3)",
        "severity": "Notice",
        "source": {
            "origin": null,
            "kind": null,
            "properties": {
                "name": null,
                "namespace": "n/a"
            }
        },
        "created_at": "1598293671",
        "updated_at": "1598293683"
    },
@bzurkowski bzurkowski added the bug Something isn't working label Sep 1, 2020
@bzurkowski bzurkowski self-assigned this Sep 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant