Name or Service not known - intermittent error in Azure

Niels Brinch

I have a TimerTrigger which calls my own Azure Functions at a relatively high rate - a few times per second. It is not being stress tested. Every call takes just a 100ms and the purpose of the test is not a stress test.

This call to my own endpoint works about 9999 times out of 10000 but just once in a while I get the following error:

System.Net.Http.HttpRequestException: Name or service not known (app.mycustomdomain.com:443)
 ---> System.Net.Sockets.SocketException (0xFFFDFFFF): Name or service not known
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)

I replaced my actual domain with "app.mycustomdomain.com" in the error message above. It is a custom domain set up to point to the Azure Function App using CNAME.

The Function App does not detect any downtime in the Azure Portal and I have Application Insights enabled and do not see any errors. So I assume the issue is somehow on the callers side and the call never actually happens.

What does this error indicate? And how can I alleviate the problem?

Matt

For your second question - alleviating the problem, one option would certainly be to build in retry using a library like Polly. High level you create a policy, e.g. for a simple retry:

var myPolicy = Policy
  .Handle<SomeExceptionType>()
  .Retry(3);

This would retry 3 times, to use the policy you can call a sync or async version of Execute:

await myPolicy.ExecuteAsync(async () =>
{
     //do stuff that might fail up to three times
});

More complete samples are available

This library has lots of support for other approaches, e.g. with delays, exponential delays, etc.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Azure webjobs "invalid container name" intermittent error

Getting Name of service not known with Redis [Error -2]

Newbie, error: [Errno -2] Name or service not known

Connection error with PHPMailer and SMTP: node name or service name not known

JWTRefreshTokenBundle: Name or service not known

ftp: Name or Service not known

hostname: Name or service not known

Ping : Name or service not known

django-elasticsearch error : [Errno -2] Name or service not known

Error “ssh: Name or service not known” while using mpirun in Linux

socket.gaierror: [Error -2] Name or service not known

Error resolving “nmcheck.gnome.org”: Name or service not known

Python error only in docker environment (Name or service not known)

ping displays "Name or service not known"

Telnet returns Name or service not known

Python variable Name or service not known

Suppress "Name or service not known" on ping

Name or service not known in DHCP subnet

Google Sheets script intermittent error showing #NAME?

HTTP request error: what is the distinction between "Name or service not known" and "Temporary failure in name resolution" errors

urllib.error.URLError: <urlopen error [Errno -2] Name or service not known>

jupyter throwing error: socket.gaierror: [Errno -2] Name or service not known

redis.exceptions.ConnectionError: Error -2 connecting to localhost:6379. Name or service not known

getaddrinfo Name or service not known Socket Error s3 fog carrierwave Figaro

Error -2 connecting to redis://redis:6379:6379. Name or service not known

ERROR: 0 - php_network_getaddresses: getaddrinfo failed: Name or service not known

PHPMailer error php_network_getaddresses: getaddrinfo failed: Name or service not known

easy_install not working : Getting error [Errno -2] Name or service not known -- Some packages may not be found

java.net.UnknownHostException: Name or service not known