环境: - Ubuntu 22.04 - Python3
我遵循的步骤如下: 1. 使用Bot Framework SDK创建机器人 - 在本地仿真器中正常工作。 2. 教程:在Azure中配置机器人。 3. 教程:发布基本机器人 - 使用测试网络聊天在Azure中正常工作。 4. 安装和配置Tunneling(ngrok) - Ngrok的状态页(http://localhost:4040/status)显示它处于在线状态。 - “Ngrok Status Viewer”表明,仿真器中的“隧道状态”是错误的。 - 我在仿真器中收到错误消息:“Failed to spawn ngrok. Please go to the Ngrok Status Viewer and download the log file for a more detailed view of the error.”
{
"error_code": 102,
"status_code": 400,
"msg": "invalid tunnel configuration",
"details":
{
"err": "yaml: unmarshal errors:\n line 1: field region not found in type config.HTTPv2Tunnel\n line 1: field path not found in type config.HTTPv2Tunnel",
},
}
编辑1:根据@sairamtadepalli-mt的建议
如果我在配置文件中更改Ngrok的端口(web_addr
),我会得到一个新的错误:
Connecting to bot on https://XXX.azurewebsites.net/api/messages
ngrok reconnected.
ngrok listening on http://localhost:36599
ngrok traffic inspector:
Will bypass ngrok for local addresses
Failed to spawn ngrok. Please go to the Ngrok Status Viewer and download the log file for a more detailed view of the error.
Error: The bot is remote, but the service URL is localhost. Without tunneling software you will not receive replies.
Connecting to bots hosted remotely
Configure ngrok
编辑2:根据@sairamtadepalli-mt的建议:
这是我在“状态查看器”和控制台中看到的内容(仍然是最初的错误...):
“Ngrok状态查看器”中的错误信息:
似乎ngrok隧道已不复存在。尝试重新连接到Ngrok,或检查日志以获取详细错误说明。
控制台中的错误信息:
Failed to spawn ngrok Error: {"error_code":102,"status_code":400,"msg":"invalid tunnel configuration","details":{"err":"yaml: unmarshal errors:\n line 1: field region not found in type config.HTTPv2Tunnel\n line 1: field path not found in type config.HTTPv2Tunnel"}}
at NgrokInstance.runTunnel (/tmp/.mount_BotFraqqaRh3/resources/app.asar/app/server/ngrok.js:257:17)
at async NgrokInstance.connect (/tmp/.mount_BotFraqqaRh3/resources/app.asar/app/server/ngrok.js:120:24)
at async /tmp/.mount_BotFraqqaRh3/resources/app.asar/app/server/ngrokService.js:165:15
apt
卸载并重新安装了 Ngrok(curl -s https://ngrok-agent.s3.amazonaws.com/ngrok.asc | sudo tee /etc/apt/trusted.gpg.d/ngrok.asc >/dev/null && echo "deb https://ngrok-agent.s3.amazonaws.com buster main" | sudo tee /etc/apt/sources.list.d/ngrok.list && sudo apt update && sudo apt install ngrok
),但即使在计算机重启后仍然存在相同的问题。 - fleurycsnap
(snap install ngrok
)进行清除和重新安装。但是问题依旧。 - fleurycstdout
中显示的错误消息是:Failed to spawn ngrok Error: {"error_code":102,"status_code":400,"msg":"invalid tunnel configuration","details":{"err":"yaml: unmarshal errors:\n line 1: field region not found in type config.HTTPv2Tunnel\n line 1: field path not found in type config.HTTPv2Tunnel"}}
。 - fleuryc