简体   繁体   English

Elasticsearch.Net 7 & Nest 7 - 无效的批量更新请求

[英]Elasticsearch.Net 7 & Nest 7 - Invalid bulk update request

I'm trying to create a.Net Core (netcoreapp3.1) application to send my data from Azure Eventhub to ES 7.我正在尝试创建一个.Net Core (netcoreapp3.1) 应用程序来将我的数据从 Azure Eventhub 发送到 ES 7。

I'm using the following packages:我正在使用以下软件包:
ElasticSearch.Net 7.8.1 ElasticSearch.Net 7.8.1
Nest 7.8.1巢 7.8.1

The data that I retrieve from Eventhub are 2 types that inherit from the IElasticBaseEntity.我从 Eventhub 检索的数据是从 IElasticBaseEntity 继承的 2 种类型。
I want to bulk update a list of these objects, which can be the object with all the information or the object to update one field of an already indexed person.我想批量更新这些对象的列表,可以是包含所有信息的 object 或 object 以更新已索引人员的一个字段。
The field to match / search in ES is the id field. ES中匹配/搜索的字段是id字段。

To simplify my example I will use these dummy classes:为了简化我的示例,我将使用这些虚拟类:

public interface IElasticBaseEntity
{
   string Id { get; set; }
   DateTime ServerTimestamp { get; set; }
}

The person class is the one with all the information class 人是拥有所有信息的人

public abstract class Person: IElasticBaseEntity
{
   public string Id { get; set; }
   public string Firstname {get; set;}
   public string Name {get; set;}   
   public decimal? Score { get; set; }
}

The Score class is the update that I want to do on the indexed Person, based on the Id分数 class 是我想要对索引的人做的更新,基于 Id

public abstract class Score : IElasticBaseEntity
{
   public string Id {get; set;}
   public decimal? Score { get; set; }
}

I use this method to build the connection to ES我使用这种方法来建立到 ES 的连接

public static IElasticClient CreateInstance(ElasticsearchConfig config)
{
   IConnectionPool pool;    
   var connection = new HttpConnection();

   pool = new SniffingConnectionPool(new[] { new Uri(config.Url) }) { SniffedOnStartup = true };

   var connectionSettings = new ConnectionSettings(pool, connection);
   connectionSettings.BasicAuthentication(config.Username, config.Password);
   connectionSettings.ServerCertificateValidationCallback(ServerCertificateValidationCallback);
   connectionSettings.RequestTimeout(TimeSpan.FromMinutes(2)).EnableHttpCompression();
   var client = new ElasticClient(connectionSettings);
    
   return client;
}

So I started with the bulk command on ElasticClient.所以我从 ElasticClient 上的批量命令开始。 In the past I was able to add the objects using the descriptor.Index but of course, I want an update an not an insert/create of everything.过去我可以使用descriptor.Index添加对象,但当然,我想要更新而不是插入/创建所有内容。

So I've come up with this, but for some reason I keep on receiving an error in Visual Studio 2019 on "Invalid /_bulk request" without any other information.所以我想出了这个,但由于某种原因,我一直在 Visual Studio 2019 中收到关于“无效 /_bulk 请求”的错误,而没有任何其他信息。

IEnumerable<IElasticBaseEntity> list = RetrievedData();

var descriptor = new BulkDescriptor();
            
foreach (var eachDoc in list)
{
   var doc = eachDoc;
   descriptor.Update<IElasticBaseEntity>(i => i
      .Id(doc.Id)
      .Doc(doc)
      .DocAsUpsert(true));   
}

var response = await _client.BulkAsync(descriptor);

// Try to debug & see what was send
if (response.ApiCall.RequestBodyInBytes != null)
{
   var jsonOutput = System.Text.Encoding.UTF8.GetString(response.ApiCall.RequestBodyInBytes);
}

The error that I receive is the following (retrieved from the response.DebugInformation ):我收到的错误如下(从response.DebugInformation检索):

Invalid NEST response built from a unsuccessful () low level call on POST: /persons-20200717/_bulk从 POST 上的不成功 () 低级别调用构建的无效 NEST 响应:/persons-20200717/_bulk

Invalid Bulk items:无效的批量项目:

Audit trail of this API call:此 API 调用的审计跟踪:

  • [1] PingFailure: Node: https://myconnectiontoES:9243/ Exception: PipelineException Took: 00:00:01.2859155 [1] PingFailure: 节点: https://myconnectiontoES:9243/ 异常: PipelineException Take: 00:00:01.2859155
  • [2] SniffOnFail: Took: 00:00:02.1577638 [2] SniffOnFail: 采取: 00:00:02.1577638
  • [3] SniffFailure: Node: https://myconnectiontoES:9243/ Exception: PipelineException Took: 00:00:02.0840985 [3] SniffFailure:节点:https://myconnectiontoES:9243/ 异常:PipelineException Take: 00:00:02.0840985

OriginalException: Elasticsearch.Net.ElasticsearchClientException: Failed sniffing cluster state.. >Call: unknown resource OriginalException: Elasticsearch.Net.ElasticsearchClientException: 嗅探集群失败 state .. >调用:未知资源

---> Elasticsearch.Net.PipelineException: Failed sniffing cluster state. ---> Elasticsearch.Net.PipelineException:嗅探集群 state 失败。 ---> Elasticsearch.Net.PipelineException: An error occurred trying to read the response from the >specified node. ---> Elasticsearch.Net.PipelineException:尝试从 > 指定节点读取响应时发生错误。 at Elasticsearch.Net.RequestPipeline.SniffAsync(CancellationToken cancellationToken) --- End of inner exception stack trace --- at Elasticsearch.Net.RequestPipeline.SniffAsync(CancellationToken cancellationToken) at Elasticsearch.Net.RequestPipeline.SniffOnConnectionFailureAsync(CancellationToken >cancellationToken) at Elasticsearch.Net.Transport 1.PingAsync(IRequestPipeline pipeline, Node node, 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.RequestPipeline.SniffAsync(CancellationToken cancellationToken) --- End of inner exception stack trace --- at Elasticsearch.Net.RequestPipeline.SniffAsync(CancellationToken cancellationToken) at Elasticsearch.Net.RequestPipeline.SniffOnConnectionFailureAsync(CancellationToken >cancellationToken) at Elasticsearch.Net.Transport 1.RequestAsync[TResponse](HttpMethod method, String path, >CancellationTokenRequestParameterscancellationToken) -- PostData 1.PingAsync(IRequestPipeline pipeline, Node node, CancellationToken >cancellationToken) at Elasticsearch.Net.Transport - 内部异常堆栈跟踪结束 ---

Audit exception in step 1 PingFailure:步骤 1 PingFailure 中的审计异常:

Elasticsearch.Net.PipelineException: An error occurred trying to read the response from the specified >node. Elasticsearch.Net.PipelineException:尝试从指定 >node 读取响应时发生错误。 at Elasticsearch.Net.RequestPipeline.PingAsync(Node node, CancellationToken cancellationToken)在 Elasticsearch.Net.RequestPipeline.PingAsync(节点节点,CancellationToken cancelToken)

Audit exception in step 3 SniffFailure:步骤 3 SniffFailure 中的审计异常:

Elasticsearch.Net.PipelineException: An error occurred trying to read the response from the specified >node. Elasticsearch.Net.PipelineException:尝试从指定 >node 读取响应时发生错误。 at Elasticsearch.Net.RequestPipeline.SniffAsync(CancellationToken cancellationToken)在 Elasticsearch.Net.RequestPipeline.SniffAsync(CancellationToken cancelToken)

Request:要求:

<Request stream not captured or already read to completion by serializer. <请求 stream 未被序列化程序捕获或已读取完成。 Set DisableDirectStreaming() >on ConnectionSettings to force it to be set on the response.>设置 DisableDirectStreaming() >on ConnectionSettings 以强制在响应中设置它。>

Response:回复:

So I looks like there is something wrong with my /_bulk request所以我的/_bulk请求似乎有问题

What I've tried:我试过的:

  • Catch the /_bulk request with fiddler > the request is invalid & not send用 fiddler 捕获/_bulk请求 > 请求无效且未发送
  • Try to set connectionSettings.DisableDirectStreaming(true);尝试设置connectionSettings.DisableDirectStreaming(true); to print out the request > this is always null打印出请求 > 这总是null

So if anyone could point out the mistake I made in building the the /_bulk request or could point me in a direction to debug this & retrieve more information, I would be thankfull.因此,如果有人可以指出我在构建/_bulk请求时所犯的错误,或者可以指出我调试这个和检索更多信息的方向,我将不胜感激。 Currently I'm going around in circles, re-reading the documentation, google-ing, but without any result.目前我正在转圈,重新阅读文档,谷歌搜索,但没有任何结果。

Thanks谢谢

The failure is occurring when attempting to read the response to sniffing the cluster .尝试读取对嗅探集群的响应时发生故障。 It looks like sniffing has occurred because pinging the cluster has failed though, so it's worth checking that you can make a HEAD request to the base address of the Elasticsearch cluster using the credentials the client is configured to use.似乎发生了嗅探,因为 ping 集群失败,因此值得检查您是否可以使用客户端配置使用的凭据向 Elasticsearch 集群的基地址发出HEAD请求。

Based on the port 9243 being used in the connection to Elasticsearch, I suspect the Elasticsearch cluster is running in Elastic Cloud .根据用于连接 Elasticsearch 的端口 9243,我怀疑 Elasticsearch 集群正在Elastic Cloud中运行。 SniffingConnectionPool must not be used with an Elasticsearch cluster running in Elastic Cloud, as the addresses returned in the sniff response for where to reach Elasticsearch nodes are internal addresses which will be unreachable from the client. SniffingConnectionPool不得与在 Elastic Cloud 中运行的 Elasticsearch 集群一起使用,因为在嗅探响应中返回的用于到达 Elasticsearch 节点的地址是客户端无法访问的内部地址。 Instead, the CloudConnectionPool should be used, which has some convenience methods to use when creating an instance of ElasticClient相反,应该使用CloudConnectionPool ,它有一些在创建ElasticClient实例时可以使用的便捷方法

var client = new ElasticClient(
    "<cloud id retrieved from the Elastic Cloud web console>", 
    new BasicAuthenticationCredentials(config.Username, config.Password));

CloudConnectionPool will use http compression by default, but if you need more control over other configuration like request timeout, you can use CloudConnectionPool将默认使用 http 压缩,但如果您需要更多地控制其他配置,例如请求超时,您可以使用

var pool = new CloudConnectionPool(
    "<cloud id retrieved from the Elastic Cloud web console>", 
    new BasicAuthenticationCredentials(config.Username, config.Password));
    
var settings = new ConnectionSettings(pool)
    .RequestTimeout(TimeSpan.FromMinutes(2));

var client = new ElasticClient(settings);

After going around in circles, I started creating test to check the basic ES command.绕了一圈之后,我开始创建测试来检查基本的 ES 命令。 Based on the example I found for ElasticSearch.Net, I was unable to succesfully run any of the examples.根据我为 ElasticSearch.Net 找到的示例,我无法成功运行任何示例。

So I checked the ES Index by trying it with a curl command.所以我通过使用 curl 命令尝试检查了 ES 索引。
curl -H "Content-Type: application/json" -u username:password -XPOST "https://elasticsearch_url:port/indexname/stats/1" -d "{\"application\": \"test\"}"

This command failed, with the message that I'm not allowed to contact ES.该命令失败,消息是我不允许联系 ES。 So we've checked the ES user and appearently there was an error in the role that was assigned to this user (in ElasticSearch).因此,我们检查了 ES 用户,显然分配给该用户的角色存在错误(在 ElasticSearch 中)。 Once we fixed this, I was able to run my code & execute the partial update.一旦我们解决了这个问题,我就可以运行我的代码并执行部分更新。

IEnumerable<IElasticBaseEntity> list = RetrievedData();

var descriptor = new BulkDescriptor();
        
foreach (var eachDoc in list)
{
   var doc = eachDoc;
   descriptor.Update<IElasticBaseEntity>(i => i
      .Id(doc.Id)
      .Doc(doc)
      .DocAsUpsert(true));   
}

var response = await _client.BulkAsync(descriptor);

The issue I have now, is that this runs for about 1 hour and then I get a SnifFailure.我现在遇到的问题是,它运行了大约 1 个小时,然后我得到了 SnifFailure。 The connection to ES is retried but mostly ends in a "MaxTimeOutReached"重试与 ES 的连接,但大多以“MaxTimeOutReached”结束

The RequestTimeOut is set to 2 minutes The Retries & timeout is not set, so the defaults are used (-> this is retrying until the RequestTimeout of 2 minutes is reached) RequestTimeOut 设置为 2 分钟重试和超时未设置,因此使用默认值(-> 这是重试,直到达到 2 分钟的 RequestTimeout)

As you can see in the log below: I'm able to send docs to ES and then at some point I receive this error.正如您在下面的日志中看到的那样:我能够将文档发送到 ES,然后在某些时候我收到此错误。 Mostly after running my application for 1h.主要是在运行我的应用程序 1 小时之后。

2020-08-05 11:22:01.5553| INFO| 001 ES_indexName processed documents 08/05/2020 11:22:01 1 in 202.3803 ms
2020-08-05 11:29:28.9633| INFO| 001 ES_indexName processed documents 08/05/2020 11:29:28 1 in 179.7982 ms
2020-08-05 11:40:08.4666| INFO| 001 ES_indexName processed documents 08/05/2020 11:40:07 1 in 291.5695 ms
2020-08-05 11:47:26.2924|ERROR| failed Invalid NEST response built from a unsuccessful () low level call on POST: /ES_indexName/_bulk
# Invalid Bulk items:
# Audit trail of this API call:
 - [1] PingFailure: Node: https://ES_node1:port/ Exception: PipelineException Took: 00:01:40.0193513
 - [2] SniffOnFail: Took: 00:05:00.0132241
 - [3] SniffFailure: Node: https://ES_node2:port/ Exception: PipelineException Took: 00:01:40.0036955
 - [4] SniffFailure: Node: https://ES_node3:port/ Exception: PipelineException Took: 00:01:40.0019296
 - [5] SniffFailure: Node: https://ES_node1:port/ Exception: PipelineException Took: 00:01:40.0005639
 - [6] MaxTimeoutReached:
# OriginalException: Elasticsearch.Net.ElasticsearchClientException: Maximum timeout reached while retrying request. Call: unknown resource
 ---> Elasticsearch.Net.PipelineException: Failed sniffing cluster state.
 ---> System.AggregateException: One or more errors occurred. (An error occurred trying to write the request data to the specified node.) (An error occurred trying to write the request data to the specified node.) (An error occurred trying to write the request data to the specified node.)
 ---> Elasticsearch.Net.PipelineException: An error occurred trying to write the request data to the specified node.
 ---> System.Threading.Tasks.TaskCanceledException: The operation was canceled.
   at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean allowHttp2, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.GetHttpConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.DecompressionHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.FinishSendAsyncUnbuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
   at Elasticsearch.Net.HttpConnection.RequestAsync[TResponse](RequestData requestData, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at Elasticsearch.Net.RequestPipeline.SniffAsync(CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
 ---> (Inner Exception #1) Elasticsearch.Net.PipelineException: An error occurred trying to write the request data to the specified node.
 ---> System.Threading.Tasks.TaskCanceledException: The operation was canceled.
   at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean allowHttp2, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.GetHttpConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.DecompressionHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.FinishSendAsyncUnbuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
   at Elasticsearch.Net.HttpConnection.RequestAsync[TResponse](RequestData requestData, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at Elasticsearch.Net.RequestPipeline.SniffAsync(CancellationToken cancellationToken)<---

 ---> (Inner Exception #2) Elasticsearch.Net.PipelineException: An error occurred trying to write the request data to the specified node.
 ---> System.Threading.Tasks.TaskCanceledException: The operation was canceled.
   at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean allowHttp2, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.GetHttpConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.DecompressionHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.FinishSendAsyncUnbuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
   at Elasticsearch.Net.HttpConnection.RequestAsync[TResponse](RequestData requestData, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at Elasticsearch.Net.RequestPipeline.SniffAsync(CancellationToken cancellationToken)<---

   --- End of inner exception stack trace ---
   at Elasticsearch.Net.RequestPipeline.SniffAsync(CancellationToken cancellationToken)
   at Elasticsearch.Net.RequestPipeline.SniffOnConnectionFailureAsync(CancellationToken cancellationToken)
   at Elasticsearch.Net.Transport`1.PingAsync(IRequestPipeline pipeline, Node node, 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 ---
# Audit exception in step 1 PingFailure:
Elasticsearch.Net.PipelineException: An error occurred trying to write the request data to the specified node.
 ---> System.Threading.Tasks.TaskCanceledException: The operation was canceled.
   at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean allowHttp2, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.GetHttpConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.DecompressionHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.FinishSendAsyncUnbuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
   at Elasticsearch.Net.HttpConnection.RequestAsync[TResponse](RequestData requestData, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at Elasticsearch.Net.RequestPipeline.PingAsync(Node node, CancellationToken cancellationToken)
# Audit exception in step 3 SniffFailure:
Elasticsearch.Net.PipelineException: An error occurred trying to write the request data to the specified node.
 ---> System.Threading.Tasks.TaskCanceledException: The operation was canceled.
   at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean allowHttp2, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.GetHttpConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.DecompressionHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.FinishSendAsyncUnbuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
   at Elasticsearch.Net.HttpConnection.RequestAsync[TResponse](RequestData requestData, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at Elasticsearch.Net.RequestPipeline.SniffAsync(CancellationToken cancellationToken)
# Audit exception in step 4 SniffFailure:
Elasticsearch.Net.PipelineException: An error occurred trying to write the request data to the specified node.
 ---> System.Threading.Tasks.TaskCanceledException: The operation was canceled.
   at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean allowHttp2, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.GetHttpConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.DecompressionHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.FinishSendAsyncUnbuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
   at Elasticsearch.Net.HttpConnection.RequestAsync[TResponse](RequestData requestData, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at Elasticsearch.Net.RequestPipeline.SniffAsync(CancellationToken cancellationToken)
# Audit exception in step 5 SniffFailure:
Elasticsearch.Net.PipelineException: An error occurred trying to write the request data to the specified node.
 ---> System.Threading.Tasks.TaskCanceledException: The operation was canceled.
   at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean allowHttp2, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.GetHttpConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.DecompressionHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.FinishSendAsyncUnbuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
   at Elasticsearch.Net.HttpConnection.RequestAsync[TResponse](RequestData requestData, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at Elasticsearch.Net.RequestPipeline.SniffAsync(CancellationToken cancellationToken)
# 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.>
 400039.9975 ms MUST RETRY```

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM