gpt4 book ai didi

azure-cosmosdb - Azure CosmosDB 表 API - table.CreateIfNotExists() 调用挂起

转载 作者:行者123 更新时间:2023-12-01 04:46:06 26 4
gpt4 key购买 nike

我已经成功下载并运行了 Quickstart 应用程序,但我的 Web 应用程序无法正常工作。 (当我调用 table.CreateIfNotExists() 时,执行只是无限期挂起)。这显然与另一个图书馆发生冲突,但我无法确定确切的问题。

我已经尝试了我能想到的所有方法(包括删除和重新安装 WindowsAzure.Storage-PremiumTable 0.1.0-preview 库并安装)但无济于事。怀疑冲突与 Microsoft.AspNet.OData 库(用于 oData v4)有关,我在我的项目中也需要它。它对 Microsoft.Extensions.. (>= 1.0.0 && < 2.0.0) 有一些依赖性,我从另一个用户在线阅读是导致类似问题的原因,该问题已通过升级到 v2.0 解决。无论如何,由于 Microsoft.AspNet.OData 的依赖性,我无法升级这些。

以下是 成功 时的输出窗口(来自快速入门应用程序或其他具有最少附加库的应用程序):

DocDBTrace Information: 0 : Set WriteEndpoint https://trfk-cosmos1-neu-northeurope.documents.azure.com/ ReadEndpoint https://trfk-cosmos1-neu-northeurope.documents.azure.com/
DocDBTrace Information: 0 : TimerPool Created with minSupportedTimerDelayInSeconds = 60
DocDBTrace Information: 0 : RntbdConnectionDispenser: requestTimeoutInSeconds: 60, openTimeoutInSeconds: 0, timerValueInSeconds: 60
DocDBTrace Error: 0 : DocumentClientException with status code: NotFound, message: Message: {"Errors":["Resource Not Found"]}
ActivityId: eed42269-739c-43cd-a964-e8addb2c0a29, Request URI: /apps/cbec8afc-ed09-4565-be2a-46723dded3c3/services/ad31a99f-f874-4862-9dd4-60af25fbc416/partitions/4fd158a1-3b2f-4d61-8ee1-9ee8767d13c1/replicas/131504437541513138s, and response headers: {
"Transfer-Encoding": "chunked",
"x-ms-last-state-change-utc": "Sun, 24 Sep 2017 19:02:14.321 GMT",
"x-ms-schemaversion": "1.3",
"x-ms-xp-role": "2",
"x-ms-global-Committed-lsn": "39",
"x-ms-number-of-read-regions": "0",
"x-ms-request-charge": "2",
"x-ms-serviceversion": "version=1.17.52.1",
"x-ms-activity-id": "eed42269-739c-43cd-a964-e8addb2c0a29",
"x-ms-session-token": "0:40",
"Strict-Transport-Security": "max-age=31536000",
"x-ms-gatewayversion": "version=1.17.52.1",
"Date": "Tue, 26 Sep 2017 19:44:45 GMT",
"Server": "Microsoft-HTTPAPI/2.0",
}

这是我调用 table.CreateIfNotExists() 时项目的输出窗口,即 问题 :
DocDBTrace Information: 0 : Set WriteEndpoint https://trfk-cosmos1-neu-northeurope.documents.azure.com/ ReadEndpoint https://trfk-cosmos1-neu-northeurope.documents.azure.com/
DocDBTrace Information: 0 : TimerPool Created with minSupportedTimerDelayInSeconds = 60
DocDBTrace Information: 0 : RntbdConnectionDispenser: requestTimeoutInSeconds: 60, openTimeoutInSeconds: 0, timerValueInSeconds: 60
DocDBTrace Warning: 0 : Endpoint not reachable. Refresh cache and retry
DocDBTrace Information: 0 : MarkEndpointUnavailable() read EP = https://trfk-cosmos1-neu-northeurope.documents.azure.com/ write EP = https://trfk-cosmos1-neu-northeurope.documents.azure.com/
DocDBTrace Information: 0 : RefreshLocationAsync() refreshing locations
DocDBTrace Information: 0 : Set WriteEndpoint https://trfk-cosmos1-neu-northeurope.documents.azure.com/ ReadEndpoint https://trfk-cosmos1-neu-northeurope.documents.azure.com/
DocDBTrace Warning: 0 : Endpoint not reachable. Refresh cache and retry
DocDBTrace Information: 0 : MarkEndpointUnavailable() read EP = https://trfk-cosmos1-neu-northeurope.documents.azure.com/ write EP = https://trfk-cosmos1-neu-northeurope.documents.azure.com/
DocDBTrace Information: 0 : RefreshLocationAsync() refreshing locations
DocDBTrace Information: 0 : Set WriteEndpoint https://trfk-cosmos1-neu-northeurope.documents.azure.com/ ReadEndpoint https://trfk-cosmos1-neu-northeurope.documents.azure.com/
DocDBTrace Warning: 0 : Endpoint not reachable. Refresh cache and retry
DocDBTrace Information: 0 : MarkEndpointUnavailable() read EP = https://trfk-cosmos1-neu-northeurope.documents.azure.com/ write EP = https://trfk-cosmos1-neu-northeurope.documents.azure.com/
DocDBTrace Information: 0 : RefreshLocationAsync() refreshing locations
DocDBTrace Information: 0 : Set WriteEndpoint https://trfk-cosmos1-neu-northeurope.documents.azure.com/ ReadEndpoint https://trfk-cosmos1-neu-northeurope.documents.azure.com/
DocDBTrace Warning: 0 : Endpoint not reachable. Refresh cache and retry
DocDBTrace Information: 0 : MarkEndpointUnavailable() read EP = https://trfk-cosmos1-neu-northeurope.documents.azure.com/ write EP = https://trfk-cosmos1-neu-northeurope.documents.azure.com/
DocDBTrace Information: 0 : RefreshLocationAsync() refreshing locations
DocDBTrace Information: 0 : Set WriteEndpoint https://trfk-cosmos1-neu-northeurope.documents.azure.com/ ReadEndpoint https://trfk-cosmos1-neu-northeurope.documents.azure.com/

最佳答案

转换为异步应该可以解决这个问题。

await table.CreateIfNotExistsAsync();

关于azure-cosmosdb - Azure CosmosDB 表 API - table.CreateIfNotExists() 调用挂起,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46442979/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com