Skip to content

Improve error messaging if no Kibana endpoint is configured. #1114

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

Merged
merged 1 commit into from
Apr 25, 2025

Conversation

gigerdo
Copy link
Member

@gigerdo gigerdo commented Apr 25, 2025

Fixes two issues that lead to confusing errors being shown:

  • The agent_policy resource did not throw an error if getting the stack version fails
  • When getting the stack version fails, it only returned the http connection error, not actually stating what it was trying to do.

In combination this will now lead to an error like

Error: failed to get version from Kibana API: Get "http://localhost:5601/api/status": dial tcp [::1]:5601: connect: connection refused, Please ensure a working 'kibana' endpoint is configured.

@gigerdo gigerdo requested review from tobio and a team April 25, 2025 08:23
Fixes two issues that lead to confusing errors being shown:

- The `agent_policy` resource did not throw an error if getting the stack version fails
- When getting the stack version fails, it only returned the http connection error, not actually stating what it was trying to do.

In combination this will now lead to an error like
```
Error: failed to get version from Kibana API. Please ensure a working 'kibana' endpoint is configured. Error: Get "http://localhost:5601/api/status": dial tcp [::1]:5601: connect: connection refused
 ``
Copy link

@claudia-correia claudia-correia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍🏻

@gigerdo gigerdo merged commit 44b055a into elastic:main Apr 25, 2025
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants