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

Fix indices.delete_alias response #2951

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Fix indices.delete_alias response #2951

wants to merge 1 commit into from

Conversation

pquentin
Copy link
Member

This regressed between March 25th and April 15th, back when recording examples wasn't stable. Unfortunately, 22 days worth of commits is a lot: elastic/elasticsearch@e9fcb0a...d3e0ec1. If we find where this is set, we could consider asking the Elasticsearch team to not do this. It's not helpful, as acknowledged is already set to true.

Another option: I could only change the delete_alias body instead of affecting all APIs that use AcknowledgedResponseBase.

@l-trotta
Copy link
Contributor

I can't find this in the sever, AcknowledgeResponse only has one field. I think the problem is the fact that the body changes when there's an error, so for a normal response it's:

{
  "acknowledged": true
}

while when there's an error it's:

{
  "error": {
    "root_cause": [
      {
        "type": "illegal_argument_exception",
        "reason": "unable to put stored script with unsupported lang [painlesss]"
      }
    ],
    "type": "illegal_argument_exception",
    "reason": "unable to put stored script with unsupported lang [painlesss]"
  },
  "status": 400
}

in the spec we just map the first one, because the second case is the exception case (the server returns 404) so what java does is that it returns the error body in the exception message.

@pquentin pquentin changed the title Fix indices.delete_api response Fix indices.delete_alias response Sep 27, 2024
@pquentin
Copy link
Member Author

Actually, we also get responses like this one:

{
  "api": "indices.delete_alias",
  "file": "/test/free/indices.delete_alias/all_path_options.yml",
  "name": "check delete with prefix* index",
  "origin": "yaml",
  "request": {
    "args": {
      "index": "test_*",
      "name": "alias1"
    }
  },
  "response": {
    "headers": {
      "content-encoding": "gzip",
      "content-length": "62",
      "content-type": "application/json",
      "x-elastic-product": "Elasticsearch"
    },
    "payload": {
      "acknowledged": true,
      "errors": false
    },
    "statusCode": 200
  }
}

@l-trotta
Copy link
Contributor

ooh that's why: it's a subclass! we have to map this

@technige technige added the tracking Tracking in DevTools roadmap label Oct 4, 2024
@l-trotta
Copy link
Contributor

l-trotta commented Oct 7, 2024

update: it's more complex than it looks, I'm still working on this. in particular it seems like in case of error it can return detailed information, including a class that represents an ElasticsearchException which I don't think we already have.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
specification tracking Tracking in DevTools roadmap
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants