wazuh-dashboard-plugins icon indicating copy to clipboard operation
wazuh-dashboard-plugins copied to clipboard

Console error when I have an agent selected and environment change

Open damarisg opened this issue 2 years ago • 2 comments

Wazuh Elastic Rev Security
4.5.0 7.x 4xxx Basic, ODFE, Xpack
Browser
Firefox 115.0.2 (64-bit)


Description

The goal of this test is to move between the environments without getting errors.

It is detected that when we have more agents in an environment and then we move them to another that has less, it generates an error.

This happens because if we select the agent with ID 002 in Env-1, and then move to Env-2, what it does is change the environments and keep agent ID 002 that there is inside Env-2.

Now, as in this case, Env-1 has 4 agents, and Env-2 only 2 agents. When I select the agent with ID 004 that exists in Env-1, and then I move to Env-2 as that ID does not exist, it generates the error.

I propose two solutions:

  • Option 1: Keep the behavior and fix the console error
  • Option 2: When changing the environment, redirect the page to the home panel.

Note: Found on Demo environment 4.5.0 in testing E2E.


Preconditions

  1. Should be have more agent in env-1 than env-2

Steps to reproduce

  1. Navigate to 'Agents' where the API env-1 is selected.
  2. Click on the last agent added to the list. Remember this ID shouldn't exist on env-2.
  3. Click on API and change env-1 to env-2.

Expected Result

  1. It shows a message: Could not get data for this agent.
  2. It doesn't show an error in the console.

Actual Result

  1. It shows a message: Could not get data for this agent.
  2. It shows an error in the console:

    Uncaught (in promise) Error: Error: No agent information was returned (1701) - Agent does not exist

Screenshots

Details of Error: No agent information was returned (1701) - Agent does not exist
_callee12$ https://demo.wazuh.info/45001/bundles/plugin/wazuh/wazuh.chunk.10.js:5
tryCatch https://demo.wazuh.info/45001/bundles/plugin/customImportMapDashboards/customImportMapDashboards.plugin.js:13
invoke https://demo.wazuh.info/45001/bundles/plugin/customImportMapDashboards/customImportMapDashboards.plugin.js:13
defineIteratorMethods https://demo.wazuh.info/45001/bundles/plugin/customImportMapDashboards/customImportMapDashboards.plugin.js:13
agents_asyncGeneratorStep https://demo.wazuh.info/45001/bundles/plugin/wazuh/wazuh.chunk.10.js:5
_throw https://demo.wazuh.info/45001/bundles/plugin/wazuh/wazuh.chunk.10.js:5
promise callback*agents_asyncGeneratorStep https://demo.wazuh.info/45001/bundles/plugin/wazuh/wazuh.chunk.10.js:5
_next https://demo.wazuh.info/45001/bundles/plugin/wazuh/wazuh.chunk.10.js:5
agents_asyncToGenerator https://demo.wazuh.info/45001/bundles/plugin/wazuh/wazuh.chunk.10.js:5
agents_asyncToGenerator https://demo.wazuh.info/45001/bundles/plugin/wazuh/wazuh.chunk.10.js:5
getAgent https://demo.wazuh.info/45001/bundles/plugin/wazuh/wazuh.chunk.10.js:5
_callee2$ https://demo.wazuh.info/45001/bundles/plugin/wazuh/wazuh.chunk.10.js:5
tryCatch https://demo.wazuh.info/45001/bundles/plugin/customImportMapDashboards/customImportMapDashboards.plugin.js:13
invoke https://demo.wazuh.info/45001/bundles/plugin/customImportMapDashboards/customImportMapDashboards.plugin.js:13
defineIteratorMethods https://demo.wazuh.info/45001/bundles/plugin/customImportMapDashboards/customImportMapDashboards.plugin.js:13
agents_asyncGeneratorStep https://demo.wazuh.info/45001/bundles/plugin/wazuh/wazuh.chunk.10.js:5
_next https://demo.wazuh.info/45001/bundles/plugin/wazuh/wazuh.chunk.10.js:5
agents_asyncToGenerator https://demo.wazuh.info/45001/bundles/plugin/wazuh/wazuh.chunk.10.js:5
agents_asyncToGenerator https://demo.wazuh.info/45001/bundles/plugin/wazuh/wazuh.chunk.10.js:5
getAgent https://demo.wazuh.info/45001/bundles/plugin/wazuh/wazuh.chunk.10.js:5
_callee6$ https://demo.wazuh.info/45001/bundles/plugin/wazuh/wazuh.chunk.10.js:5
tryCatch https://demo.wazuh.info/45001/bundles/plugin/customImportMapDashboards/customImportMapDashboards.plugin.js:13
invoke https://demo.wazuh.info/45001/bundles/plugin/customImportMapDashboards/customImportMapDashboards.plugin.js:13
defineIteratorMethods https://demo.wazuh.info/45001/bundles/plugin/customImportMapDashboards/customImportMapDashboards.plugin.js:13
agents_asyncGeneratorStep https://demo.wazuh.info/45001/bundles/plugin/wazuh/wazuh.chunk.10.js:5
_next https://demo.wazuh.info/45001/bundles/plugin/wazuh/wazuh.chunk.10.js:5
promise callback*agents_asyncGeneratorStep https://demo.wazuh.info/45001/bundles/plugin/wazuh/wazuh.chunk.10.js:5
_next https://demo.wazuh.info/45001/bundles/plugin/wazuh/wazuh.chunk.10.js:5
agents_asyncToGenerator https://demo.wazuh.info/45001/bundles/plugin/wazuh/wazuh.chunk.10.js:5
agents_asyncToGenerator https://demo.wazuh.info/45001/bundles/plugin/wazuh/wazuh.chunk.10.js:5
$onInit https://demo.wazuh.info/45001/bundles/plugin/wazuh/wazuh.chunk.10.js:5
ae https://demo.wazuh.info/45001/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:428
_ https://demo.wazuh.info/45001/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:428
ae https://demo.wazuh.info/45001/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:428
ce https://demo.wazuh.info/45001/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:428
ie https://demo.wazuh.info/45001/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:428
link https://demo.wazuh.info/45001/bundles/plugin/wazuh/wazuh.chunk.11.js:48
de https://demo.wazuh.info/45001/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:428
Ne https://demo.wazuh.info/45001/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:428
ae https://demo.wazuh.info/45001/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:428
ce https://demo.wazuh.info/45001/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:428
ie https://demo.wazuh.info/45001/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:428
ge https://demo.wazuh.info/45001/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:428
r https://demo.wazuh.info/45001/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:428
m https://demo.wazuh.info/45001/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:428
update https://demo.wazuh.info/45001/bundles/plugin/wazuh/wazuh.chunk.11.js:48
$broadcast https://demo.wazuh.info/45001/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:428
commitRoute https://demo.wazuh.info/45001/bundles/plugin/wazuh/wazuh.chunk.11.js:48
p https://demo.wazuh.info/45001/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:428
p https://demo.wazuh.info/45001/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:428
$digest https://demo.wazuh.info/45001/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:428
evalAsync https://demo.wazuh.info/45001/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:428
completeTask https://demo.wazuh.info/45001/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:428
r https://demo.wazuh.info/45001/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:428
setTimeout handler*un/i.defer https://demo.wazuh.info/45001/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:428
$evalAsync https://demo.wazuh.info/45001/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:428
wazuh.chunk.10.js:5:5085522
Details of Scenario with a video

damarisg avatar Jul 28 '23 14:07 damarisg

This is a known issue, present in older versions of Wazuh. The use case for this feature needs to be reworked. This should not be a stopper for 4.5.0.

gdiazlo avatar Aug 02 '23 09:08 gdiazlo

We will investigate the optimal solution for this in a future release.

asteriscos avatar Oct 31 '23 17:10 asteriscos

This fix will be fixed in this issue, that refactors the pinned agent management.

  • https://github.com/wazuh/wazuh-dashboard-plugins/issues/6644 I'm closing this.

asteriscos avatar May 13 '24 10:05 asteriscos