What causes the 500 Internal Server Error due to the local host: does 9000 fall into the scope of the bot?

Getting this error every time I try to send a message to my bot, or after it responds with three messages per line.

I put try/catch around the code that gets the exception (from the call to context.PostAsync ) and got this in my Application Insights instance:

 An error occurred while sending the request. Unable to connect to the remote server An attempt was made to access a socket in a way forbidden by its access permissions 127.0.0.1:9000 

Of course, nothing in my code hits localhost ... does anyone else see this?

Code that executes when an error occurs:

 var j = JToken.Parse(responseJson); foreach (var b in j["value"]) { await context.PostAsync($"{b.Value<string>("id")} - {b.Value<string>("name")}"); } 

When I launch the bot locally and use the emulator for testing, I get 3 output elements, but 500 on the 4th (which is not distorted so that json resolution does not work).

When I publish to Azure App Services, I get 500 errors without output.

+3
botframework
source share
3 answers

We had a similar problem in our application. We managed to solve 500 invalid answers without having the private LuisResult property in our dialog class, which was obtained from LuisDialog .

I assume that the class was marked as Serializable , it tried to serialize all the properties, and LuisResult could not be serialized.

Here's the code snippet:

Edit:

 [Serializable] public class YourDialog : LuisDialog<MySerializableClass> { private LuisResult _myPrivateProp; } 

To:

 [Serializable] public class YourDialog : LuisDialog<MySerializableClass> { private string _myPrivateProp;//or whatever } 
+3
source share

Have you connected to your deployed service through an emulator?

If so, to generate this error, because when we see a message from channelId = "emulator", asynchronous messages are redirected to http: // localhost: 9000. This will lead to the use of this port.

To test it, you must start from the test window on the bot configuration page or use the web chat control.

0
source share

I also encountered a "500 server internal error", updating to the latest "Bot Framework emulator" solved my problem.

Link to the Bot Framework emulator :

Documentation :

Hope this helps.

0
source share

All Articles