document_missing_exception: document_missing_exception: [_doc][id]: document missing
ElasticsearchWhat does it mean?
The document to be updated (_update) was not found in the index. An update requires an existing document; if the document does not exist, this exception occurs.
Why does it happen?
The document was deleted earlier, was never created, the wrong _id was used, the request went to the wrong index, or a document written with custom routing was accessed without routing. (GET and _update are real-time; refresh delay does not cause this error.)
How to fix it
Verify that the _id and target index are correct: GET /index-name/_doc/id. If you want update-if-exists/create-if-missing behavior, use upsert (or doc_as_upsert:true) in the _update request. Create the document directly with index (PUT). In the application, catch this exception and fall back to upsert logic.
More from this engine
- search_phase_execution_exceptionsearch_phase_execution_exception: all shards failed / Failed to execute phase [query]
- too_many_clausestoo_many_clauses: maxClauseCount is set to 1024 (query contains too many clauses)
- version_conflict_engine_exceptionversion_conflict_engine_exception: [_doc][id]: version conflict, current version [x] is different than the one provided [y] (HTTP 409)
- index_not_found_exceptionindex_not_found_exception: no such index [index_name] (HTTP 404)
- resource_already_exists_exceptionresource_already_exists_exception: index [index_name/uuid] already exists (HTTP 400)
- cluster_health_redcluster health status: RED / unassigned shards
- no_shard_available_action_exceptionno_shard_available_action_exception: No shard available for [...]