作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
更新到 elasticsearch 7.5.1 后,以下代码现在导致异常
“未找到入口点”
//old code worked just fine
var verifyRepositoryResponse = this.elasticClient.VerifyRepository(new VerifyRepositoryRequest("C__MYFOLDER_Backup"));
//new code throws
var verifyRepositoryResponse = this.elasticClient.Snapshot.VerifyRepository(new VerifyRepositoryRequest("C__MYFOLDER_Backup"));
POST http://localhost:9200/_snapshot/C__MYFOLDER_Backup/_verify HTTP/1.1
User-Agent: Fiddler
Host: localhost:9200
Content-Type: application/json
Content-Length: 0
{"nodes":{"1cWG9trDRi--6I-46lOlBw":{"name":"DESKTOP-5L01F6I"}}}
var verifyRepositoryResponse = this.elasticClient.Snapshot.VerifyRepository(new VerifyRepositoryRequest("C__DOESNOTEXIST_Backup"));
"# FailureReason: Unrecoverable/Unexpected BadResponse while attempting POST on http://localhost:9200/_snapshot/C__MYFOLDER_Backup/_verify\r\n - [1] BadResponse: Node: http://localhost:9200/ Exception: EntryPointNotFoundException Took: 00:00:00.1859931\r\n# Audit
exception in step 1 BadResponse:\r\nSystem.EntryPointNotFoundException: Entry point was not found.\r\n at Elasticsearch.Net.Utf8Json.IJsonFormatter`1.Deserialize(JsonReader& reader, IJsonFormatterResolver formatterResolver)\r\n at Deserialize(Object[] ,
JsonReader& , IJsonFormatterResolver )\r\n at Elasticsearch.Net.Utf8Json.JsonSerializer.Deserialize[T](Byte[] bytes, Int32 offset, IJsonFormatterResolver resolver)\r\n at Elasticsearch.Net.Utf8Json.JsonSerializer.Deserialize[T](Stream stream,
IJsonFormatterResolver resolver)\r\n at Elasticsearch.Net.DiagnosticsSerializerProxy.Deserialize[T](Stream stream)\r\n at Elasticsearch.Net.ResponseBuilder.SetBody[TResponse](ApiCallDetails details, RequestData requestData, Stream responseStream, String
mimeType)\r\n at Elasticsearch.Net.ResponseBuilder.ToResponse[TResponse](RequestData requestData, Exception ex, Nullable`1 statusCode, IEnumerable`1 warnings, Stream responseStream, String mimeType)\r\n at
Elasticsearch.Net.HttpWebRequestConnection.Request[TResponse](RequestData requestData)\r\n at Elasticsearch.Net.RequestPipeline.CallElasticsearch[TResponse](RequestData requestData)\r\n at Elasticsearch.Net.Transport`1.Request[TResponse](HttpMethod method,
String path, PostData data, IRequestParameters requestParameters)\r\n# Inner Exception: Entry point was not found.\r\nSystem.EntryPointNotFoundException: Entry point was not found.\r\n at Elasticsearch.Net.Utf8Json.IJsonFormatter`1.Deserialize(JsonReader&
reader, IJsonFormatterResolver formatterResolver)\r\n at Deserialize(Object[] , JsonReader& , IJsonFormatterResolver )\r\n at Elasticsearch.Net.Utf8Json.JsonSerializer.Deserialize[T](Byte[] bytes, Int32 offset, IJsonFormatterResolver resolver)\r\n at
Elasticsearch.Net.Utf8Json.JsonSerializer.Deserialize[T](Stream stream, IJsonFormatterResolver resolver)\r\n at Elasticsearch.Net.DiagnosticsSerializerProxy.Deserialize[T](Stream stream)\r\n at
Elasticsearch.Net.ResponseBuilder.SetBody[TResponse](ApiCallDetails details, RequestData requestData, Stream responseStream, String mimeType)\r\n at Elasticsearch.Net.ResponseBuilder.ToResponse[TResponse](RequestData requestData, Exception ex, Nullable`1
statusCode, IEnumerable`1 warnings, Stream responseStream, String mimeType)\r\n at Elasticsearch.Net.HttpWebRequestConnection.Request[TResponse](RequestData requestData)\r\n at Elasticsearch.Net.RequestPipeline.CallElasticsearch[TResponse](RequestData
requestData)\r\n at Elasticsearch.Net.Transport`1.Request[TResponse](HttpMethod method, String path, PostData data, IRequestParameters requestParameters)\r\n# Exception:\r\nElasticsearch.Net.UnexpectedElasticsearchClientException: Entry point was not found. --->
System.EntryPointNotFoundException: Entry point was not found.\r\n at Elasticsearch.Net.Utf8Json.IJsonFormatter`1.Deserialize(JsonReader& reader, IJsonFormatterResolver formatterResolver)\r\n at Deserialize(Object[] , JsonReader& , IJsonFormatterResolver
)\r\n at Elasticsearch.Net.Utf8Json.JsonSerializer.Deserialize[T](Byte[] bytes, Int32 offset, IJsonFormatterResolver resolver)\r\n at Elasticsearch.Net.Utf8Json.JsonSerializer.Deserialize[T](Stream stream, IJsonFormatterResolver resolver)\r\n at
Elasticsearch.Net.DiagnosticsSerializerProxy.Deserialize[T](Stream stream)\r\n at Elasticsearch.Net.ResponseBuilder.SetBody[TResponse](ApiCallDetails details, RequestData requestData, Stream responseStream, String mimeType)\r\n at
Elasticsearch.Net.ResponseBuilder.ToResponse[TResponse](RequestData requestData, Exception ex, Nullable`1 statusCode, IEnumerable`1 warnings, Stream responseStream, String mimeType)\r\n at Elasticsearch.Net.HttpWebRequestConnection.Request[TResponse](RequestData
requestData)\r\n at Elasticsearch.Net.RequestPipeline.CallElasticsearch[TResponse](RequestData requestData)\r\n at Elasticsearch.Net.Transport`1.Request[TResponse](HttpMethod method, String path, PostData data, IRequestParameters requestParameters)\r\n ---
End of inner exception stack trace ---\r\n at Elasticsearch.Net.Transport`1.Request[TResponse](HttpMethod method, String path, PostData data, IRequestParameters requestParameters)\r\n at
Nest.Specification.SnapshotApi.SnapshotNamespace.VerifyRepository(IVerifyRepositoryRequest request)\r\n at InforsHT.Genesis.Infrastructure.Data.Repositories.ElasticBackupAndRestoreProxy.IsBackupLocationPresent(String backupLocation) in
C:\\work\\eve\\Source\\InforsHT.Genesis.Infrastructure.Data\\Repositories\\ElasticBackupAndRestoreProxy.cs:line 44\r\n"
最佳答案
这是一个错误。 VerifyRepositoryResponse
的Node
属性的属性是 JsonFormatterAttribute
期望反序列化 IDictionary<string, CompactNodeInfo>
当属性类型为 IReadOnlyDictionary<string, CompactNodeInfo>
时.这对于使用强类型格式化程序的底层 JSON 序列化程序来说是有问题的,IJsonFormatter<T>
, 其中类型 T
必须完全匹配。
我有 opened an issue跟踪和a pull request to fix问题。现在,您可以通过使用在高级客户端上公开的低级客户端来解决该错误
var response = client.LowLevel.Snapshot.VerifyRepository<DynamicResponse>("C__MYFOLDER_Backup");
DynamicResponse
.或者,使用
StringResponse
并使用
JObject
解析或
JsonDocument
并穿越。
关于elasticsearch 在 C# Nest 客户端中的 VerifyRepositoryRequest 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60062480/
更新到 elasticsearch 7.5.1 后,以下代码现在导致异常 “未找到入口点” //old code worked just fine var verifyRepositoryRe
我是一名优秀的程序员,十分优秀!