Forums

'Name or Service not known' when attempting to connect to imap.gmail.com

I currently have an always-on task running that connects to the gmail IMAP servers periodically to check for emails of a specific format. It's been running fairly stable for a couple months now, but as of yesterday it's been unable to connect to those servers intermittently, and as of just about an hour ago it hasn't been able to connect at all, returning a 'Name of Service not known' error from imaplib. Interestingly, I've been able to connect fine using the same package, in the same script, on my my local computer, which leads me to believe its an issue with where the task is running. Any idea on what could be causing the lack of connection?

We've seen that some tasks on some machines have trouble with DNS, but we're still trying to work out why. I have moved your tasks to a different machine and that seems to have fixed them. We'll continue trying to debug this.

Great!. Thanks, Glenn.

I've been having a similar issue lately with an always-on task. I'm connecting to 2 completely independent servers, in one case using Requests and the other case http.client.

Are you still having issues?

There are periodic issues, yes -- we've put something in place so that when a machine starts getting network problems, one of the team is paged. When that happens, we log in, move the affected tasks over to machines with working networking, then bring the network back up on the non-working machine. So you may see short network outages when that happens.

Of course, we're working hard on trying to debug the underlying problem, as this is a very suboptimal state for things to be in! It's proving hard to track down, though.