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

7.11 APIs who don’t need a body now return an error when provided with one #69532

Closed
m-a-leclercq opened this issue Feb 24, 2021 · 4 comments · Fixed by #69565
Closed

7.11 APIs who don’t need a body now return an error when provided with one #69532

m-a-leclercq opened this issue Feb 24, 2021 · 4 comments · Fixed by #69565
Assignees
Labels
:Core/Infra/REST API REST infrastructure and utilities >docs General docs changes Team:Core/Infra Meta label for core/infra team Team:Docs Meta label for docs team

Comments

@m-a-leclercq
Copy link
Contributor

m-a-leclercq commented Feb 24, 2021

Elasticsearch version (bin/elasticsearch --version): 7.11.1 - docker image

Description of the problem including expected versus actual behavior:
Hi,

I have been upgrading one of my clusters to 7.11.1 and much to my surprise there is a behavior change that I haven't been able to find in the breaking changes or in the "what's new" page for this release.

GET _cat/health
{
}

Now returns

{
  "error" : {
    "root_cause" : [
      {
        "type" : "illegal_argument_exception",
        "reason" : "request [GET /_cat/health] does not support having a body"
      }
    ],
    "type" : "illegal_argument_exception",
    "reason" : "request [GET /_cat/health] does not support having a body"
  },
  "status" : 400
}

Expected behavior:
Elastic should return the actual cluster state.

Now, the problem was in my ansible playbook because my uri module had the body_format: json property set when checking for the cluster's health so it was a good opportunity to clean up my code.

Since I haven't found any mentions of this behavior change in the documentation or in the github issues, I thought I would put it out there for everyone as a head's up. Maybe someone in the elastic team can add it to the documentation?

This also affects POST _flush/synced and many other APIs I suppose.

This is confirmed to work in 7.7.0 and I believe 7.10.2 too but it will return an error in 7.11.1

Original post : https://discuss.elastic.co/t/7-11-apis-who-dont-need-a-body-now-return-an-error-when-provided-with-one/265324

@m-a-leclercq m-a-leclercq added >bug needs:triage Requires assignment of a team area label labels Feb 24, 2021
@DaveCTurner DaveCTurner added :Core/Infra/REST API REST infrastructure and utilities and removed needs:triage Requires assignment of a team area label labels Feb 24, 2021
@elasticmachine elasticmachine added the Team:Core/Infra Meta label for core/infra team label Feb 24, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

@jaymode
Copy link
Member

jaymode commented Feb 24, 2021

Thanks for opening the issue @m-a-leclercq. This was indeed a deliberate change as noted in #66043. These requests should have been deprecated in 6.x by #37534. #37504 was the change for 7.0+ that IIRC was later broken.

I do believe that we should document this as it may be surprising.

@jaymode jaymode added >docs General docs changes and removed >bug labels Feb 24, 2021
@elasticmachine elasticmachine added the Team:Docs Meta label for docs team label Feb 24, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-docs (Team:Docs)

@jrodewig
Copy link
Contributor

jrodewig commented Mar 1, 2021

Closed by #69565.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/REST API REST infrastructure and utilities >docs General docs changes Team:Core/Infra Meta label for core/infra team Team:Docs Meta label for docs team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants