question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Client.create error on elastic:5.0.0-rc1

See original GitHub issue

A simple: client.create({ index: index_name, type: doc_type, timestamp: elem.date, body: elem },function (error_els, response) { [..] })

returns the following error is the post is done to Elastic:5.0.0-rc1: Validation Failed: 1: an id must be provided if version type or value are set

The condition in elastic that is being hit is the following: https://github.com/elastic/elasticsearch/blob/master/core/src/main/java/org/elasticsearch/action/index/IndexRequest.java if (id == null && (versionType == VersionType.INTERNAL && version == Versions.MATCH_ANY) == false) { validationException = addValidationError("an id must be provided if version type or value are set", validationException); }

My objective is to do a POST so that the id is automatically generated by elastic. The call works fine till elastic:5.0.0-alpha5

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

0reactions
mariotackecommented, Jan 1, 2017

Just ran into this myself. I think the docs for create could use a link to the index method to clarify this behavior. I was used to the curl PUT and POST behavior and IMO create seemed to be the most idiomatic way to express creating a document/index (with or without an id).

Docs for create.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Undefined error for client.NewClientWithOpts in Go SDK #40185
Client getting created successfully and waiting for the container to exit without any errors. Additional information you deem important ...
Read more >
Error codes for the Amazon EC2 API - AWS Documentation
This section lists the client error codes that all Amazon EC2 API actions can ... the limit on the number of Client VPN...
Read more >
Elasticsearch java client initialization fails - Stack Overflow
RestClientBuilder builder) to create the elastic client. ... The error was about Spring auto configuring ES RestClient , so another solution ...
Read more >
Error handling - Apollo GraphQL Docs
Making errors actionable on the client and server · Built-in error codes · Custom errors · Throwing errors · Omitting or including stacktrace...
Read more >
Fix error messages that appear during client package creation
The following error messages appear when creating a client package using the client packager tool: "The client package cannot be created. Please make...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found