Web Chat not able to communicate with bot on some Mac machines
See original GitHub issueDescribe 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:
- Create or open a bot
- Start the bot
- Open the Web Chat pane
- Try to communicate with the bot by typing messages in the Web Chat send box
- 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:
- Created 2 years ago
- Reactions:2
- Comments:5 (5 by maintainers)
Top GitHub Comments
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.
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.