We're running a microservice, using Nest 6.6, and sometimes, on the first SearchAsync<{someclass}>() call, we get a System.InvalidProgramException: Common Language Runtime detected an invalid program. Here is the stack trace:
System.InvalidProgramException: Common Language Runtime detected an invalid program.
at Elasticsearch.Net.Transport1.RequestAsync[TResponse](HttpMethod method, String path, CancellationToken cancellationToken, PostData data, IRequestParameters requestParameters) at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) at Elasticsearch.Net.Transport
1.RequestAsync[TResponse](HttpMethod method, String path, CancellationToken cancellationToken, PostData data, IRequestParameters requestParameters)
at Elasticsearch.Net.ElasticLowLevelClient.DoRequestAsync[TResponse](HttpMethod method, String path, CancellationToken cancellationToken, PostData data, IRequestParameters requestParameters)
at Elasticsearch.Net.ElasticLowLevelClient.SearchAsync[TResponse](String index, String type, PostData body, SearchRequestParameters requestParameters, CancellationToken ctx)
at Nest.LowLevelDispatch.SearchDispatchAsync[TResponse](IRequest1 p, SerializableData
1 body, CancellationToken ct)
at Nest.ElasticClient.b__562_0[T,TResult](ISearchRequest p, SerializableData1 d, CancellationToken c) at Nest.ElasticClient.Nest.IHighLevelToLowLevelDispatcher.DispatchAsync[TRequest,TQueryString,TResponse,TResponseInterface](TRequest request, CancellationToken cancellationToken, Func
3 responseGenerator, Func`4 dispatch)
at Catalog.ProductCatalogSuggest.Icp.Service.Providers.ElasticsearchSuggestProvider.StoreSuggestAsync(Int32 storeId, String query, Int32 size) in /root/repo/src/Catalog.ProductCatalogSuggest.Icp.Service/Providers/ElasticsearchSuggestProvider.cs:line 89
What's weird is that if we replace this with a standard Search call, we don't get these errors.
Any ideas?
Thanks!