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.

Elasticsearch.Net.UnexpectedElasticsearchClientException: must contain a 'from' and 'to' value (Parameter 'value')

See original GitHub issue

NEST/Elasticsearch.Net version: 7.10.1

Elasticsearch version: 7.9.3

Description of the problem including expected versus actual behavior: I am using the _client.Indices.GetAsync(Indices.All); (where _client in Nest.IElasticClient) in my code to retrieve all indices for an elasticSearch Cluster. The specific properties of and an index’s IndexState that I am interested in are IndexState.Aliases, IndexState.Settings.NumberOfReplicas and indexState.Settings.NumberOfShards. My ElasticSearch cluster is deployed on Aiven.

I get the exception from ElasticSearch

Elasticsearch.Net.UnexpectedElasticsearchClientException: must contain a 'from' and 'to' value (Parameter 'value')

See below for detailed Exception Stack Trace.

Observation: I ran the same client call on a ElasticSerach Instance running inside a local docker container in my machine and the call succeeded without any exceptions and i got the list of indices and details.

Expected behavior Get the list of indices on the cluster with all relevant details of the indices.

Provide DebugInformation (if relevant):

2021-01-11T18:40:24+00:00 |ERR|54|system|0HM5MC165C8IV:00000002|Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware| An unhandled exception has occurred while executing the request.
Elasticsearch.Net.UnexpectedElasticsearchClientException: must contain a 'from' and 'to' value (Parameter 'value')
 ---> System.ArgumentException: must contain a 'from' and 'to' value (Parameter 'value')
   at Nest.AutoExpandReplicas.Create(String value)
   at Nest.AutoExpandReplicasFormatter.Deserialize(JsonReader& reader, IJsonFormatterResolver formatterResolver)
   at Nest.DynamicIndexSettingsFormatter.ConvertToValue[T](Object setting, IJsonFormatterResolver formatterResolver)
   at Nest.DynamicIndexSettingsFormatter.Set[T](IIndexSettings s, IDictionary`2 settings, String key, Action`1 assign, IJsonFormatterResolver formatterResolver)
   at Nest.DynamicIndexSettingsFormatter.SetKnownIndexSettings(JsonReader& reader, IJsonFormatterResolver formatterResolver, IIndexSettings s)
   at Nest.DynamicIndexSettingsFormatter.Deserialize(JsonReader& reader, IJsonFormatterResolver formatterResolver)
   at Nest.IndexSettingsFormatter.Deserialize(JsonReader& reader, IJsonFormatterResolver formatterResolver)
   at Deserialize(Object[] , JsonReader& , IJsonFormatterResolver )
   at Elasticsearch.Net.Utf8Json.Resolvers.DynamicMethodAnonymousFormatter`1.Deserialize(JsonReader& reader, IJsonFormatterResolver formatterResolver)
   at Nest.ResolvableDictionaryResponseFormatter`3.Deserialize(JsonReader& reader, IJsonFormatterResolver formatterResolver)
   at Elasticsearch.Net.Utf8Json.JsonSerializer.Deserialize[T](Byte[] bytes, Int32 offset, IJsonFormatterResolver resolver)
   at Elasticsearch.Net.Utf8Json.JsonSerializer.DeserializeAsync[T](Stream stream, IJsonFormatterResolver resolver)
   at Elasticsearch.Net.ResponseBuilder.SetBodyAsync[TResponse](ApiCallDetails details, RequestData requestData, Stream responseStream, String mimeType, CancellationToken cancellationToken)
   at Elasticsearch.Net.ResponseBuilder.ToResponseAsync[TResponse](RequestData requestData, Exception ex, Nullable`1 statusCode, IEnumerable`1 warnings, Stream responseStream, String mimeType, CancellationToken cancellationToken)
   at Elasticsearch.Net.HttpConnection.RequestAsync[TResponse](RequestData requestData, CancellationToken cancellationToken)
   at Elasticsearch.Net.RequestPipeline.CallElasticsearchAsync[TResponse](RequestData requestData, CancellationToken cancellationToken)
   at Elasticsearch.Net.Transport`1.RequestAsync[TResponse](HttpMethod method, String path, CancellationToken cancellationToken, PostData data, IRequestParameters requestParameters)
   --- End of inner exception stack trace ---
   at Elasticsearch.Net.Transport`1.RequestAsync[TResponse](HttpMethod method, String path, CancellationToken cancellationToken, PostData data, IRequestParameters requestParameters)
....... omiting out the entry point from our company proprietary stack trace

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
stevejgordoncommented, Jan 14, 2021

Thanks for confirming @rdasan. The fix for this is in (#5260) and will be in the next release 7.11.

0reactions
stevejgordoncommented, Jan 14, 2021

@rdasan I don’t have a date for this at the moment I’m afraid as we’ll need to sync up with the 7.11 release of Elasticsearch once that’s good to go.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Stack Overflow
Elasticsearch.Net.UnexpectedElasticsearchClientException: 'Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type 'System.
Read more >
Querying Elasticsearch with NEST error: "Input string was ...
Hi, I'm using NEST (latest version 7.0.0-alpha2) and trying to query Elasticsearch (7.0) with following: var filters = new ...
Read more >
expected:'{', actual:'[', at offset:13520 - Elasticsearch
Hello I am updating a project to a the new NEST version: 7.17 But keep getting this error from the logging: Elasticsearch.Net.
Read more >
Configuration options | Elasticsearch .NET Clients [7.17]
A collection of query string parameters that will be sent with every request. Useful in situations where you always need to pass a...
Read more >
Unexpected exceptions | Elasticsearch.Net and NEST
Sometimes, an unexpected exception happens further down in the pipeline. In this scenario, we wrap them inside an UnexpectedElasticsearchClientException so that ...
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