Skip to content
This repository has been archived by the owner on Jun 30, 2022. It is now read-only.

System.Net.Sockets.SocketException when Assistant connects with Skill #3771

Closed
gonzalorieto opened this issue Mar 1, 2021 · 4 comments
Closed
Assignees
Labels
Bot Services Required for internal Azure reporting. Do not delete. Do not change color. customer-replied-to Indicates that the team has replied to the issue reported by the customer. Do not delete. customer-reported Issue is created by anyone that is not a collaborator in the repository. Needs Triage Needs to be triaged for assignment Team: Kobuk This issue is assigned to the Kobuk team. Type: Bug Something isn't working

Comments

@gonzalorieto
Copy link

gonzalorieto commented Mar 1, 2021

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" 
@gonzalorieto gonzalorieto added Needs Triage Needs to be triaged for assignment Type: Bug Something isn't working labels Mar 1, 2021
@munozemilio munozemilio added Bot Services Required for internal Azure reporting. Do not delete. Do not change color. customer-reported Issue is created by anyone that is not a collaborator in the repository. labels Mar 2, 2021
@lauren-mills lauren-mills assigned Batta32 and unassigned lauren-mills Mar 2, 2021
@lauren-mills
Copy link
Contributor

@Batta32 - Can you take a look at this?

@Batta32
Copy link
Collaborator

Batta32 commented Mar 2, 2021

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 😊.

@Batta32 Batta32 added the Team: Kobuk This issue is assigned to the Kobuk team. label Mar 2, 2021
@EricDahlvang EricDahlvang added the customer-replied-to Indicates that the team has replied to the issue reported by the customer. Do not delete. label Mar 9, 2021
@Batta32
Copy link
Collaborator

Batta32 commented Mar 9, 2021

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 😊.

@gonzalorieto
Copy link
Author

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

@Batta32 Batta32 closed this as completed Mar 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bot Services Required for internal Azure reporting. Do not delete. Do not change color. customer-replied-to Indicates that the team has replied to the issue reported by the customer. Do not delete. customer-reported Issue is created by anyone that is not a collaborator in the repository. Needs Triage Needs to be triaged for assignment Team: Kobuk This issue is assigned to the Kobuk team. Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants