【问题标题】:Bot framework load testing fails with a 400 errorBot 框架负载测试失败并出现 400 错误
【发布时间】:2018-09-20 00:50:33
【问题描述】:

我正在尝试按照bot framework documentation 中的说明进行负载测试

首先,我将我的详细信息发送到 azure auth 并为自己获取一个令牌。然后,我通过以下方式将此令牌包含在我发送给机器人服务的消息中

{
    "type": "message",
    "id": "sdcsdcsd928323",
    "channelId": "emulator",
    "conversation": {
    "id": "5eak34ff2m25"
  },
  "serviceUrl": "https://xxx-bot-xxx.azurewebsites.net",
    "text": "I am feeling angry",
  "from": {
    "id": "default-user",
    "name": "User"
  },
    "recipient": {
    "id": "dack329f3nfb",
    "name": "Bot"
  }
}

当我在客户端收到 202 Accepted 响应时。我的后端日志显示以下错误:

Error: Failed to perform the requested operation on Azure Table. Message: The property value exceeds the maximum allowed size (64KB). If the property value is a string, it is UTF-16 encoded and the maximum number of characters should be 32K or less.
RequestId:79e296f0-3002-0039-37e5-390397000000

我猜该机器人正试图将其状态保存在 azure 表中,但某些值太大了。关于我可能出错的地方有什么想法吗?

我还收到一条后续错误消息:猜测其相关性

Error: Request to 'https://xxxx-xxx-xxxx.azurewebsites.net/v3/conversations/5eak34ff2m25/activities/sdcsdcsd928323' failed: [404] Not Found

【问题讨论】:

  • 我将 TableBotDataStore 与机器人应用程序一起使用并进行负载测试,得到 202 响应,但没有遇到有关 Azure 表存储的问题。您能否进一步说明“我的后端日志显示以下错误”?您如何获取日志?
  • 您使用的是自定义状态客户端吗?您是否还为机器人的回复实施了 MockChannel? github.com/Microsoft/BotFramework-Samples/blob/master/…
  • 请分享您看到的错误的堆栈跟踪。
  • @EricDahlvang - 抱歉回复晚了。关于 MockChannel ,恐怕我不熟悉 C# 代码,所以这里是我做的步骤 1. 部署机器人 2. 使用休息客户端从 MS 3 检索 JWT 令牌。向机器人发送帖子消息访问令牌
  • @FeiHan - 所以出于某种原因,机器人似乎正在向我的消息发送 202 响应,但在日志中我看到上述错误表明我已经超出了属性值

标签: azure botframework


【解决方案1】:

这个

错误:请求 'https://xxxx-xxx-xxxx.azurewebsites.net/v3/conversations/5eak34ff2m25/activities/sdcsdcsd928323' 失败:[404] 未找到

由于没有 MockChannel 设置:https://github.com/Microsoft/BotFramework-Samples/blob/master/blog-samples/CSharp/MockChannel/Controllers/MockChannelController.cs 这是一个 c# 示例,但显示了如何正确响应端点:

v3/conversations/{conversationId}/attachments/UploadAttachment
v3/conversations/{conversationId}/activities/{activityId}/members/GetActivityMembers
v3/conversations/{conversationId}/members/GetConversationMembers
v3/conversations/{conversationId}/activities/{activityId}/DeleteActivity
v3/conversations/{conversationId}/activities/{activityId}/UpdateActivity
v3/conversations/{conversationId}/activities/{activityId}/ReplyToActivity
v3/conversations/{conversationId}/activities/SendToConversation
v3/conversations/CreateConversation

这个

错误:无法在 Azure 表上执行请求的操作。 消息:属性值超出最大允许大小 (64KB)。 如果属性值是一个字符串,它是 UTF-16 编码的,并且 最大字符数应为 32K 或更少。 请求ID:79e296f0-3002-0039-37e5-390397000000

与其他事物有关。 bot 状态中存储了什么(用户数据、对话数据、私有对话数据和对话数据)?

【讨论】:

  • 我们正在存储除 dialogData 之外的所有对象
  • 这些数据包中存储了什么?
  • 现在,我们将用户信息存储在 userdata 中(唯一 id(小于 64 kb),多个时间戳)——conversationData,我们存储一些 UUID.v4()。我们还为多个使用 shortid npm 模块生成字符(7-14 个字符长,具有人类可读字符)的多个用户存储了一组唯一 ID
  • 最大字符数应为 32K 或更少
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-05-27
  • 2019-12-21
  • 2015-09-19
  • 2020-12-28
  • 2014-08-02
相关资源
最近更新 更多