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

[DOC] Update error_trace URL parameter description #1235

Closed
1 of 4 tasks
xuezhou25 opened this issue Sep 15, 2022 · 1 comment · Fixed by #1403
Closed
1 of 4 tasks

[DOC] Update error_trace URL parameter description #1235

xuezhou25 opened this issue Sep 15, 2022 · 1 comment · Fixed by #1403
Assignees
Labels
2 - In progress Issue/PR: The issue or PR is in progress. 3 - Tech review PR: Tech review in progress good first issue Good for newcomers v-All This issue is valid for all versions through 1.3
Milestone

Comments

@xuezhou25
Copy link
Contributor

What do you want to do?

  • Request a change to existing documentation
  • Add new documentation
  • Report a technical problem with the documentation
  • Other

Tell us about your request. Provide a summary of the request and all versions that are affected.
Coming from this issue#4255
The description of Stack traces in OpenSearch documentation is not comprehensive and may leading to some misunderstanding.

"To include the error stack trace in the response when an exception is raised, add error_trace=true to the request URL." is right.
It is better to add the description of Config setting: If there is a setting of http.detailed_errors.enabled: false in config file, the error_trace url request will be rejected.

The detailed logic will be:
When the config setting http.detailed_errors.enabled: false, the request of error_trace=true will not contain the detailed error message.

$ curl "http://localhost:9200/opensearch/_search?error_trace=false"
{"error":"IndexNotFoundException[no such index [opensearch]]","status":404}

$ curl "http://localhost:9200/opensearch/_search?error_trace=true" 
{"error":"error traces in responses are disabled.","status":400}   

This code regarding to this setting is from: https://github.com/opensearch-project/OpenSearch/blob/2.2.1/server/src/main/java/org/opensearch/rest/RestController.java#L368-L375

When there is no config setting for http.detailed_errors.enabled or http.detailed_errors.enabled: true, the response of URL parameter will contain detailed error message:

$ curl "http://localhost:9200/opensearch/_search?error_trace=true&pretty"
{
  "error" : {
    "root_cause" : [
      {
        "type" : "index_not_found_exception",
        "reason" : "no such index [opensearch]",
        "index" : "opensearch",
        "resource.id" : "opensearch",
        "resource.type" : "index_or_alias",
        "index_uuid" : "_na_",
        "stack_trace" : "[opensearch] IndexNotFoundException[no such index [opensearch]]\n\tat org.opensearch.cluster.metadata.IndexNameExpressionResolver$WildcardExpressionResolver.indexNotFoundException(IndexNameExpressionResolver.java:1067)\n\tat org.opensearch.cluster.metadata.IndexNameExpressionResolver$WildcardExpressionResolver.innerResolve(IndexNameExpressionResolver.java:1004)

What other resources are available? Provide links to related issues, POCs, steps for testing, etc.

@rursprung
Copy link
Contributor

please note that there's more to this: if the config option is set then not just the error_trace HTTP parameter is disabled but also some error messages are no longer being returned. see opensearch-project/OpenSearch#4545 for further details (this might be a bug, but i guess for now you can document the status quo and it can be updated once the bug ticket has been addressed one way or the other?)

@Naarcha-AWS Naarcha-AWS modified the milestones: 2022-Q3, 2022-Q4 Oct 3, 2022
@carolxob carolxob added 2 - In progress Issue/PR: The issue or PR is in progress. and removed 1 - Backlog Issue: The issue is unassigned or assigned but not started labels Oct 3, 2022
@carolxob carolxob added backport 1.3 PR: Backport label for v1.3.x backport 2.0 PR: Backport label for v2.0.x backport 2.1 PR: Backport label for 2.1 backport 2.2 PR: Backport label for 2.2 backport 2.3 PR: Backport label for 2.3 3 - Tech review PR: Tech review in progress and removed backport 1.3 PR: Backport label for v1.3.x backport 2.0 PR: Backport label for v2.0.x backport 2.1 PR: Backport label for 2.1 backport 2.2 PR: Backport label for 2.2 backport 2.3 PR: Backport label for 2.3 labels Oct 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 - In progress Issue/PR: The issue or PR is in progress. 3 - Tech review PR: Tech review in progress good first issue Good for newcomers v-All This issue is valid for all versions through 1.3
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants