- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我们最近更新了我们的机器人,使用以下文章从即将弃用的默认 BotState 服务迁移到 Azure Cosmos DB 存储: https://learn.microsoft.com/en-us/bot-framework/dotnet/bot-builder-dotnet-state-azure-cosmosdb
以下模块在 Application_Start
方法中的 Conversation Container 中注册:
public class CustomBotStateServiceModule : Module
{
protected override void Load(ContainerBuilder builder)
{
var stateStore = new DocumentDbBotDataStore(
new Uri(ConfigurationManager.AppSettings.Get("EndpointUri")),
ConfigurationManager.AppSettings.Get("PrimaryKey"),
ConfigurationManager.AppSettings.Get("DatabaseId"),
"BotState");
builder.Register(c => stateStore)
.Keyed<IBotDataStore<BotData>>(AzureModule.Key_DataStore)
.AsSelf()
.SingleInstance();
builder.Register(c => new CachingBotDataStore(stateStore, CachingBotDataStoreConsistencyPolicy.ETagBasedConsistency))
.As<IBotDataStore<BotData>>()
.AsSelf()
.InstancePerLifetimeScope();
}
}
在我们使用 Bot Channel Emulator 进行本地测试期间,我们注意到,无论何时首次访问 BotState,Visual Studio 的调试输出中都会打印以下错误:
DocDBTrace Information: 0 : DocumentClient with id 1 initialized at endpoint: https://<our-instance>.documents.azure.com/ with ConnectionMode: Gateway, connection Protocol: Https, and consistency level: null
DocDBTrace Information: 0 : RefreshLocationAsync() refreshing locations
DocDBTrace Information: 0 : Set WriteEndpoint https://<our-instance>-westus.documents.azure.com/ ReadEndpoint https://<our-instance>-westus.documents.azure.com/
DocDBTrace Error: 0 : DocumentClientException with status code: NotFound, message: Message: {"Errors":["Resource Not Found"]}
ActivityId: <activity-id>, Request URI: /apps/<app-id>/services/<service-id>/partitions/<partition-id>/replicas/<replica-id>/, RequestStats:
ResponseTime: 2018-01-25T08:20:59.3067000Z, StoreReadResult: StorePhysicalAddress: rntbd://<docdb-location>.documents.azure.com:14043/apps/<app-id>/services/<service-id>/partitions/<partition-id>/replicas/<replica-id>/, LSN: 154, GlobalCommittedLsn: 151, PartitionKeyRangeId: 0, IsValid: True, StatusCode: 0, IsGone: False, IsNotFound: True, RequestCharge: 1, ItemLSN: -1, ResourceType: Document, OperationType: Read
, SDK: Microsoft.Azure.Documents.Common/1.19.162.2, and response headers: {
"x-ms-last-state-change-utc": "Wed, 24 Jan 2018 00:00:51.902 GMT",
"x-ms-schemaversion": "1.4",
"x-ms-xp-role": "1",
"x-ms-global-Committed-lsn": "151",
"x-ms-number-of-read-regions": "0",
"x-ms-request-charge": "1",
"x-ms-serviceversion": "version=1.19.162.2",
"x-ms-activity-id": "<activity-id>",
"Strict-Transport-Security": "max-age=31536000",
"x-ms-gatewayversion": "version=1.19.162.2",
"X-Cache": "MISS from <node>",
"Transfer-Encoding": "chunked",
"Connection": "keep-alive",
"Date": "Thu, 25 Jan 2018 08:20:58 GMT",
"Server": "Microsoft-HTTPAPI/2.0",
"Via": "1.1 <node> (squid)",
}
DocDBTrace Error: 0 : Operation will NOT be retried. Current attempt 0, Exception: Microsoft.Azure.Documents.DocumentClientException: Message: {"Errors":["Resource Not Found"]}
ActivityId: <activity-id>, Request URI: /apps/<app-id>/services/<service-id>/partitions/<partition-id>/replicas/<replica-id>/, RequestStats:
ResponseTime: 2018-01-25T08:20:59.3067000Z, StoreReadResult: StorePhysicalAddress: rntbd://<docdb-location>.documents.azure.com:14043/apps/<app-id>/services/<service-id>/partitions/<partition-id>/replicas/<replica-id>/, LSN: 154, GlobalCommittedLsn: 151, PartitionKeyRangeId: 0, IsValid: True, StatusCode: 0, IsGone: False, IsNotFound: True, RequestCharge: 1, ItemLSN: -1, ResourceType: Document, OperationType: Read
, SDK: Microsoft.Azure.Documents.Common/1.19.162.2, documentdb-dotnet-sdk/1.19.1 Host/32-bit MicrosoftWindowsNT6.1.7601ServicePack1
at Microsoft.Azure.Documents.Client.ClientExtensions.<ParseResponseAsync>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at Microsoft.Azure.Documents.GatewayStoreModel.<>c__DisplayClass10.<<InvokeAsync>b__f>d__12.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.Documents.BackoffRetryUtility`1.<>c__DisplayClass2.<<ExecuteAsync>b__0>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.Documents.BackoffRetryUtility`1.<ExecuteRetry>d__1b.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.Azure.Documents.BackoffRetryUtility`1.<ExecuteRetry>d__1b.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.Documents.BackoffRetryUtility`1.<ExecuteAsync>d__a.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.Documents.GatewayStoreModel.<InvokeAsync>d__1f.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.Documents.GatewayStoreModel.<ProcessMessageAsync>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.Documents.Client.DocumentClient.<ReadAsync>d__30c.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.Documents.Client.DocumentClient.<ReadDocumentPrivateAsync>d__18d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.Documents.BackoffRetryUtility`1.<>c__DisplayClass2.<<ExecuteAsync>b__0>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.Documents.BackoffRetryUtility`1.<ExecuteRetry>d__1b.MoveNext()
这些错误不久之后又打印了大约 1-2 次。尽管如此,我们的自定义 BotState 服务似乎工作正常,因为我们可以看到在相关 Cosmos DB 集合中创建的条目。
注意:我们并没有专门使用我们的 Cosmos DB 来存储 BotState 数据。我们还用它来存储机器人事件数据、日志等。它目前有两个具有多个集合的数据库。
这些错误的根本原因是什么?这是我们应该考虑警告的事情吗?一旦我们从容器注册中拔出自定义 BotState 服务,错误就消失了。
最佳答案
我可以在我这边重现这个问题,根据我的测试和研究,我发现当我们想将状态数据存储到 Azure Cosmos DB 集合时,Azure SDK 帮助我们检查文档是否存在,所以你可以看到该输出消息:当您的机器人应用程序首次存储数据时,您的 Visual Studio 输出窗口中的 "Resource Not Found"
。
如果您使用 Fiddler 捕获流量,您会发现 SDK 发出请求以检测该文档是否存在于该集合中。
如您所见,它只是SDK编写的输出消息,不会导致您的代码出现任何代码异常。
关于c# - Cosmos DB 在实现自定义 BotState 服务后抛出 "Resource Not Found"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48441262/
我们在日常使用电脑的时候,有些情况下可能会遇到出现提示found.000文件丢失损坏的情况。那么如果想要对found.000文件进行恢复,小编觉得可以在我们的文件夹选项中进行相关设置,找到被隐藏的文
下面的代码给出了“未找到”的输出。但我希望它能给出“发现”。我的错误在哪里? #include void compare(char *x, char *face); int i; int main(
为什么我的 git 不推送?我创建了存储库,但不断收到此消息: C:\Users\petey_000\rails_projects\first_app>git push -u github maste
我正在使用 Spring Boot 构建 Web API。端点之一采用 JSON 发布请求。我想在某些字段上设置验证消息。所以我在/src/main/resources 下添加了一个 Validati
我按照此页面上的说明进行操作: https://developers.facebook.com/docs/plugins/share-button/#settings 我得到一个工作共享对话框,但是当
如何在事件监听器中触发重定向到特定路由器? 有很多示例,但我找不到“GetResponseForExceptionEvent”的示例。例如,当我将 @roter 作为参数传递时,$this->rout
我使用下面的代码来发布 ssl 网络服务。当我浏览 https://localhost/ 它给我这个错误: 404 Not Found No context found for request 代码:
我正在尝试构建一个 docker 镜像但是正在获取 未找到 secret pip:未找到 对此有什么想法吗? docker 文件: FROM SHELL ["/bin/bash", "-c"] RU
我正在使用 indy TIDHTTP 编写一种方法来了解我在互联网上的服务器是否已关闭或同一服务器上的页面地址不可用。 我复制了 stackoverflow 上另一个线程中给出的建议: try I
我尝试将结果附加到列表中(如果找到),并将字符串“N/A”附加到列表中(如果未找到匹配项)。 show_version_lists 是来自各种网络设备的日志列表。 import re for resu
我在这里尝试加载关于我们的页面。但是找不到请求的页面。请提供此问题的解决方案。 查看: ">HOME /CI_timeline/
我不会问问题,而是回答一个问题,因为到目前为止我在网上找不到这个建议,并且自己刚刚弄清楚了这一点。分享是件好事,对吧? 所以在命令行上,我这样做了: sudo npm install -g cordo
我有一个脚本来处理一些参数并使用这些参数部署 Arm 模板,然后使用我的存储帐户中的 bacpac 文件创建数据库。当我的脚本尝试调用 cmdlet“New-AzSqlDatabaseImport”时
我使用“chrome://inspect”几天了。一切都很好。今天,由于某种原因,当我单击“检查”时,结果是“404 Not Found 找不到资源。” 这可能是什么原因? 我只能找到这个主题:htt
我的 Ubuntu 14.04 有一个奇怪的问题。我正在使用 Django-Rest-Framework 开发一个使用 Ionic 和 API 的移动应用程序。开发完成后,我下载了 jdk 和 And
我正在使用calabash-android-java测试使用 Xamarin 构建的混合应用程序。正如您在下面看到的,我能够查询 DOM 元素,甚至将一些信息记录到控制台,但是当我执行 touch 命
搜索功能非常有用,但我不确定如何为其添加某些“附加功能”。当有结果显示时,我还想说: "Your search returned x results." 后面是结果。 当没有结果显示时,我想说: "Y
我试图在我的应用程序中实现导航功能。当我尝试构建应用程序时,输出显示: Android resource linking failed /home/mateusz/AndroidStudioProje
我需要查询公共(public)项目提供的数据集。我创建了自己的项目并将他们的数据集添加到我的项目中。有一个表名为:domain_public .当我对该表进行查询时,我收到此错误: Query Fa
我对 Node.js 相当陌生,我使用的是下面页面中的教程。 http://www.9lessons.info/2017/02/create-restful-api-nodejs-mysql.html
我是一名优秀的程序员,十分优秀!