POST 500 directline.postActivity
My environment is VS2017.
I selected the Bot Framework template ->botBuilderEchoBot

Run the application and Configured the end point in the Bot Emulator.

i sent a message and received this exception POST500directline.postActivity
With the above steps the application is working fine in others system.
Is there any configuration issue with my system?
This is the Code that i am using:
using System.Net; using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using Microsoft.Bot.Builder.Dialogs; using Microsoft.Bot.Connector;
namespace EchoBot
{
[BotAuthentication]
public class MessagesController : ApiController
{
///
private Activity HandleSystemMessage(Activity message)
{
string messageType = message.GetActivityType();
if (messageType == ActivityTypes.DeleteUserData)
{
// Implement user deletion here
// If we handle user deletion, return a real message
}
else if (messageType == ActivityTypes.ConversationUpdate)
{
// Handle conversation state changes, like members being added and removed
// Use Activity.MembersAdded and Activity.MembersRemoved and Activity.Action for info
// Not available in all channels
}
else if (messageType == ActivityTypes.ContactRelationUpdate)
{
// Handle add/remove from contact lists
// Activity.From + Activity.Action represent what happened
}
else if (messageType == ActivityTypes.Typing)
{
// Handle knowing that the user is typing
}
else if (messageType == ActivityTypes.Ping)
{
}
return null;
}
}
}
This is log message:
"{\r\n "message": "An error has occurred.",\r\n "exceptionMessage": "An error occurred while sending the request.",\r\n "exceptionType": "System.Net.Http.HttpRequestException",\r\n "stackTrace": " at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.Rest.RetryDelegatingHandler.<>c__DisplayClass11_0.<1.<Rest>d__5.MoveNext() in D:\\\\a\\\\1\\\\s\\\\CSharp\\\\Library\\\\Microsoft.Bot.Builder\\\\Dialogs\\\\DialogTask.cs:line 164\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n at Microsoft.Bot.Builder.Internals.Fibers.Wait2.<Microsoft-Bot-Builder-Internals-Fibers-IWait1.<Microsoft-Bot-Builder-Internals-Fibers-IFrameLoop<C>-PollAsync>d__9.MoveNext() in D:\\\\a\\\\1\\\\s\\\\CSharp\\\\Library\\\\Microsoft.Bot.Builder\\\\Fibers\\\\Fiber.cs:line 0\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n at Microsoft.Bot.Builder.Internals.Fibers.Fiber1.<Microsoft-Bot-Builder-Internals-Fibers-IFiberLoop2.Microsoft.Bot.Builder.Internals.Fibers.IAwaiter<T>.GetResult() in D:\\\\a\\\\1\\\\s\\\\CSharp\\\\Library\\\\Microsoft.Bot.Builder\\\\Fibers\\\\Wait.cs:line 378\\r\\n at Microsoft.Bot.Builder.Dialogs.Chain.LoopDialog1.1.<Rest>d__5.MoveNext() in D:\\\\a\\\\1\\\\s\\\\CSharp\\\\Library\\\\Microsoft.Bot.Builder\\\\Dialogs\\\\DialogTask.cs:line 164\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n at Microsoft.Bot.Builder.Internals.Fibers.Wait2.<Microsoft-Bot-Builder-Internals-Fibers-IWait1.<Microsoft-Bot-Builder-Internals-Fibers-IFrameLoop<C>-PollAsync>d__9.MoveNext() in D:\\\\a\\\\1\\\\s\\\\CSharp\\\\Library\\\\Microsoft.Bot.Builder\\\\Fibers\\\\Fiber.cs:line 0\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n at Microsoft.Bot.Builder.Internals.Fibers.Fiber1.<Microsoft-Bot-Builder-Internals-Fibers-IFiberLoop1.<Microsoft-Bot-Builder-Base-IEventLoop-PollAsync>d__5.MoveNext() in D:\\\\a\\\\1\\\\s\\\\CSharp\\\\Library\\\\Microsoft.Bot.Builder\\\\Dialogs\\\\ScoringEventLoop.cs:line 87\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n at Microsoft.Bot.Builder.Dialogs.Internals.EventLoopDialogTask.<Microsoft-Bot-Builder-Dialogs-Internals-IPostToBot-PostAsync>d__3.MoveNext() in D:\\\\a\\\\1\\\\s\\\\CSharp\\\\Library\\\\Microsoft.Bot.Builder\\\\Dialogs\\\\DialogTask.cs:line 435\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n at Microsoft.Bot.Builder.Dialogs.Internals.SetAmbientThreadCulture.<Microsoft-Bot-Builder-Dialogs-Internals-IPostToBot-PostAsync>d__3.MoveNext() in D:\\\\a\\\\1\\\\s\\\\CSharp\\\\Library\\\\Microsoft.Bot.Builder\\\\ConnectorEx\\\\PostToBot.cs:line 103\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n at Microsoft.Bot.Builder.Dialogs.Internals.QueueDrainingDialogTask.<Microsoft-Bot-Builder-Dialogs-Internals-IPostToBot-PostAsync>d__4.MoveNext() in D:\\\\a\\\\1\\\\s\\\\CSharp\\\\Library\\\\Microsoft.Bot.Builder\\\\Dialogs\\\\DialogTask.cs:line 455\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n at Microsoft.Bot.Builder.Dialogs.Internals.PersistentDialogTask.<Microsoft-Bot-Builder-Dialogs-Internals-IPostToBot-PostAsync>d__3.MoveNext() in D:\\\\a\\\\1\\\\s\\\\CSharp\\\\Library\\\\Microsoft.Bot.Builder\\\\Dialogs\\\\DialogTask.cs:line 481\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n at Microsoft.Bot.Builder.Dialogs.Internals.PersistentDialogTask.<Microsoft-Bot-Builder-Dialogs-Internals-IPostToBot-PostAsync>d__3.MoveNext() in D:\\\\a\\\\1\\\\s\\\\CSharp\\\\Library\\\\Microsoft.Bot.Builder\\\\Dialogs\\\\DialogTask.cs:line 485\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n at Microsoft.Bot.Builder.Dialogs.Internals.ExceptionTranslationDialogTask.<Microsoft-Bot-Builder-Dialogs-Internals-IPostToBot-PostAsync>d__2.MoveNext() in D:\\\\a\\\\1\\\\s\\\\CSharp\\\\Library\\\\Microsoft.Bot.Builder\\\\Dialogs\\\\DialogTask.cs:line 403\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n at Microsoft.Bot.Builder.Dialogs.Internals.SerializeByConversation.<Microsoft-Bot-Builder-Dialogs-Internals-IPostToBot-PostAsync>d__4.MoveNext() in D:\\\\a\\\\1\\\\s\\\\CSharp\\\\Library\\\\Microsoft.Bot.Builder\\\\ConnectorEx\\\\PostToBot.cs:line 129\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n at Microsoft.Bot.Builder.Dialogs.Internals.PostUnhandledExceptionToUser.<Microsoft-Bot-Builder-Dialogs-Internals-IPostToBot-PostAsync>d__5.MoveNext() in D:\\\\a\\\\1\\\\s\\\\CSharp\\\\Library\\\\Microsoft.Bot.Builder\\\\ConnectorEx\\\\PostToBot.cs:line 156\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n at Microsoft.Bot.Builder.Dialogs.Internals.PostUnhandledExceptionToUser.<Microsoft-Bot-Builder-Dialogs-Internals-IPostToBot-PostAsync>d__5.MoveNext() in D:\\\\a\\\\1\\\\s\\\\CSharp\\\\Library\\\\Microsoft.Bot.Builder\\\\ConnectorEx\\\\PostToBot.cs:line 169\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n at Microsoft.Bot.Builder.Dialogs.Internals.LogPostToBot.<Microsoft-Bot-Builder-Dialogs-Internals-IPostToBot-PostAsync>d__3.MoveNext() in D:\\\\a\\\\1\\\\s\\\\CSharp\\\\Library\\\\Microsoft.Bot.Builder\\\\ConnectorEx\\\\IActivityLogger.cs:line 109\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n at Microsoft.Bot.Builder.Dialogs.Conversation.<SendAsync>d__11.MoveNext() in D:\\\\a\\\\1\\\\s\\\\CSharp\\\\Library\\\\Microsoft.Bot.Builder.Autofac\\\\Dialogs\\\\Conversation.cs:line 182\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n at Microsoft.Bot.Builder.Dialogs.Conversation.<SendAsync>d__6.MoveNext() in D:\\\\a\\\\1\\\\s\\\\CSharp\\\\Library\\\\Microsoft.Bot.Builder.Autofac\\\\Dialogs\\\\Conversation.cs:line 108\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.GetResult()\\r\\n at EchoBot.MessagesController.<Post>d__0.MoveNext() in c:\\\\users\\\\jeevan.ganta\\\\source\\\\repos\\\\EchoBot\\\\EchoBot\\\\Controllers\\\\MessagesController.cs:line 21\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n at System.Threading.Tasks.TaskHelpersExtensions.<CastToObject>d__31.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ApiControllerActionInvoker.
@dandriscoll @HenrikFrystykNielsen @nwhitmont @EricDahlvang
Unfortunately I couldn't reproduce the issue. Can you please try live debug against the Bot application to determine where the exception is being thrown?
Closing the issue assuming it as resolved. Please reopen a new issue if it still persists.
@fanidamj @jeevankumarganta currently having this issue. tried setting ngrok as per documentation https://github.com/microsoft/botframework-emulator/wiki/Tunneling-(ngrok), still getting the same error. In emulator Inspector-JSON I am getting the log message as posted above. Is the "Azure Bot Service Configuration" details mandatory in Bot Emulator while adding an Endpoint for the bot? Since I could find those info in azure portal
Because your tunnel(ngrok) is disconnect or not configured. We must config tunnel(ngrok) when we debug bot local.