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

Uncaught (in promise) TypeError in Integrity monitoring inventory #5210

Closed
juliamagan opened this issue Feb 14, 2023 · 4 comments · Fixed by #5364
Closed

Uncaught (in promise) TypeError in Integrity monitoring inventory #5210

juliamagan opened this issue Feb 14, 2023 · 4 comments · Fixed by #5364
Assignees
Labels
qa/report QA Team: Reporting possible bug type/bug Bug issue

Comments

@juliamagan
Copy link
Member

Wazuh Elastic Rev Security
4.4.0 7.x 03 Basic, ODFE, Xpack
Browser
Firefox

Description
When we access Recent events from an Integrity monitoring inventory file, we get:

Uncaught (in promise) TypeError: scope.updateQueryAndFetch is not a function
    _callee$ https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/plugin/wazuh/wazuh.chunk.10.js:5
    tryCatch https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/plugin/customImportMapDashboards/customImportMapDashboards.plugin.js:6
    invoke https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/plugin/customImportMapDashboards/customImportMapDashboards.plugin.js:6
    defineIteratorMethods https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/plugin/customImportMapDashboards/customImportMapDashboards.plugin.js:6
    fileDetail_asyncGeneratorStep https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/plugin/wazuh/wazuh.chunk.10.js:5
    _next https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/plugin/wazuh/wazuh.chunk.10.js:5
    promise callback*fileDetail_asyncGeneratorStep https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/plugin/wazuh/wazuh.chunk.10.js:5
    _next https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/plugin/wazuh/wazuh.chunk.10.js:5
    fileDetail_asyncToGenerator https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/plugin/wazuh/wazuh.chunk.10.js:5
    fileDetail_asyncToGenerator https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/plugin/wazuh/wazuh.chunk.10.js:5
    checkFilterManager https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/plugin/wazuh/wazuh.chunk.10.js:5
    openEventCurrentWindow https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/plugin/wazuh/wazuh.chunk.10.js:5
    FileDetails https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/plugin/wazuh/wazuh.chunk.10.js:5
    navigateToModule https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/plugin/wazuh/wazuh.chunk.10.js:5
    FileDetails https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/plugin/wazuh/wazuh.chunk.10.js:5
    onMouseDown https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/plugin/wazuh/wazuh.chunk.10.js:5
    s https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:443
    f https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:443
    m https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:443
    m https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:443
    at https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:443
    ot https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:443
    st https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:443
    ft https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:443
    D https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:443
    F https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:443
    Jt https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:443
    Zt https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:443
    unstable_runWithPriority https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:451
    $o https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:443
    W https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:443
    Gt https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:443
    Vt https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:443
    Yt https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:443
    ht https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:443
    cn https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:443
    Ka https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:443
    lc https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:443
    uc https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:443
    sc https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:443
    Qs https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:443
    Yo https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:443
    unstable_runWithPriority https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:451
    $o https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:443
    Yo https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:443
    B https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:451
    onmessage https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:451
    __osdSharedDeps__ https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:451
    a https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:1
    __osdSharedDeps__ https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:443
    a https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:1
    __osdSharedDeps__ https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:443
    a https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:1
    __osdSharedDeps__ https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:359
    a https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:1
    __osdSharedDeps__ https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:389
    a https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:1
    n https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:1
    __osdSharedDeps__ https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:1
    <anonymous> https://demo-440-rc1-wazuh-45bf2715ce73498d.elb.us-west-1.amazonaws.com/44003/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:1

Preconditions

  1. Demo environment

Steps to reproduce

  1. Navigate to Integrity monitoring>Inventory
  2. Click on a file
  3. Click on Recent events

Expected Result

  1. No errors

Actual Result

  1. Uncaught (in promise) TypeError: scope.updateQueryAndFetch is not a function

Screenshots

2023-02-14.12-44-22.mp4
@juliamagan juliamagan added the type/bug Bug issue label Feb 14, 2023
@juliamagan juliamagan added the qa/report QA Team: Reporting possible bug label Feb 14, 2023
@gdiazlo gdiazlo moved this from Triage to Known Issue in Release 4.4.0 Feb 14, 2023
@AlexRuiz7
Copy link
Member

Reproducible in 4.3.10

@Machi3mfl
Copy link
Member

Current issue

The TypeError occurs because the updateQueryAndFetch is not defined in the scope instance.

Research

The scope variable doesn't have defined the updateQueryAndFetch method in any code file. This can be possible because the scope variable is passed from the indexer. But research in the indexer code does not exist any updateQueryAndFetch reference.
Because of that, I decided to check if the behavior is working as expected.

Expected behavior

When we click on the Recents events button, the user would be redirected to the Events tab and would see the events related to the file row clicked.

Kazam_screencast_00013.mp4

Conclusion

The Recents events works as expected without using the scope.updateQueryAndFetch method

@Machi3mfl
Copy link
Member

Machi3mfl commented Mar 7, 2023

Steps to add error management solution

  1. Get the error line code that is throwing the error and get the method.
  2. Check if the method has a try-catch block to manage the error produced.
  3. Add the error handler class to receive the error and decide how to treat the error.
    • In this only we gonna send the error without a custom title o message.

https://github.com/wazuh/wazuh-kibana-app/blob/e10ce5f877e6b02611df6124263b93b645dcf6ea/public/components/agents/fim/inventory/fileDetail.tsx#L231-L254

  1. If the error thrown is a Native Javascript error in the console browser we gonna see the error details.

image

Instead, if the error is an HTTP error, the error details will be shown in a UI toast.

@mauromalara
Copy link

Same in Safari:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
qa/report QA Team: Reporting possible bug type/bug Bug issue
Projects
No open projects
Status: Known Issue
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants