Internal Server Error 500 from Web Chat, probably firewall issue
See original GitHub issueDescribe the bug
After clicking “Open Web Chat” with standard “Empty Bot” template (and others), I get in Electron:
[11:14:41 AM]POST201/v3/conversations
[11:14:42 AM]POST500/v3/directline/conversations/c0e7bb7d-eff9-41d1-aa9b-de837ec4cea6%7Clivechat/activities
An error occurred posting activity to the bot. Internal Server Error
in Chrome/Firefox
POST http://localhost:5001/v3/directline/conversations/daac9a83-2eae-4c6c-9d7d-f54a3bec4d89%7Clivechat/activities 500 (Internal Server Error)
and in the console with DEBUG=composer'*'
:
GET /api/publish/14829.393574961314/status/default/37648115-d7a3-4071-977e-f4ce37fd1a4d 200 37.735 ms - 84
composer:bot-project Schemas directory found. +396ms
composer:bot-project Customized SDK schema found +2ms
composer:bot-project UI Schema found. +2ms
PUT /api/projects/14829.393574961314/files/appsettings.json 200 40.403 ms - 34
POST /v3/conversations 201 0.582 ms - 302
composer:extensions:localpublish:17974 fail: Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[1]
An unhandled exception has occurred while executing the request.
Microsoft.Bot.Schema.ErrorResponseException: Operation returned an invalid status code 'Forbidden'
at Microsoft.Bot.Connector.Conversations.ReplyToActivityWithHttpMessagesAsync(String conversationId, String activityId, Activity activity, Dictionary`2 customHeaders, CancellationToken cancellationToken)
at Microsoft.Bot.Connector.ConversationsExtensions.ReplyToActivityAsync(IConversations operations, String conversationId, String activityId, Activity activity, CancellationToken cancellationToken)
at Microsoft.Bot.Builder.CloudAdapterBase.SendActivitiesAsync(ITurnContext turnContext, Activity[] activities, CancellationToken cancellationToken)
at Microsoft.Bot.Builder.TurnContext.<>c__DisplayClass31_0.<<SendActivitiesAsync>g__SendActivitiesThroughAdapter|1>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.Bot.Builder.SetSpeakMiddleware.<>c__DisplayClass3_0.<<OnTurnAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.Bot.Builder.TurnContext.SendActivityAsync(IActivity activity, CancellationToken cancellationToken)
at Microsoft.Bot.Builder.TurnContext.SendActivityAsync(String textReplyToSend, String speak, String inputHint, CancellationToken cancellationToken)
at Microsoft.Bot.Builder.Dialogs.Adaptive.Runtime.CoreBotAdapter.<.ctor>b__0_0(ITurnContext turnContext, Exception exception)
at Microsoft.Bot.Builder.BotAdapter.RunPipelineAsync(ITurnContext turnContext, BotCallbackHandler callback, CancellationToken cancellationToken)
at Microsoft.Bot.Builder.CloudAdapterBase.ProcessActivityAsync(AuthenticateRequestResult authenticateRequestResult, Activity activity, BotCallbackHandler callback, CancellationToken cancellationToken)
at Microsoft.Bot.Builder.CloudAdapterBase.ProcessActivityAsync(String authHeader, Activity activity, BotCallbackHandler callback, CancellationToken cancellationToken)
at Microsoft.Bot.Builder.Integration.AspNet.Core.CloudAdapter.ProcessAsync(HttpRequest httpRequest, HttpResponse httpResponse, IBot bot, CancellationToken cancellationToken)
at Empty_2.Controllers.BotController.PostAsync(String route) in /Users/s.buchholz/BotFrameworkComposer/Empty_2/Empty_2/Controllers/BotController.cs:line 67
at lambda_method(Closure , Object )
at Microsoft.Extensions.Internal.ObjectMethodExecutorAwaitable.Awaiter.GetResult()
at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|19_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
+7s
POST /v3/directline/conversations/58fa9f2e-d3fc-4b8c-b372-4e455a12e426|livechat/activities 500 988.940 ms - 105
Version
Version: 2.1.1 Electron: 8.2.4 Chrome: 80.0.3987.165 NodeJS: 12.13.0 V8: 8.0.426.27-electron.0
Browser
- Electron distribution
- Chrome
- Safari
- Firefox
- Edge
OS
- macOS Monterey 12.0.1 (x86)
- Windows
- Ubuntu
To Reproduce
Steps to reproduce the behavior:
- Go to ‘Home’ “Welcome to Bot Framework Composer”
- Click on ‘Create New’
- Use default C# “Empty Bot” template
- Click on “Next”
- Click on “Create”
- Click on “Start bot”
- Click on “Open Web Chat”
Expected behavior
Bot should have said “Welcome to your bot”
Screenshots
Additional context
I had existing bots which all used to work and now show the same error. I think the problem started after upgrading from MacOS Catalina to Monterey. All bots still work in the Emulator. Have updated node.js and .NET versions, made no difference. I notice someone else’s (working!) bot on MacOS Catalina is using localhost:5000 instead of localhost:5001 out of the box. Not sure whether that’s relevant…
Issue Analytics
- State:
- Created 2 years ago
- Comments:24 (5 by maintainers)
Top Results From Across the Web
How to Fix Internal Server Error 500 - Hivelocity
HTTP Error 500 designates a general error keeping a server from processing requests, usually due to an incorrect permission or coding error.
Read more >How to Fix a 500 Internal Server Error on Your WordPress Site
The 500 Internal Server Error status code occurs when the server encounters an error that prevents it from fulfilling the request.
Read more >How to Fix a 500 Internal Server Error - Lifewire
The 500 Internal Server Error is a very general HTTP status code that means something has gone wrong on the website's server, but...
Read more >500 Internal Server Error | InMotion Hosting
This is a very common issue with PHP files. In general on our servers, PHP file permissions should not be higher than 775....
Read more >HTTP 500 Internal Server Error: What It Means & How to Fix It
HTTP 500 errors aren't problems with your computer, browser, or internet connection. Instead, they're a generic response that catches any ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Not sure about the versioning problem mentioned later in the thread, however, I was having the same problem on MacOS and I solved it by turning off “AirPlay Receiver” in Settings->Sharing. After restarting Composer, the app started using port 5000 as expected (before it was using 5001). Aside from the libs versioning problem, it would be nice if Composer worked with dynamic ports, and avoid conflicts with specific OS ports, e.g. detect which port is in use rather than assume it’s 5000.
Yep, downgrading Orchestrator to 4.14.4 fixes the root bot.
We’ve seen a similar issue with other packages. Can’t Composer account for this in some much more sane way?