Error: 'Temporary failure in name resolution' #4

Closed
DaveEveritt opened this Issue Sep 10, 2011 · 21 comments

Projects

None yet

5 participants

@DaveEveritt

This is the new error (when connection fails):

Traceback (most recent call last):
 File "/home/greenview/scripts/gvUpdate.py", line 81, in <module>
   main(root)
 File "/home/greenview/scripts/gvUpdate.py", line 65, in main
   maintain(root, meter_id)
 File "/home/greenview/scripts/gvUpdate.py", line 44, in maintain
   latest_on_server = ws.GraemeLatestReadingDate(meter_id).datetime
 File "build/bdist.linux-i686/egg/greenview/greenview.py", line 52, in GraemeLatestReadingDate
 File "build/bdist.linux-i686/egg/greenview/greenview.py", line 31, in getDocument
 File "/usr/local/lib/python2.6/urllib2.py", line 124, in urlopen
   return _opener.open(url, data, timeout)
 File "/usr/local/lib/python2.6/urllib2.py", line 383, in open
   response = self._open(req, data)
 File "/usr/local/lib/python2.6/urllib2.py", line 401, in _open
   '_open', req)
 File "/usr/local/lib/python2.6/urllib2.py", line 361, in _call_chain
   result = func(*args)
 File "/usr/local/lib/python2.6/urllib2.py", line 1130, in http_open
   return self.do_open(httplib.HTTPConnection, req)
 File "/usr/local/lib/python2.6/urllib2.py", line 1105, in do_open
   raise URLError(err)
urllib2.URLError: <urlopen error [Errno -3] Temporary failure in name resolution>
@ggstuart ggstuart was assigned Sep 10, 2011
@ggstuart
Owner

Does this help?

@DaveEveritt

I've just done the Debian equivalent /etc/init.d/apache2 restart so will see... outages are now causing our server to freeze (or - to be logical - they appear to happen simultaneously) - 24 minutes last time. Here's a tail of the Apache2 error log:

tail /var/log/apache2/error.log
Could not open log file '/home/greenweek/logs/access.log.2011-09-12' (No such file or directory)
piped log program '/usr/sbin/rotatelogs /home/greenweek/logs/access.log.%Y-%m-%d 5M' failed unexpectedly
[Mon Sep 12 12:37:05 2011] [notice] caught SIGTERM, shutting down
[Mon Sep 12 12:37:06 2011] [notice] suEXEC mechanism enabled (wrapper: /usr/lib/apache2/suexec)
[Mon Sep 12 12:37:06 2011] [notice] mod_python: Creating 8 session mutexes based on 20 max processes and 0 max threads.
[Mon Sep 12 12:37:06 2011] [notice] mod_python: using mutex_directory /tmp 

I've now set up 'greenweek' logs ('greenview' logs already there), so that's not an issue.

Next, I'll disable mod_python.

BTW it's Python 2.6.2 on our server.

@DaveEveritt

Log for most recent errors:

ERROR: 2011-09-13 22:01:53,483 <==============================Unexpected error==============================
ERROR: 2011-09-13 22:01:53,486 <urlopen error [Errno -3] Temporary failure in name resolution>
ERROR: 2011-09-14 09:01:53,493 <==============================Unexpected error==============================
ERROR: 2011-09-14 09:01:53,496 <urlopen error [Errno -3] Temporary failure in name resolution>

Also, mod_python now disabled.

@ggstuart
Owner

OK, so this seems to be quite rare. It only occurred once yesterday and once this morning. Is it still causing problems on the server?

@ggstuart ggstuart closed this Sep 14, 2011
@ggstuart ggstuart reopened this Sep 14, 2011
@DaveEveritt

It is rendering the server inaccessible for several minutes...

@DaveEveritt

Still getting this (16:16 yesetrday 02:02 today) - if I can't pin it down, can anything be done in the script?

@ggstuart
Owner

I don't know what is causing it. I have made a slight tweak to the code so you may want to try pulling the latest version. I doubt if it will make a difference.

@ggstuart
Owner

Can you try something like this?

@DaveEveritt

Thanks - will do...

@ggstuart
Owner

Dave, if you pulled the latest version before then update again, I was optimistic about the urllib2 interface. The problem is fixed now. If you didn't pull (and I assume you didn't as I haven't seen a new issue opened, then don't worry).

@DaveEveritt

okay - will check tomorrow morning...

Dave, if you pulled the latest version before then update again, I
was optimistic about the urllib2 interface. The problem is fixed
now. If you didn't pull (and I assume you didn't as I haven't seen a
new issue opened, then don't worry).

@DaveEveritt

The last error was 19th Sept. at 17:32, so looks like we're clear and I don't need to pull - correct?

@ggstuart
Owner

If its working, you don't need to pull.

@DaveEveritt

Okay, I'm closing the issue then :-)

@ggstuart
Owner

Did we identify the cause? I don't think I did anything to fix it.

@DaveEveritt

No, but that link about name-resolution and the hosts file looks promising... if it happens again I'll make those changes on the server, as it'll be crucial to the app.

@DaveEveritt

Getting the error again - once around 6:55 then from around 9.15 onwards. Reluctant to fiddle with server until Green week over, so let's look at it again after that when I'll pull, reinstall, and look at the issue in the post you found earlier.

@lipka
lipka commented Dec 26, 2011

Hey,

I'm getting the same error (gaierror: [Errno -3] Temporary failure in name resolution) in a python application of mine. I was wondering if you were able to solve this or find a cause?

Thanks.

@ggstuart
Owner
ggstuart commented Jan 2, 2012

So far, I don't think so.

@tehsin
tehsin commented Jun 25, 2014

Hey guys

Just stumbled across this through Google Search. Wondering if you found the cause to this at all? Or what you did to fix it. Getting the same error message on my end and having a hard time trying to figure this one out.

Thanks,

@alexeiramone

I'm getting this error... in a server that has been doing the same stuff for 2.5 years with minimal software updates

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment