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.

Web Chat not able to communicate with bot on some Mac machines

See original GitHub issue

Describe the bug

Some Mac users are experiencing issues when trying to communicate with a bot via the embedded Web Chat in Composer. From the logs, it looks like the runtime is getting a 403 when trying to reply to an activity.

OS Versions experiencing the bug: macOS Monterey 12.1

Note: We are not seeing this issue on Linux & Windows

Version

We know 2.1.1 to be a version in which we have observed the bug. However, we have not determined the earliest release in which the bug is present.

Browser

  • Electron distribution

OS

  • macOS
  • Windows
  • Ubuntu

To Reproduce

Steps to reproduce the behavior:

  1. Create or open a bot
  2. Start the bot
  3. Open the Web Chat pane
  4. Try to communicate with the bot by typing messages in the Web Chat send box
  5. Observe that the messages are not sending successfully in the Web Chat tab of the log

Expected behavior

The user should be able to send messages to the bot and receive responses on Mac.

Additional context

Here are the runtime errors we were seeing on the server side of Composer when observing this bug (you can see this output by starting the Composer executable from a terminal window):

PUT /api/projects/56762.55293620476/files/appsettings.json 200 48.405 ms - 34
POST /api/telemetry/events 200 0.774 ms - 2
POST /v3/conversations 201 1.617 ms - 302
POST /api/telemetry/events 200 0.693 ms - 2
2022-02-01 11:28:44.257 Bot Framework Composer[44452:2687805] Warning: Expected min height of view: (<NSPopoverTouchBarItemButton: 0x7fa1c3025130>) to be less than or equal to 30 but got a height of 32.000000. This error will be logged once per view in violation.
  composer:extensions:localpublish:44516 fail: Microsoft.Bot.Builder.Dialogs.Adaptive.Runtime.CoreBotAdapter[0]
      [OnTurnError] unhandled error : Operation returned an invalid status code 'Forbidden'
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.Dialogs.Adaptive.Actions.SendActivity.BeginDialogAsync(DialogContext dc, Object options, CancellationToken cancellationToken)
   at Microsoft.Bot.Builder.Dialogs.DialogContext.BeginDialogAsync(String dialogId, Object options, CancellationToken cancellationToken)
   at Microsoft.Bot.Builder.Dialogs.Adaptive.Actions.ActionScope.BeginActionAsync(DialogContext dc, Int32 offset, CancellationToken cancellationToken)
   at Microsoft.Bot.Builder.Dialogs.Adaptive.Actions.ActionScope.BeginDialogAsync(DialogContext dc, Object options, CancellationToken cancellationToken)
   at Microsoft.Bot.Builder.Dialogs.DialogContext.BeginDialogAsync(String dialogId, Object options, CancellationToken cancellationToken)
   at Microsoft.Bot.Builder.Dialogs.DialogContext.ReplaceDialogAsync(String dialogId, Object options, CancellationToken cancellationToken)
   at Microsoft.Bot.Builder.Dialogs.Adaptive.Actions.IfCondition.BeginDialogAsync(DialogContext dc, Object options, CancellationToken cancellationToken)
   at Microsoft.Bot.Builder.Dialogs.DialogContext.BeginDialogAsync(String dialogId, Object options, CancellationToken cancellationToken)
   at Microsoft.Bot.Builder.Dialogs.Adaptive.Actions.ActionScope.BeginActionAsync(DialogContext dc, Int32 offset, CancellationToken cancellationToken)
   at Microsoft.Bot.Builder.Dialogs.Adaptive.Actions.Foreach.NextItemAsync(DialogContext dc, CancellationToken cancellationToken)
   at Microsoft.Bot.Builder.Dialogs.Adaptive.Actions.Foreach.BeginDialogAsync(DialogContext dc, Object options, CancellationToken cancellationToken)
   at Microsoft.Bot.Builder.Dialogs.DialogContext.BeginDialogAsync(String dialogId, Object options, CancellationToken cancellationToken)
   at Microsoft.Bot.Builder.Dialogs.Adaptive.Actions.ActionScope.BeginActionAsync(DialogContext dc, Int32 offset, CancellationToken cancellationToken)
   at Microsoft.Bot.Builder.Dialogs.Adaptive.Actions.ActionScope.BeginDialogAsync(DialogContext dc, Object options, CancellationToken cancellationToken)
   at Microsoft.Bot.Builder.Dialogs.DialogContext.BeginDialogAsync(String dialogId, Object options, CancellationToken cancellationToken)
   at Microsoft.Bot.Builder.Dialogs.Adaptive.AdaptiveDialog.ContinueActionsAsync(DialogContext dc, Object options, CancellationToken cancellationToken)
   at Microsoft.Bot.Builder.Dialogs.Adaptive.AdaptiveDialog.BeginDialogAsync(DialogContext dc, Object options, CancellationToken cancellationToken)
   at Microsoft.Bot.Builder.Dialogs.DialogContext.BeginDialogAsync(String dialogId, Object options, CancellationToken cancellationToken)
   at Microsoft.Bot.Builder.Dialogs.DialogExtensions.InnerRunAsync(ITurnContext turnContext, String dialogId, DialogContext dialogContext, CancellationToken cancellationToken)
   at Microsoft.Bot.Builder.Dialogs.DialogExtensions.InternalRunAsync(ITurnContext turnContext, String dialogId, DialogContext dialogContext, DialogStateManagerConfiguration stateConfiguration, CancellationToken cancellationToken)
   at Microsoft.Bot.Builder.Dialogs.DialogExtensions.InternalRunAsync(ITurnContext turnContext, String dialogId, DialogContext dialogContext, DialogStateManagerConfiguration stateConfiguration, CancellationToken cancellationToken)
   at Microsoft.Bot.Builder.Dialogs.DialogExtensions.RunAsync(Dialog dialog, ITurnContext turnContext, IStatePropertyAccessor`1 accessor, CancellationToken cancellationToken)
   at Microsoft.Bot.Builder.Dialogs.Adaptive.AdaptiveDialogBot.OnTurnAsync(ITurnContext turnContext, CancellationToken cancellationToken)
   at Microsoft.Bot.Builder.SetSpeakMiddleware.OnTurnAsync(ITurnContext turnContext, NextDelegate next, CancellationToken cancellationToken)
   at Microsoft.Bot.Builder.MiddlewareSet.ReceiveActivityWithStatusAsync(ITurnContext turnContext, BotCallbackHandler callback, CancellationToken cancellationToken)
   at Microsoft.Bot.Builder.BotAdapter.RunPipelineAsync(ITurnContext turnContext, BotCallbackHandler callback, CancellationToken cancellationToken)
+5s

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
tonyanzianocommented, Feb 11, 2022

We found the root cause of the bug:

The new Mac Monterey release uses the port 5000 for some OS-level function. We were using port 5000 to mount the mock Direct Line that Composer uses to communicate with the running bot. We had some logic to dynamically use a different port if 5000 was taken, but it was being used after the Direct Line server was mounted.

There should be a nightly release of Composer with this fix available tonight around 12 AM (midnight) PST.

1reaction
tonyanzianocommented, Feb 2, 2022

Ahh, my mistake. I thought you had a Mac. It seems like users on Mac Monterey (12.1) are experiencing this issue. I tested and Linux, but was not able to repro this issue. Let me know if you have any success.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot bot configuration issues - Bot Service
Bot doesn't work in Web Chat · Open the Overview pane. · Copy the Messaging endpoint and paste it into your browser.
Read more >
Enabling interactions with bots - Slack API
Enable conversations between users and apps in Slack by building bots. What are Bots?
Read more >
Chatbots: A new way to communicate with your customers
A chatbot is a service powered by rules and sometimes artificial intelligence. Users communicate with a chatbot via the chat interface, similar to...
Read more >
ChatGPT: how to use the amazing AI chatbot that went viral
Using the ChatGPT chatbot is fairly simple, as all you have to do is type in your text and receive the information. However,...
Read more >
Eliza, a chatbot therapist - NJIT
ELIZA: a very basic Rogerian psychotherapist chatbot. Talk to Eliza by typing your questions and answers in the input box. > Hello, I...
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