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

[MD] Data source client error handling #4278

Closed
kristenTian opened this issue Jun 12, 2023 · 2 comments
Closed

[MD] Data source client error handling #4278

kristenTian opened this issue Jun 12, 2023 · 2 comments
Labels
multiple datasource multiple datasource project

Comments

@kristenTian
Copy link
Contributor

When install sample data source, the existing behavior is try to delete the existing sample index for clean up. (Given there are more categories to determine if sample data is installed ).

The existing code will try catch the error and ignore given it's not a real error case. see:

try {
await context.core.opensearch.legacy.client.callAsCurrentUser('indices.delete', {
index,
});
} catch (err) {
// ignore delete errors
}

However for data source use case, the error will still be thrown out:

server    log   [19:14:58.425] [error][data-source-service][dataSource][legacy][plugins] Failed to get data source client for dataSourceId: [ab9c3560-0893-11ee-b470-6bd66995313a]. [index_not_found_exception] no such index [opensearch_dashboards_sample_data_flights], with { index="opensearch_dashboards_sample_data_flights" & resource.id="opensearch_dashboards_sample_data_flights" & resource.type="index_or_alias" & index_uuid="_na_" } :: {"path":"/opensearch_dashboards_sample_data_flights","query":{},"statusCode":404,"response":"{\"error\":{\"root_cause\":[{\"type\":\"index_not_found_exception\",\"reason\":\"no such index [opensearch_dashboards_sample_data_flights]\",\"index\":\"opensearch_dashboards_sample_data_flights\",\"resource.id\":\"opensearch_dashboards_sample_data_flights\",\"resource.type\":\"index_or_alias\",\"index_uuid\":\"_na_\"}],\"type\":\"index_not_found_exception\",\"reason\":\"no such index [opensearch_dashboards_sample_data_flights]\",\"index\":\"opensearch_dashboards_sample_data_flights\",\"resource.id\":\"opensearch_dashboards_sample_data_flights\",\"resource.type\":\"index_or_alias\",\"index_uuid\":\"_na_\"},\"status\":404}"}: Error: [index_not_found_exception] no such index [opensearch_dashboards_sample_data_flights], with { index="opensearch_dashboards_sample_data_flights" & resource.id="opensearch_dashboards_sample_data_flights" & resource.type="index_or_alias" & index_uuid="_na_" }
    at respond (/Users/tyarong/repository/OpenSearch-Dashboards/node_modules/elasticsearch/src/lib/transport.js:349:15)
    at checkRespForFailure (/Users/tyarong/repository/OpenSearch-Dashboards/node_modules/elasticsearch/src/lib/transport.js:306:7)
    at HttpConnector.<anonymous> (/Users/tyarong/repository/OpenSearch-Dashboards/node_modules/elasticsearch/src/lib/connectors/http.js:173:7)
    at IncomingMessage.wrapper (/Users/tyarong/repository/OpenSearch-Dashboards/node_modules/lodash/lodash.js:4991:19)
    at IncomingMessage.emit (node:events:525:35)
    at IncomingMessage.emit (node:domain:489:12)
    at endReadableNT (node:internal/streams/readable:1359:12)
    at processTicksAndRejections (node:internal/process/task_queues:82:21)
@HarshPanchal26
Copy link

Hey I am interested to solve this , Can you assign it to me ?

@zhongnansu
Copy link
Member

@kristenTian Hi Kristan, is this being resolved, can we close?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
multiple datasource multiple datasource project
Projects
None yet
Development

No branches or pull requests

4 participants