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

Error generating PDF report in Github module #5065

Closed
asteriscos opened this issue Jan 4, 2023 · 0 comments · Fixed by #5068, #5069 or #5070
Closed

Error generating PDF report in Github module #5065

asteriscos opened this issue Jan 4, 2023 · 0 comments · Fixed by #5068, #5069 or #5070
Assignees
Labels
type/bug Bug issue

Comments

@asteriscos
Copy link
Member

Wazuh Elastic Rev Security
4.3 7.x 4xxx Basic, ODFE, Xpack
Browser
Chrome, Firefox, Safari, etc

Description

In the Github module when the pinned agent state changes and one tries to generate a PDF report, it fails with the error:

Screenshot from 2023-01-04 13-01-43
Screenshot from 2023-01-04 13-01-49

Peek 2023-01-04 10-06

This endpoint requires the body of the request to have these properties:
http://localhost:5601/reports/modules/github

body: schema.object({
          array: schema.any(),
          browserTimezone: schema.string(),
          filters: schema.maybe(schema.any()),
          agents: schema.maybe(schema.oneOf([agentIDValidation, schema.boolean()])),
          components: schema.maybe(schema.any()),
          searchBar: schema.maybe(schema.string()),
          section: schema.maybe(schema.string()),
          tab: schema.string(),
          tables: schema.maybe(schema.any()),
          time: schema.oneOf([schema.object({
            from: schema.string(),
            to: schema.string()
          }), schema.string()]),
          indexPatternTitle: schema.string(),
          apiId: schema.string()
        }),

When the report request is made, it tries to obtain the applied filters from the visualizations:
Screenshot from 2023-01-04 10-22-11
Screenshot from 2023-01-04 10-21-41

But when the pinned agent state changes it removes all the visualizations from the array:
Screenshot from 2023-01-04 10-20-35

And it doesn't re-run the constructor to reset the properties that allow to push the visualizations to the list:
Screenshot from 2023-01-04 10-19-27
Screenshot from 2023-01-04 10-18-42

Preconditions

  1. Have alerts in Github module

Steps to reproduce

  1. Navigate to Modules -> Github -> Dashboard
  2. Click on Explore agent button
  3. Select an agent
  4. Click on Generate report button
  5. See the toast with the exception [request body.time]: expected at least one defined value but got [undefined]

Expected Result

  1. Generate PDF report

Actual Result

  1. Toast with the exception [request body.time]: expected at least one defined value but got [undefined]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment