Connection Error on Microsoft Bot after publishing it on AWS

二次信任 提交于 2019-12-12 02:35:47

问题


I am trying to publish a bot that I coded in C# through visual studio 2015 on to AWS. I installed the Amazon Cloud SDK and was able to successfully publish the bot to AWS. I updated the bot endpoint with the address it gave (http://benbot-dev.us-west-2.elasticbeanstalk.com/). But when I go to Microsoft Bots site and test the bot connection it says Unable to connect to the remote server. Please help. I am thinking it is the https endpoint issue. But I am not sure how to get an API Gateway endpoint, if I should.

<<<<<<<<<<
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
>>>>>>>>>>>>>>>>

回答1:


This exception message tells you that within your server code you are trying to reach server at 52.42.245.162, and this server is inaccessible (more specifically, https port 443 is inaccessible). This IP resolves to some AWS host (use nslookup command to find this out, see this answer). You can try to ping this IP, or try to see if port 80 is accessible (both are not from my host). Or you can try to enumerate if any other ports are open on that host (search google/bing for instructions how to do that). If you can't reach that port from your host, Microsoft Bots site can't reach it either. If your service is running on that IP, the most probably cause is that you have to open the port on AWS to be accessible from public internet (search google/bing for aws open port or aws allow ssh)



来源:https://stackoverflow.com/questions/39013866/connection-error-on-microsoft-bot-after-publishing-it-on-aws

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!