Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 2014-10-28 14:05:01,747 [noc.lib.debug] UNHANDLED EXCEPTION (2014-10-28 14:05:01.669361)
- Working directory: /opt/noc
- <class 'socket.timeout'>
- timed out
- START OF TRACEBACK
- ------------------------------------------------------------------------
- File: /usr/lib64/python2.7/socket.py (Line: 476)
- Function: readline
- 469 rv = buf.read(size)
- 470 self._rbuf = StringIO()
- 471 self._rbuf.write(buf.read())
- 472 return rv
- 473 self._rbuf = StringIO() # reset _rbuf. we consume it via buf.
- 474 while True:
- 475 try:
- 476 ==> data = self._sock.recv(self._rbufsize)
- 477 except error, e:
- 478 if e.args[0] == EINTR:
- 479 continue
- 480 raise
- 481 if not data:
- 482 break
- Variables:
- buf_len = 0
- buf = <cStringIO.StringO object at 0x2f66fb8>
- self = <socket._fileobject object at 0x2e9fc50>
- e = timeout('timed out',)
- size = 65537
- ------------------------------------------------------------------------
- File: /usr/lib64/python2.7/httplib.py (Line: 365)
- Function: _read_status
- 358 self.chunked = _UNKNOWN # is "chunked" being used?
- 359 self.chunk_left = _UNKNOWN # bytes left to read in current chunk
- 360 self.length = _UNKNOWN # number of bytes left in response
- 361 self.will_close = _UNKNOWN # conn will close at end of response
- 362
- 363 def _read_status(self):
- 364 # Initialize with Simple-Response defaults
- 365 ==> line = self.fp.readline(_MAXLINE + 1)
- 366 if len(line) > _MAXLINE:
- 367 raise LineTooLong("header line")
- 368 if self.debuglevel > 0:
- 369 print "reply:", repr(line)
- 370 if not line:
- 371 # Presumably, the server closed the connection before
- Variables:
- self = <httplib.HTTPResponse instance at 0x3528128>
- ------------------------------------------------------------------------
- File: /usr/lib64/python2.7/httplib.py (Line: 409)
- Function: begin
- 402 def begin(self):
- 403 if self.msg is not None:
- 404 # we've already started reading the response
- 405 return
- 406
- 407 # read until we get a non-100 response
- 408 while True:
- 409 ==> version, status, reason = self._read_status()
- 410 if status != CONTINUE:
- 411 break
- 412 # skip the header from the 100 response
- 413 while True:
- 414 skip = self.fp.readline(_MAXLINE + 1)
- 415 if len(skip) > _MAXLINE:
- Variables:
- self = <httplib.HTTPResponse instance at 0x3528128>
- ------------------------------------------------------------------------
- File: /usr/lib64/python2.7/httplib.py (Line: 1045)
- Function: getresponse
- 1038 args += (self.debuglevel,)
- 1039 if buffering:
- 1040 #only add this keyword if non-default, for compatibility with
- 1041 #other response_classes.
- 1042 kwds["buffering"] = True;
- 1043 response = self.response_class(*args, **kwds)
- 1044
- 1045 ==> response.begin()
- 1046 assert response.will_close != _UNKNOWN
- 1047 self.__state = _CS_IDLE
- 1048
- 1049 if response.will_close:
- 1050 # this effectively passes the connection to the response
- 1051 self.close()
- Variables:
- self = <httplib.HTTPConnection instance at 0x3528050>
- buffering = True
- args = (<socket._socketobject object at 0x2ecb830>,)
- response = <httplib.HTTPResponse instance at 0x3528128>
- kwds = {'strict': 0, 'buffering': True, 'method': 'GET'}
- ------------------------------------------------------------------------
- File: /usr/lib64/python2.7/urllib2.py (Line: 1189)
- Function: do_open
- 1182 try:
- 1183 h.request(req.get_method(), req.get_selector(), req.data, headers)
- 1184 except socket.error, err: # XXX what error?
- 1185 h.close()
- 1186 raise URLError(err)
- 1187 else:
- 1188 try:
- 1189 ==> r = h.getresponse(buffering=True)
- 1190 except TypeError: # buffering kw not supported
- 1191 r = h.getresponse()
- 1192
- 1193 # Pick apart the HTTPResponse object to get the addinfourl
- 1194 # object initialized properly.
- 1195
- Variables:
- h = <httplib.HTTPConnection instance at 0x3528050>
- self = <urllib2.HTTPHandler instance at 0x2ed51b8>
- req = <urllib2.Request instance at 0x3528098>
- headers =
- {'Connection': 'close',
- 'Host': 'noc.kis.ru',
- 'User-Agent': 'Python-urllib/2.7'}
- host = 'noc.kis.ru'
- http_class = <class httplib.HTTPConnection at 0x2737668>
- ------------------------------------------------------------------------
- File: /usr/lib64/python2.7/urllib2.py (Line: 1216)
- Function: http_open
- 1209 resp.msg = r.reason
- 1210 return resp
- 1211
- 1212
- 1213 class HTTPHandler(AbstractHTTPHandler):
- 1214
- 1215 def http_open(self, req):
- 1216 ==> return self.do_open(httplib.HTTPConnection, req)
- 1217
- 1218 http_request = AbstractHTTPHandler.do_request_
- 1219
- 1220 if hasattr(httplib, 'HTTPS'):
- 1221 class HTTPSHandler(AbstractHTTPHandler):
- 1222
- Variables:
- self = <urllib2.HTTPHandler instance at 0x2ed51b8>
- req = <urllib2.Request instance at 0x3528098>
- ------------------------------------------------------------------------
- File: /usr/lib64/python2.7/urllib2.py (Line: 382)
- Function: _call_chain
- 375 # Handlers raise an exception if no one else should try to handle
- 376 # the request, or return None if they can't but another handler
- 377 # could. Otherwise, they return the response.
- 378 handlers = chain.get(kind, ())
- 379 for handler in handlers:
- 380 func = getattr(handler, meth_name)
- 381
- 382 ==> result = func(*args)
- 383 if result is not None:
- 384 return result
- 385
- 386 def open(self, fullurl, data=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT):
- 387 # accept a URL or a Request object
- 388 if isinstance(fullurl, basestring):
- Variables:
- kind = 'http'
- chain =
- {'file': [<urllib2.FileHandler instance at 0x2ed5368>],
- 'ftp': [<urllib2.FTPHandler instance at 0x2ed52d8>],
- 'http': [<urllib2.HTTPHandler instance at 0x2ed51b8>],
- 'https': [<urllib2.HTTPSHandler instance at 0x2ed54d0>],
- 'unknown': [<urllib2.UnknownHandler instance at 0x2ecee18>]}
- handlers = [<urllib2.HTTPHandler instance at 0x2ed51b8>]
- self = <urllib2.OpenerDirector instance at 0x2ecee60>
- args = (<urllib2.Request instance at 0x3528098>,)
- meth_name = 'http_open'
- handler = <urllib2.HTTPHandler instance at 0x2ed51b8>
- func =
- <bound method HTTPHandler.http_open of <urllib2.HTTPHandler instance at 0x2ed51b8>>
- ------------------------------------------------------------------------
- File: /usr/lib64/python2.7/urllib2.py (Line: 422)
- Function: _open
- 415 result = self._call_chain(self.handle_open, 'default',
- 416 'default_open', req)
- 417 if result:
- 418 return result
- 419
- 420 protocol = req.get_type()
- 421 result = self._call_chain(self.handle_open, protocol, protocol +
- 422 ==> '_open', req)
- 423 if result:
- 424 return result
- 425
- 426 return self._call_chain(self.handle_open, 'unknown',
- 427 'unknown_open', req)
- 428
- Variables:
- data = None
- self = <urllib2.OpenerDirector instance at 0x2ecee60>
- req = <urllib2.Request instance at 0x3528098>
- protocol = 'http'
- result = None
- ------------------------------------------------------------------------
- File: /usr/lib64/python2.7/urllib2.py (Line: 404)
- Function: open
- 397
- 398 # pre-process request
- 399 meth_name = protocol+"_request"
- 400 for processor in self.process_request.get(protocol, []):
- 401 meth = getattr(processor, meth_name)
- 402 req = meth(req)
- 403
- 404 ==> response = self._open(req, data)
- 405
- 406 # post-process response
- 407 meth_name = protocol+"_response"
- 408 for processor in self.process_response.get(protocol, []):
- 409 meth = getattr(processor, meth_name)
- 410 response = meth(req, response)
- Variables:
- protocol = 'http'
- self = <urllib2.OpenerDirector instance at 0x2ecee60>
- req = <urllib2.Request instance at 0x3528098>
- meth_name = 'http_request'
- fullurl = 'http://noc.kis.ru/main/update/'
- timeout = 30
- meth =
- <bound method HTTPHandler.do_request_ of <urllib2.HTTPHandler instance at 0x2ed51b8>>
- data = None
- processor = <urllib2.HTTPHandler instance at 0x2ed51b8>
- ------------------------------------------------------------------------
- File: /usr/lib64/python2.7/urllib2.py (Line: 127)
- Function: urlopen
- 120 __version__ = sys.version[:3]
- 121
- 122 _opener = None
- 123 def urlopen(url, data=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT):
- 124 global _opener
- 125 if _opener is None:
- 126 _opener = build_opener()
- 127 ==> return _opener.open(url, data, timeout)
- 128
- 129 def install_opener(opener):
- 130 global _opener
- 131 _opener = opener
- 132
- 133 # do these error classes make sense?
- Variables:
- url = 'http://noc.kis.ru/main/update/'
- data = None
- timeout = 30
- ------------------------------------------------------------------------
- File: /opt/noc/lib/updateclient.py (Line: 37)
- Function: request_updates
- 30 self.branch = self.repo.dirstate.branch()
- 31 self.daemons = daemons
- 32
- 33 def request_updates(self):
- 34 # Get required revision
- 35 logger.info("Requesting updates from %s", self.url)
- 36 try:
- 37 ==> f = urllib2.urlopen(self.url, timeout=30)
- 38 data = json.loads(f.read())[0]
- 39 f.close()
- 40 except urllib2.URLError, why:
- 41 logger.error("Failed to get updates: %s", why)
- 42 return False
- 43 # Compare
- Variables:
- self = <noc.lib.updateclient.UpdateClient object at 0x2f81050>
- ------------------------------------------------------------------------
- File: /opt/noc/main/launcher.py (Line: 271)
- Function: check_updates
- 264 def check_updates(self):
- 265 if not self.update_url:
- 266 return
- 267 # Update
- 268 self.logger.info("Checking for updates")
- 269 daemons = set(d.name for d in self.daemons)
- 270 uc = UpdateClient(self.update_url, daemons)
- 271 ==> if uc.request_updates():
- 272 # Updated, restart
- 273 self.logger.info("Updates are applied. Restarting")
- 274 self.stop_all_daemons()
- 275 os.execv(sys.argv[0], sys.argv)
- 276 self.next_update_check = time.time() + self.next_update_check_interval
- 277
- Variables:
- daemons = set(['noc-probe'])
- self = <noc.main.launcher.Launcher object at 0x7fbdc9dbeb50>
- uc = <noc.lib.updateclient.UpdateClient object at 0x2f81050>
- ------------------------------------------------------------------------
- File: /opt/noc/main/launcher.py (Line: 262)
- Function: run
- 255 self.logger.error(
- 256 "Failed to fix permissions for %s",
- 257 path
- 258 )
- 259 last_crashinfo_check = t
- 260 # Check for updates
- 261 if self.update_url and t > self.next_update_check:
- 262 ==> self.check_updates()
- 263
- 264 def check_updates(self):
- 265 if not self.update_url:
- 266 return
- 267 # Update
- 268 self.logger.info("Checking for updates")
- Variables:
- status = 0
- d = <DaemonData noc-probe>
- self = <noc.main.launcher.Launcher object at 0x7fbdc9dbeb50>
- pid = 0
- last_crashinfo_check = 1414482257.845806
- t = 1414494271.621705
- ------------------------------------------------------------------------
- File: /opt/noc/lib/daemon/base.py (Line: 412)
- Function: guarded_run
- 405
- 406 def guarded_run(self):
- 407 """
- 408 Run daemon and catch common exceptions
- 409 :return:
- 410 """
- 411 try:
- 412 ==> self.run()
- 413 except KeyboardInterrupt:
- 414 pass
- 415 except MemoryError:
- 416 self.logger.error("Out of memory. Exiting.")
- 417 except SystemExit:
- 418 self.logger.info("Exiting")
- Variables:
- self = <noc.main.launcher.Launcher object at 0x7fbdc9dbeb50>
- ------------------------------------------------------------------------
- END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment