我正在尝试将通过Visual Studio 2015在C#中编码的机器人发布到AWS。我安装了Amazon Cloud SDK,并且能够将bot成功发布到AWS。我使用它给出的地址(http://benbot-dev.us-west-2.elasticbeanstalk.com/)更新了bot端点。但是,当我去Microsoft Bots站点测试机器人连接时,它说无法连接到远程服务器。请帮忙。我认为这是https端点问题。但我不知道如何获得API网关端点。
<<<<<<<<<<
500 InternalServerError
System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 52.42.245.162:443
at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.EndGetRequestStream(IAsyncResult asyncResult, TransportContext& context)
at System.Net.Http.HttpClientHandler.GetRequestStreamCallback(IAsyncResult ar)
--- End of inner exception stack trace ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Intercom.DevPortal.Server.Controllers.BotManagerController.<PingV3BotAsync>d__54.MoveNext() in C:\a\1\s\DevPortalLib\Controllers\BotManagerController.cs:line 1420
>>>>>>>>>>>>>>>>
答案 0 :(得分:0)
此异常消息告诉您,在服务器代码中,您尝试通过52.42.245.162到达服务器,并且此服务器无法访问(更具体地说,https端口443无法访问)。此IP解析为某个AWS主机(使用nslookup
命令查找此内容,请参阅enumerate
)。您可以尝试ping此IP,或尝试查看端口80是否可访问(两者都不是来自我的主机)。或者您可以尝试枚举是否在该主机上打开任何其他端口(搜索google / bing以获取有关如何执行此操作的说明)。如果您无法从主机访问该端口,则Microsoft Bots站点也无法访问该端口。如果您的服务在该IP上运行,最可能的原因是您必须打开AWS上的端口才能从公共互联网访问(搜索google / bing for aws open port
或aws allow ssh
)