API Error

348 views
Skip to first unread message

Munawar P

unread,
Apr 30, 2024, 1:56:23 AM4/30/24
to Wazuh | Mailing List
Hello Team,

I was face an issue with starting wazuh dashboard, it shows API error. Its resolved when i restart the service, but i don't know why this error happened.
Could anyone please help to find the problem and why it happened?

This is the error seen on dashboard:
RequestError: Error: 3002 - Request failed with status code 500
    at Function._callee$ (https://*******/47103/bundles/plugin/wazuh/wazuh.plugin.js:1:182265)
    at tryCatch (https://*********/47103/bundles/plugin/customImportMapDashboards/customImportMapDashboards.plugin.js:13:786910)
    at Generator.invoke [as _invoke] (https://******/47103/bundles/plugin/customImportMapDashboards/customImportMapDashboards.plugin.js:13:790926)
    at Generator.throw (https://********/47103/bundles/plugin/customImportMapDashboards/customImportMapDashboards.plugin.js:13:788105)
    at asyncGeneratorStep (https://*********/47103/bundles/plugin/wazuh/wazuh.plugin.js:1:178377)
    at _throw (https://********/47103/bundles/plugin/wazuh/wazuh.plugin.js:1:178774)

Oluwaseyi Soneye

unread,
Apr 30, 2024, 3:26:23 AM4/30/24
to Wazuh | Mailing List

Hello,

Error 500 is generic and could be indicating an issue with the Wazuh API server. It is possible the service failed to start or was not ready. A review of the full log specifically at the time of the error would help in pinpointing what could have caused the issue. You can check the API logs.

Also, check manually if both the UI and the API are using the same version.
To check the version of the API, run: /var/ossec/bin/wazuh-control -j info
To check the version of the UI, navigate to Wazuh < Settings < About.
app/wazuh#/settings?tab=about

Also, check the app logs /usr/share/wazuh-dashboard/data/wazuh/logs/wazuhapp.log.

Munawar P

unread,
Apr 30, 2024, 4:21:01 AM4/30/24
to Wazuh | Mailing List
Hi,

I check all the things you mentioned, but cant find the RCA.
Also the wazuhapp.log not in the sever. Here i am attaching the log from the api.log and the version check.

Waiting for your response.
Thank you.

The logs:

2024/04/30 08:52:50 INFO: wazuh-wui 10.242.79.40 "GET /manager/info" with parameters {} and body {} done in 10.033s: 500
2024/04/30 08:52:57 INFO: wazuh-wui 10.242.79.40 "GET /security/users/me/policies" with parameters {} and body {"idHost": "default"} done in 0.266s: 200
2024/04/30 08:52:57 INFO: wazuh-wui 10.242.79.40 "GET /" with parameters {} and body {} done in 0.020s: 200
2024/04/30 08:52:57 INFO: wazuh-wui 10.242.79.40 "POST /security/user/authenticate" with parameters {} and body {} done in 0.686s: 200
2024/04/30 08:52:58 INFO: wazuh-wui 10.242.79.40 "GET /manager/info" with parameters {} and body {} done in 9.157s: 200
2024/04/30 08:52:59 INFO: wazuh-wui 10.242.79.40 "GET /manager/info" with parameters {} and body {} done in 8.559s: 200
2024/04/30 08:52:59 INFO: wazuh-wui 10.242.79.40 "POST /security/user/authenticate" with parameters {} and body {} done in 0.552s: 200
2024/04/30 08:53:00 ERROR: Timeout executing API request
Screenshot from 2024-04-30 13-50-46.png
Screenshot from 2024-04-30 13-50-23.png

Oluwaseyi Soneye

unread,
Apr 30, 2024, 5:04:17 AM4/30/24
to Wazuh | Mailing List
In that case, it's possible the APIs request per minute was exceeded.

Was there any recent change? Perhaps the Wazuh APi was unable to load before the timeout time was exceeded.

To prevent a future recurrence, you can increase the API timeout duration from the web interface.  Go to Wazuh / Settings / Configuration under the name Request timeout .

Munawar P

unread,
Apr 30, 2024, 5:37:56 AM4/30/24
to Wazuh | Mailing List
Hi,

No changes are done recently.
Could you please explain the reason deeply?
Thank you for your response.

Oluwaseyi Soneye

unread,
Apr 30, 2024, 7:24:00 AM4/30/24
to Wazuh | Mailing List
A timeout can occur for different reasons. It could be a result of resource constraints like an overloaded server or limited resources (CPU, memory). It can also be due to network issues like connectivity problems or firewall restrictions. As you mentioned no change was made, it is possible the timeout occurred due to a temporary connection issue. This is especially likely since a restart solved your issue.
Reply all
Reply to author
Forward
0 new messages