Botframework-solutions: System.Net.Sockets.SocketException when Assistant connects with Skill

Created on 1 Mar 2021  ·  4Comments  ·  Source: microsoft/botframework-solutions

What project is affected?

Virtual Assistant + Skill (both based on VSIX template)

What language is this in?

C#

What happens?

Exception caught in SendErrorMessageAsync : System.Net.Http.HttpRequestException: An attempt was made to access a socket in a way forbidden by its access permissions.

What are the steps to reproduce this issue?

  1. Both VA and Skill deployed and published in Azure
  2. ran the botskills connect...
  3. Re published the VA
  4. Open emulator and try skill through VA
  5. Error

    What were you expecting to happen?

No exception thrown

Can you share any logs, error output, etc.?

Stacktrace

Exception caught in SendErrorMessageAsync : System.Net.Http.HttpRequestException: An attempt was made to access a socket in a way forbidden by its access permissions.
 ---> System.Net.Sockets.SocketException (10013): An attempt was made to access a socket in a way forbidden by its access permissions.
   at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean allowHttp2, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.GetHttpConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.DiagnosticsHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
   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.BotFrameworkAdapter.SendActivitiesAsync(ITurnContext turnContext, Activity[] activities, CancellationToken cancellationToken)
   at Microsoft.Bot.Builder.TurnContext.<>c__DisplayClass25_0.<<SendActivitiesAsync>g__SendActivitiesThroughAdapter|1>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.Bot.Solutions.Middleware.SetSpeakMiddleware.<>c.<<OnTurnAsync>b__8_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.Bot.Builder.TranscriptLoggerMiddleware.<>c__DisplayClass3_0.<<OnTurnAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.Bot.Builder.TelemetryLoggerMiddleware.<>c__DisplayClass7_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 SouthworksAssistant.Adapters.DefaultAdapter.SendErrorMessageAsync(ITurnContext turnContext, Exception exception) in C:\Users\GonzaloLorieto\source\repos\southworks-assistant\SouthworksAssistant\Adapters\DefaultAdapter.cs:line 87

Skill packages

"Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.0" 
"Microsoft.Azure.CognitiveServices.ContentModerator" Version="2.0.0" 
"Microsoft.Azure.CognitiveServices.Language" Version="1.0.1-preview"
"Microsoft.Bot.Builder.AI.Luis" Version="4.9.3"
"Microsoft.Bot.Builder.AI.QnA" Version="4.9.3"
"Microsoft.Bot.Builder.ApplicationInsights" Version="4.9.3"
"Microsoft.Bot.Builder.Azure" Version="4.9.3"
"Microsoft.Bot.Builder.Integration.ApplicationInsights.Core" Version="4.9.3"
"Microsoft.Bot.Builder.Integration.AspNet.Core" Version="4.9.3" 
"Microsoft.Bot.Solutions" Version="1.0.1"
"Microsoft.Azure.Cosmos.Table" Version="1.0.8"
"Microsoft.Bot.Builder.Adapters.Slack" Version="4.9.3-preview" 
"Microsoft.Recognizers.Text" Version="1.5.0" 
"Microsoft.Recognizers.Text.DateTime" Version="1.5.0"

Assistant packages

"Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.0" 
"Microsoft.Azure.CognitiveServices.ContentModerator" Version="2.0.0" 
"Microsoft.Azure.CognitiveServices.Language" Version="1.0.1-preview" 
"Microsoft.Bot.Builder.AI.Luis" Version="4.9.3" 
"Microsoft.Bot.Builder.Adapters.Slack" Version="4.9.3-preview" 
"Microsoft.Bot.Builder.AI.QnA" Version="4.9.3" 
"Microsoft.Bot.Builder.ApplicationInsights" Version="4.9.3" 
"Microsoft.Bot.Builder.Azure" Version="4.9.3" 
"Microsoft.Bot.Builder.Integration.ApplicationInsights.Core" Version="4.9.3"
"Microsoft.Bot.Builder.Integration.AspNet.Core" Version="4.9.3" 
"Microsoft.Bot.Builder.LanguageGeneration" Version="4.9.3" 
"Microsoft.Bot.Solutions" Version="1.0.1" 
Bot Services Needs Triage Kobuk Bug customer-replied-to customer-reported

Most helpful comment

@Batta32 - Can you take a look at this?

All 4 comments

@Batta32 - Can you take a look at this?

Sure! Thanks @gonzalorieto for reporting this issue. We will start working on the next week, as soon as we have any update, we will let you know 😊.

Hi @gonzalorieto, as we discussed over email, this issue is related to the environment that your team is customizing. We successfully solved the issue and we correctly communicated the Virtual Assistant and Skill in C#.

We recommend to check the 60.slack-adapter sample as it configures the Slack Adapter for the Slack channel and the Bot Framework Adapter for the Azure Bot Service channels and Emulator.

Let us know if this helps 😊.

Amazing! thanks for the help. Give this man a raise. You can close this issue.

Was this page helpful?
0 / 5 - 0 ratings