0

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
>>>>>>>>>>>>>>>>
  • can your 'ping' from your local host reach 52.42.245.162 ? if yes, can you try to execute the same from your AWS service? – oldbam Aug 18 '16 at 09:42
  • Hi @oldbam. Txs for the help. No I am not able to ping. Request timed out. I am thinking t means that the bot was published but it is not linked to some API service??? or something like that which has a message endpoint where messages can be sent to and received from. But I dont know how that is done in AWS. They make it so complicated. – Stephen Raj Aug 18 '16 at 10:28

1 Answers1

0

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)

Community
  • 1
  • 1
oldbam
  • 2,397
  • 1
  • 16
  • 24
  • thanks much. after a lot of reading, so i tried to open the 443 port in the beanstalk environment and it asks for a SSL certificate. I am trying to request for a new SSL certificate from AWS Certificate Manager console and it asked for a website. Now I dont understand which website I should be giving. The bot's url?? It wont take that address because no amazon sites can be given as website there. So which website should be given. I dont have any website. I am just trying to publish a bot on AWS cloud but this complex steps in AWS is really making it so hard. – Stephen Raj Aug 23 '16 at 10:31
  • When one navigates to port 443, web server listening at that port presents a certificate which confirms its identity. Think of it as a passport issued by some authority. You are probably talking about your service hosted in AWS for which you are trying to obtain a valid certificate. In this case, it will be the address of your hosted service – oldbam Aug 24 '16 at 10:18