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

Remove router Internal Error in server console #4650

Closed
Tracked by #4160
Machi3mfl opened this issue Oct 5, 2022 · 10 comments · Fixed by #4710
Closed
Tracked by #4160

Remove router Internal Error in server console #4650

Machi3mfl opened this issue Oct 5, 2022 · 10 comments · Fixed by #4710
Assignees
Labels
platform/wazuh Affects the application when deployed on the Wazuh-Dashboard platform. type/bug Bug issue

Comments

@Machi3mfl
Copy link
Member

Wazuh Elastic
4.4 >1.x
Browser
Chrome, Firefox, Safari, etc

Description
The server console log shows an Internal Server Error when the browser makes a request and fails.
We need to make this error more readable.

Steps to reproduce

  1. Navigate into the Wazuh plugin
  2. Check the server console

Screenshots
image

@Machi3mfl Machi3mfl added type/bug Bug issue platform/wazuh Affects the application when deployed on the Wazuh-Dashboard platform. labels Oct 5, 2022
@Machi3mfl Machi3mfl self-assigned this Oct 5, 2022
@asteriscos asteriscos self-assigned this Oct 13, 2022
@asteriscos
Copy link
Member

So far I tried to force an error making bad requests, but still couldn't replicate the error.

image

image

Navigating to Wazuh plugin Home page was not enough. If possible, please share more context or details on how to trigger the error. In the meantime, I will continue with the tests.

@asteriscos
Copy link
Member

asteriscos commented Oct 13, 2022

I ran tests with Kibana 7.10.2 (ODFE) and Opensearch 2.3.0 without being able to reproduce the issue at will. The first time I started the Opensearch environment the error was thrown after logging in, but I couldn't replicate it after several tries.

image

Screenshot from 2022-10-13 18-56-03

I couldn't find any relevant log, tests are still in progress.

@asteriscos
Copy link
Member

Related Kibana issue:
elastic/kibana#117371

@Desvelao Desvelao self-assigned this Oct 14, 2022
@asteriscos
Copy link
Member

asteriscos commented Oct 14, 2022

Tested with Kibana 7.10.2 X-Pack without results:

image

In this test some other security errors happened, but nothing related to this issue:

image

@asteriscos
Copy link
Member

@Desvelao
Copy link
Member

Desvelao commented Oct 14, 2022

I didn't get to replicate the error.

My test environments were:

  • Kibana 7.10.2 ODFE (Development environment - Branch 4.3-7.10)
  • Kibana 7.17.4 X-Pack (Production) Wazuh 4.3.8

@Desvelao
Copy link
Member

Desvelao commented Oct 14, 2022

I tried with the suggested environment and I could not replicate the problem.

Test environment:

  • OpenSearch Dashboards tag 2.3.0 in development mode
  • Wazuh plugin branch 4.4-1.2-wzd
  • OpenSearch Dashboards Security plugin tag 2.3.0.0

@asteriscos
Copy link
Member

asteriscos commented Oct 14, 2022

Here's a reference mentioning a possible template issue:
https://discuss.elastic.co/t/kibana-metrics-500-internal-server-error/238260/2

And this is the PR that added the error control. It could provide some insight.
https://github.com/elastic/kibana/pull/42442/files#diff-5910e242921a54270639c9035efa905a958ccead20dfd8ff3758ffc1d97ce161R119

@asteriscos
Copy link
Member

asteriscos commented Oct 17, 2022

I managed to replicate it at will with the new environments with Opensearch 1.2.4 and some mocked Wazuh Manager API configurations.

Screenshot from 2022-10-17 17-27-40

Whenever a connection fails, it logs this exception. What I'm still trying to figure out, is why in other dev environments this does not happen.

@asteriscos
Copy link
Member

asteriscos commented Oct 17, 2022

It seems Opensearch logs an exception in the console when Wazuh plugin API returns a code 500 error, regardless if it is controlled. This does not happen when some other code error is returned, like a code 503 Service unavailable for example.

In this case, the exception is produced when our plugin checks if Wazuh API is available, which is an expected possibility. So a possible solution to avoid the error in the console would be use a code 503 Service unavailable when Wazuh API is down.

I suggest to review Wazuh plugin API code errors to avoid using a generic Internal server error code 500.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform/wazuh Affects the application when deployed on the Wazuh-Dashboard platform. type/bug Bug issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants