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.

6.x sets IsValid=false for 404 response

See original GitHub issue

NEST: 6.x > Client: 6.x >

We are updating from 5.6 to 6.6 and have found that GetAsync sets IsValid=false when the document is not found. This is change from 5.6 where IsValid=true and Found=false. This is on .NET Core.

var response = await client.GetAsync (new DocumentPath<Person>("invalid"));

Response data: IsValid: false Found: false DebugInformation: Invalid NEST response built from a unsuccessful low level call on GET: /people/person/invalid Audit trail of this API call: [1] BadResponse: Node: http://127.0.0.1:9200/ Took: 00:00:00.1815146 OriginalException: Elasticsearch.Net.ElasticsearchClientException: The remote server returned an error: (404) Not Found

I can’t find any information stating this change. And can’t see how the exception could be used to infer it’s valid but not found without doing something like if(response.DebugInformation.Contains(“(404) Not Found”)) which is not ideal.

Please advise if this is expected behaviour. Thanks.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ejsmithcommented, Apr 30, 2019

Yeah, I noticed this too and it seems wrong to me. 404 is a perfectly valid response for missing documents.

0reactions
codebraincommented, Jun 27, 2019

Closing this ticket, hopefully @Mpdreamz has advised sufficiently as to the expected behaviour in .6.x. The two PRs mentioned have been merged into 7.x and will be available on the next release. Thanks @keithpecka3 - any problems please open another issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Nest 6.x GetAsync sets IsValid=false for 404 response
We are updating from Nest and ElasticSearch 5.6 to 6.6 and have found that GetAsync sets IsValid=false when the document is not found....
Read more >
ModelState.IsValid == false, why?
isValid and hover over the ModelState. Now you can easily browse through all the values inside and see what error causes the isvalid...
Read more >
Should 404 response include body
It is often a good idea to simply never return a 403 "forbidden" error and instead always return 404 "not found".
Read more >
Static files returns 404 when debug is set to False : r/django
Hello, I'm new to django, I'm facing following error: When debug is ... and automatically uploading static files to s3 bucket is an...
Read more >
Troubleshooting 404 and 401 errors within vRealize ...
This article provides a guided list of validation steps used for resolving most 404 and 401 reported errors within VMware vRealize ...
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