Skip to content

body removal causes 400 - illegal_argument_exception #2584

Closed
@afharo

Description

@afharo

Regression report

In Kibana, we're migrating to stop using the deprecated body key. An example is elastic/kibana#204882.

However, some of our tests started failing with the following error:

illegal_argument_exception: request [/<data_stream>/_mapping] contains unrecognized parameter: [_data_stream_timestamp]

We managed to ship this because the code tries to update some existing mappings by GET the existing ones and PUT the full updated object. _data_stream_timestamp was automatically populated by ES and returned in GET request.

The old logic using the body param works because it forces the client to ship that parameter in the body of the request. However, after removing the body param, the client sent that property as a query parameter, leading to ES validation issues as this property is only accepted in the body.

Last working version

8.16.0

To reproduce

Try to update the mappings of an existing data stream by GET-ing the mappings first, adding the new field in the mappings, and PUT-ing the resulting object.

Expected behavior

The request is successful.

Node.js version

v20.18.2

TypeScript version

5.1.6

Elasticsearch client version

@elastic/[email protected] - @elastic/[email protected]

Elasticsearch server version

9.0.0-SNAPSHOT

Operating system

No response

Any other relevant environment information.

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions