question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Internal Server Error 500 from Web Chat, probably firewall issue

See original GitHub issue

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

  1. Go to ‘Home’ “Welcome to Bot Framework Composer”
  2. Click on ‘Create New’
  3. Use default C# “Empty Bot” template
  4. Click on “Next”
  5. Click on “Create”
  6. Click on “Start bot”
  7. Click on “Open Web Chat”

Expected behavior

Bot should have said “Welcome to your bot”

Screenshots

image

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:closed
  • Created 2 years ago
  • Comments:24 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
dluccommented, Apr 19, 2022

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.

4reactions
JonathanFingoldcommented, Nov 24, 2021

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?

Read more comments on GitHub >

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

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found