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

TypeError and Could not fetch data for this agent messages found after using the API Console #6211

Closed
rauldpm opened this issue Dec 13, 2023 · 1 comment · Fixed by #6224
Closed
Assignees
Labels
level/task Task issue type/bug Bug issue

Comments

@rauldpm
Copy link
Member

rauldpm commented Dec 13, 2023

Wazuh Rev Browser
4.7.0 (OVA) 03 Brave

Description

After making some requests in the WUI using the API Console tool, an error was obtained when "navigating back" indicating a TypeError

https://192.168.57.19/app/wazuh#/agents?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:now-24h,to:now))&_a=(columns:!(_source),filters:!(),index:'wazuh-alerts-*',interval:auto,query:(language:kuery,query:''),sort:!())

When trying to reproduce it, this other behavior was found: Could not fetch data for this agent.

Preconditions

Steps to reproduce

  1. Navigate to Wazuh -> Agents -> Most active agent
  2. Click on Wazuh -> Tools -> API Console
  3. Type GET /agents?_ and click on Run
  4. A message stating Could not fetch data for this agent appeared

Expected Result

  1. The most active agent page should be shown

Actual Result

  1. Message of not agent data found or TypeError

Screenshots

https://192.168.57.19/app/wazuh#/agents?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:now-24h,to:now))&_a=(columns:!(_source),filters:!(),index:'wazuh-alerts-*',interval:auto,query:(language:kuery,query:''),sort:!())

image

https://192.168.57.19/app/wazuh#/agents?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:now-24h,to:now))&tabView=panels&tab=welcome

image

Additional context

I have not been able to reproduce the TypeError, but I think it is produced for some wrong API Console input

Maybe related: #4104 (note: this issue does not report an error in red)
Maybe related: #5332

  • Console error when the Could not fetch... message appears
Uncaught (in promise) Error: TypeError: Cannot read properties of null (reading 'id')
    at AgentsController._callee7$ (wazuh.chunk.10.js:1:9006961)
    at tryCatch (customImportMapDashboards.plugin.js:13:786910)
    at Generator.invoke [as _invoke] (customImportMapDashboards.plugin.js:13:790926)
    at Generator.next (customImportMapDashboards.plugin.js:13:788105)
    at agents_asyncGeneratorStep (wazuh.chunk.10.js:1:8987106)
    at _next (wazuh.chunk.10.js:1:8987423)
    at wazuh.chunk.10.js:1:8987587
    at new Promise (<anonymous>)
    at AgentsController.<anonymous> (wazuh.chunk.10.js:1:8987335)
    at AgentsController.getAgent (wazuh.chunk.10.js:1:9007099)
  • Console error when the TypeError message appears
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'split')
    at _callee4$ (reportsDashboards.plugin.js:24:201073)
    at tryCatch (reportsDashboards.plugin.js:24:180012)
    at Generator.invoke [as _invoke] (reportsDashboards.plugin.js:24:183963)
    at Generator.next (reportsDashboards.plugin.js:24:181151)
    at asyncGeneratorStep (reportsDashboards.plugin.js:1:73707)
    at _next (reportsDashboards.plugin.js:1:74018)
    at reportsDashboards.plugin.js:1:74168
    at new Promise (<anonymous>)
    at reportsDashboards.plugin.js:1:73930
    at checkURLParams (reportsDashboards.plugin.js:24:202215)
@rauldpm rauldpm added type/bug Bug issue level/task Task issue labels Dec 13, 2023
@Tostti Tostti self-assigned this Dec 14, 2023
@wazuhci wazuhci moved this to In progress in Release 4.7.2 Dec 15, 2023
@Tostti Tostti linked a pull request Dec 15, 2023 that will close this issue
6 tasks
@wazuhci wazuhci moved this from In progress to Pending review in Release 4.7.2 Dec 15, 2023
@Tostti
Copy link
Member

Tostti commented Dec 15, 2023

PR successfully merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
level/task Task issue type/bug Bug issue
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants