Invalid NEST response built from a successful (404) low level call on GET:

Hello
I'm doing a Get Request in my code:

var response = await Repository.ElasticClient.GetAsync<Reservation>(maskId).ConfigureAwait(false);

And I'm getting this as a response:

Invalid NEST response built from a successful (404) low level call on GET: /index_name/_doc/5e957349-ca7d-4fcf-ad9a-2a81f97a8382
# Server indicated deprecations:
- 299 Elasticsearch-7.17.9-ef48222227ee6b9e70e502f0f0daa52435ee634d "Elasticsearch built-in security features are not enabled. Without authentication, your cluster could be accessible to anyone. See https://www.elastic.co/guide/en/elasticsearch/reference/7.17/security-minimal-setup.html to enable security."
# Audit trail of this API call:
 - [1] HealthyResponse: Node: http://ip-adress:9200/ Took: 00:00:03.5287318
# Request:
<Request stream not captured or already read to completion by serializer. Set DisableDirectStreaming() on ConnectionSettings to force it to be set on the response.>
# Response:
<Response stream not captured or already read to completion by serializer. Set DisableDirectStreaming() on ConnectionSettings to force it to be set on the response.>

I've already tried setting the "DisableDirectStreaming" but it doesn't fix the issue.
Any ideas on how to fix this?
You have my thanks in advance

Hi, @LhamoDev.

The message here is slightly misleading. The request looks to have been sent without issue. The problem is that the server returns a 404 because that index/doc ID combo was not found. How have you configured the client instance?

It looks like you may have set a default index or mapped an index for the Reservation type with the name "index_name", which I think may be your issue. You will want to set the actual index where the document exists.

Hi @stevejgordon
Yes I know those names look weird hahah,
But there is a policy at my company if I want to post on a forum I need to check with operations if the code I'm posting is "safe" or not, and they said I needed to set a generic name for the indexes, but IRL the Index name is reservations_v1 (I checked and it's okay to say that).
image

this is the setup I have dor the reservations index, The partner info has nothing to do with it but it is a fix for another issue I had a while back.
Any Ideas how to fix the current one? I looked in the database and there are actual invoices with that ID, so I really don't know what the issue could be here

I don't see why this wouldn't work if that document ID exists. The server seems to be returning 404 to indicate it does not.

If you perform a GET to {your_server_and_port}/reservations_v1/_doc/5e957349-ca7d-4fcf-ad9a-2a81f97a8382, do you get a document back? You can try directly in Kibana if it's easier.

Hi,
I've tried it via POSTMAN to get a document back, but it returns the same:


I've tried other ID's as well, but I never get a decent response back, always the same shown in the image.

This doesn't seem to be a client issue, then. Can you check a document from the index and validate that the _id field is set with a GUID, as you're expecting here? How are documents ingested? Are they ensuring the mask ID is used to set the _id of each document?

I fixed it, nvm
Thanks for the help tho

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.