My Products
Help
KonsultVn
CHAMPION ***

System.Net.Sockets.SocketException

by KonsultVn

Hi,

A lot of our Visma.Net-integrations are getting SocketException. They are all thrown after either roughly 20-21 seconds, or 40-42 seconds. Not all requests fail, but many. So far we have only noticed problems with our integrations hosted in Microsoft Azure. We started noticing the errors after 08:00 (CEST) this morning.

In 1 case it seems to have been solved by bumping an Azure Service Plan from S1 to S2.

Any ideas what might be the problem?

10 REPLIES 10
KonsultVn
CHAMPION ***

by KonsultVn

Florian,
We at Exsitec ha identified a temporary work around. If you switch App Service Plan in Azure, it can load new DNS in the new service plan. But, it seems you need to do a "major" change. So from Basic to Standard, Standard to Premium, or from Premium to Standard etc.
If you go to a Web App or Function that is currently failing, and then open the Console, and try the command "curl -v https://integration.visma.net/API/security/api/v1/testconnection" , then you can confirm wheter it worked or not. If you get a timeout after 21 seconds, then you still have the problem. But if you get a response, it works

 

 

Florian Haase
PARTNER

by Florian Haase

Fantastic - you are right. Switching the App-Serviceplans fixed the problem. Thank you for helping!

Florian Haase
PARTNER

by Florian Haase

Hi,

thanks for this fantastic description. I restarted the app-services first, but that did not help much. The error situation is a bit weird - now our UI is showing the right data but this curl failed: 

 

FlorianHaase_0-1685713148422.png

 

I will try to update the app-serviceplan.

 

Florian

 

Florian Haase
PARTNER

by Florian Haase

We still have a lot of errors here. I tried to restart the app but that did not help much. Now I often get the error:

 

Unable to connect to the remote server ---> System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 91.123.56.208:443

 

 

by Magnus Johnsen

The problem seems to be DNS cache on the Windows Server hosting the App Service. The server most likely has an outdated dns cache. We could not call "ipconfig /flushdns" since the console is not started as administrator user.

We have had the same problem with Windows Server VMs in Azure internally in Visma earlier, and flushing dns resolved the issue.

Florian Haase
PARTNER

by Florian Haase

Is this related to Azure? I don't get these messages in debug and we have also other integrations which are running as services which don't seem to have the same problem....

 

 

by Magnus Johnsen (Updated ‎02-06-2023 13:37 by Magnus Johnsen VISMA )

Hi,

Yes the issue seems to be with Azure. We have been looking at this together with Excitec and have managed a temporary solution.

We recommend restarting your services/flushing your dns.

If we get any more information regarding this we'll post it in this thread.

by Magnus Johnsen (Updated ‎02-06-2023 09:35 by Magnus Johnsen VISMA )

Hi,

We'll report this to the development team.

Do you have an example of an error message that we can pass along?

Thank you. 

KonsultVn
CHAMPION ***

by KonsultVn

Hi Magnus,

This is the error we are receiving


System.Net.Sockets.SocketException An error occurred while sending the request. Unable to connect to the remote server A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

Florian Haase
PARTNER

by Florian Haase

The same here, I have a lot of this SocketException errors here.