opensearch-project / opensearch-go

Go Client for OpenSearch
https://opensearch.org/docs/latest/clients/go/
Apache License 2.0
188 stars 96 forks source link

[BUG] not reporting when failed index #525

Closed RodrigoDornelles closed 2 months ago

RodrigoDornelles commented 2 months ago

What is the bug?

How can one reproduce the bug?

There is no error log when there is a wrong configuration, such as failed SSL, wrong DNS, permission error...

What is the expected behavior?

correct config logs

2024-04-08T14:00:03Z D! [outputs.opensearch] indexName- github_push-audit-2024_04_08
2024-04-08T14:00:03Z D! [outputs.opensearch] Indexed to OpenSearch with status- [201] Result- created DocumentID- c61b1e60c648cc1fc86222e059d36d89c3eee5db49d4d36b16a96d0fbbcc22b9 
2024-04-08T14:00:03Z D! [outputs.opensearch] Successfully indexed [1] documents
2024-04-08T14:00:03Z D! [outputs.opensearch] Wrote batch of 346 metrics in 73.075738ms
2024-04-08T14:00:03Z D! [outputs.opensearch] Buffer fullness: 0 / 10000 metrics

wrong config logs

2024-04-08T14:00:03Z D! [outputs.opensearch] indexName- github_push-audit-2024_04_08
2024-04-08T14:00:03Z D! [outputs.opensearch] Successfully indexed [1] documents
2024-04-08T14:00:03Z D! [outputs.opensearch] Wrote batch of 346 metrics in 73.075738ms
2024-04-08T14:00:03Z D! [outputs.opensearch] Buffer fullness: 0 / 10000 metrics

expected with wrong config logs

2024-04-08T14:00:03Z D! [outputs.opensearch] indexName- github_push-audit-2024_04_08
2024-04-08T14:00:03Z D! [outputs.opensearch] some error message about failed
2024-04-08T14:00:03Z D! [outputs.opensearch] Failed trying indexing [1] documents

What is your host/environment?

Linux 5.15, Docker 26.0, Telegraf 1.30.1

Do you have any additional context?

issue related https://github.com/influxdata/telegraf/issues/15119 https://github.com/influxdata/telegraf/issues/14334

Jakob3xD commented 2 months ago

@RodrigoDornelles can you please give us more information and some clear instructions on how to reproduce this. Especially for ppl. who don't use telegraf. Moreover the http bulk response would be interesting.

As a note to us: telegraf uses v2 of opensearch-go

RodrigoDornelles commented 2 months ago

As you can see in issue https://github.com/influxdata/telegraf/issues/15119, using any configuration with valid syntax, but incorrect parameters such as password or host will reproduce the error.

who said there was a possibility that the problem could be in this plugin was @powersj with his comment https://github.com/influxdata/telegraf/issues/15119#issuecomment-2051713377

dblock commented 2 months ago

So this problem only happens with telegraf? If so sounds like an issue with that agent rather than a problem with the library itself. Any objections we close this here @RodrigoDornelles, or do you have reasons to believe the client is the issue?

RodrigoDornelles commented 2 months ago

I haven't tested it elsewhere, well if there is a feature that reports errors in the plugin, the error is certainly not here.

dblock commented 2 months ago

Looks like this was root caused in https://github.com/influxdata/telegraf/issues/15119#issuecomment-2057093872.