Guest User

Untitled

a guest
Oct 28th, 2014
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.42 KB | None | 0 0
  1. 2014-10-28 14:05:01,747 [noc.lib.debug] UNHANDLED EXCEPTION (2014-10-28 14:05:01.669361)
  2. Working directory: /opt/noc
  3. <class 'socket.timeout'>
  4. timed out
  5. START OF TRACEBACK
  6. ------------------------------------------------------------------------
  7. File: /usr/lib64/python2.7/socket.py (Line: 476)
  8. Function: readline
  9. 469 rv = buf.read(size)
  10. 470 self._rbuf = StringIO()
  11. 471 self._rbuf.write(buf.read())
  12. 472 return rv
  13. 473 self._rbuf = StringIO() # reset _rbuf. we consume it via buf.
  14. 474 while True:
  15. 475 try:
  16. 476 ==> data = self._sock.recv(self._rbufsize)
  17. 477 except error, e:
  18. 478 if e.args[0] == EINTR:
  19. 479 continue
  20. 480 raise
  21. 481 if not data:
  22. 482 break
  23. Variables:
  24. buf_len = 0
  25. buf = <cStringIO.StringO object at 0x2f66fb8>
  26. self = <socket._fileobject object at 0x2e9fc50>
  27. e = timeout('timed out',)
  28. size = 65537
  29. ------------------------------------------------------------------------
  30. File: /usr/lib64/python2.7/httplib.py (Line: 365)
  31. Function: _read_status
  32. 358 self.chunked = _UNKNOWN # is "chunked" being used?
  33. 359 self.chunk_left = _UNKNOWN # bytes left to read in current chunk
  34. 360 self.length = _UNKNOWN # number of bytes left in response
  35. 361 self.will_close = _UNKNOWN # conn will close at end of response
  36. 362
  37. 363 def _read_status(self):
  38. 364 # Initialize with Simple-Response defaults
  39. 365 ==> line = self.fp.readline(_MAXLINE + 1)
  40. 366 if len(line) > _MAXLINE:
  41. 367 raise LineTooLong("header line")
  42. 368 if self.debuglevel > 0:
  43. 369 print "reply:", repr(line)
  44. 370 if not line:
  45. 371 # Presumably, the server closed the connection before
  46. Variables:
  47. self = <httplib.HTTPResponse instance at 0x3528128>
  48. ------------------------------------------------------------------------
  49. File: /usr/lib64/python2.7/httplib.py (Line: 409)
  50. Function: begin
  51. 402 def begin(self):
  52. 403 if self.msg is not None:
  53. 404 # we've already started reading the response
  54. 405 return
  55. 406
  56. 407 # read until we get a non-100 response
  57. 408 while True:
  58. 409 ==> version, status, reason = self._read_status()
  59. 410 if status != CONTINUE:
  60. 411 break
  61. 412 # skip the header from the 100 response
  62. 413 while True:
  63. 414 skip = self.fp.readline(_MAXLINE + 1)
  64. 415 if len(skip) > _MAXLINE:
  65. Variables:
  66. self = <httplib.HTTPResponse instance at 0x3528128>
  67. ------------------------------------------------------------------------
  68. File: /usr/lib64/python2.7/httplib.py (Line: 1045)
  69. Function: getresponse
  70. 1038 args += (self.debuglevel,)
  71. 1039 if buffering:
  72. 1040 #only add this keyword if non-default, for compatibility with
  73. 1041 #other response_classes.
  74. 1042 kwds["buffering"] = True;
  75. 1043 response = self.response_class(*args, **kwds)
  76. 1044
  77. 1045 ==> response.begin()
  78. 1046 assert response.will_close != _UNKNOWN
  79. 1047 self.__state = _CS_IDLE
  80. 1048
  81. 1049 if response.will_close:
  82. 1050 # this effectively passes the connection to the response
  83. 1051 self.close()
  84. Variables:
  85. self = <httplib.HTTPConnection instance at 0x3528050>
  86. buffering = True
  87. args = (<socket._socketobject object at 0x2ecb830>,)
  88. response = <httplib.HTTPResponse instance at 0x3528128>
  89. kwds = {'strict': 0, 'buffering': True, 'method': 'GET'}
  90. ------------------------------------------------------------------------
  91. File: /usr/lib64/python2.7/urllib2.py (Line: 1189)
  92. Function: do_open
  93. 1182 try:
  94. 1183 h.request(req.get_method(), req.get_selector(), req.data, headers)
  95. 1184 except socket.error, err: # XXX what error?
  96. 1185 h.close()
  97. 1186 raise URLError(err)
  98. 1187 else:
  99. 1188 try:
  100. 1189 ==> r = h.getresponse(buffering=True)
  101. 1190 except TypeError: # buffering kw not supported
  102. 1191 r = h.getresponse()
  103. 1192
  104. 1193 # Pick apart the HTTPResponse object to get the addinfourl
  105. 1194 # object initialized properly.
  106. 1195
  107. Variables:
  108. h = <httplib.HTTPConnection instance at 0x3528050>
  109. self = <urllib2.HTTPHandler instance at 0x2ed51b8>
  110. req = <urllib2.Request instance at 0x3528098>
  111. headers =
  112. {'Connection': 'close',
  113. 'Host': 'noc.kis.ru',
  114. 'User-Agent': 'Python-urllib/2.7'}
  115. host = 'noc.kis.ru'
  116. http_class = <class httplib.HTTPConnection at 0x2737668>
  117. ------------------------------------------------------------------------
  118. File: /usr/lib64/python2.7/urllib2.py (Line: 1216)
  119. Function: http_open
  120. 1209 resp.msg = r.reason
  121. 1210 return resp
  122. 1211
  123. 1212
  124. 1213 class HTTPHandler(AbstractHTTPHandler):
  125. 1214
  126. 1215 def http_open(self, req):
  127. 1216 ==> return self.do_open(httplib.HTTPConnection, req)
  128. 1217
  129. 1218 http_request = AbstractHTTPHandler.do_request_
  130. 1219
  131. 1220 if hasattr(httplib, 'HTTPS'):
  132. 1221 class HTTPSHandler(AbstractHTTPHandler):
  133. 1222
  134. Variables:
  135. self = <urllib2.HTTPHandler instance at 0x2ed51b8>
  136. req = <urllib2.Request instance at 0x3528098>
  137. ------------------------------------------------------------------------
  138. File: /usr/lib64/python2.7/urllib2.py (Line: 382)
  139. Function: _call_chain
  140. 375 # Handlers raise an exception if no one else should try to handle
  141. 376 # the request, or return None if they can't but another handler
  142. 377 # could. Otherwise, they return the response.
  143. 378 handlers = chain.get(kind, ())
  144. 379 for handler in handlers:
  145. 380 func = getattr(handler, meth_name)
  146. 381
  147. 382 ==> result = func(*args)
  148. 383 if result is not None:
  149. 384 return result
  150. 385
  151. 386 def open(self, fullurl, data=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT):
  152. 387 # accept a URL or a Request object
  153. 388 if isinstance(fullurl, basestring):
  154. Variables:
  155. kind = 'http'
  156. chain =
  157. {'file': [<urllib2.FileHandler instance at 0x2ed5368>],
  158. 'ftp': [<urllib2.FTPHandler instance at 0x2ed52d8>],
  159. 'http': [<urllib2.HTTPHandler instance at 0x2ed51b8>],
  160. 'https': [<urllib2.HTTPSHandler instance at 0x2ed54d0>],
  161. 'unknown': [<urllib2.UnknownHandler instance at 0x2ecee18>]}
  162. handlers = [<urllib2.HTTPHandler instance at 0x2ed51b8>]
  163. self = <urllib2.OpenerDirector instance at 0x2ecee60>
  164. args = (<urllib2.Request instance at 0x3528098>,)
  165. meth_name = 'http_open'
  166. handler = <urllib2.HTTPHandler instance at 0x2ed51b8>
  167. func =
  168. <bound method HTTPHandler.http_open of <urllib2.HTTPHandler instance at 0x2ed51b8>>
  169. ------------------------------------------------------------------------
  170. File: /usr/lib64/python2.7/urllib2.py (Line: 422)
  171. Function: _open
  172. 415 result = self._call_chain(self.handle_open, 'default',
  173. 416 'default_open', req)
  174. 417 if result:
  175. 418 return result
  176. 419
  177. 420 protocol = req.get_type()
  178. 421 result = self._call_chain(self.handle_open, protocol, protocol +
  179. 422 ==> '_open', req)
  180. 423 if result:
  181. 424 return result
  182. 425
  183. 426 return self._call_chain(self.handle_open, 'unknown',
  184. 427 'unknown_open', req)
  185. 428
  186. Variables:
  187. data = None
  188. self = <urllib2.OpenerDirector instance at 0x2ecee60>
  189. req = <urllib2.Request instance at 0x3528098>
  190. protocol = 'http'
  191. result = None
  192. ------------------------------------------------------------------------
  193. File: /usr/lib64/python2.7/urllib2.py (Line: 404)
  194. Function: open
  195. 397
  196. 398 # pre-process request
  197. 399 meth_name = protocol+"_request"
  198. 400 for processor in self.process_request.get(protocol, []):
  199. 401 meth = getattr(processor, meth_name)
  200. 402 req = meth(req)
  201. 403
  202. 404 ==> response = self._open(req, data)
  203. 405
  204. 406 # post-process response
  205. 407 meth_name = protocol+"_response"
  206. 408 for processor in self.process_response.get(protocol, []):
  207. 409 meth = getattr(processor, meth_name)
  208. 410 response = meth(req, response)
  209. Variables:
  210. protocol = 'http'
  211. self = <urllib2.OpenerDirector instance at 0x2ecee60>
  212. req = <urllib2.Request instance at 0x3528098>
  213. meth_name = 'http_request'
  214. fullurl = 'http://noc.kis.ru/main/update/'
  215. timeout = 30
  216. meth =
  217. <bound method HTTPHandler.do_request_ of <urllib2.HTTPHandler instance at 0x2ed51b8>>
  218. data = None
  219. processor = <urllib2.HTTPHandler instance at 0x2ed51b8>
  220. ------------------------------------------------------------------------
  221. File: /usr/lib64/python2.7/urllib2.py (Line: 127)
  222. Function: urlopen
  223. 120 __version__ = sys.version[:3]
  224. 121
  225. 122 _opener = None
  226. 123 def urlopen(url, data=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT):
  227. 124 global _opener
  228. 125 if _opener is None:
  229. 126 _opener = build_opener()
  230. 127 ==> return _opener.open(url, data, timeout)
  231. 128
  232. 129 def install_opener(opener):
  233. 130 global _opener
  234. 131 _opener = opener
  235. 132
  236. 133 # do these error classes make sense?
  237. Variables:
  238. url = 'http://noc.kis.ru/main/update/'
  239. data = None
  240. timeout = 30
  241. ------------------------------------------------------------------------
  242. File: /opt/noc/lib/updateclient.py (Line: 37)
  243. Function: request_updates
  244. 30 self.branch = self.repo.dirstate.branch()
  245. 31 self.daemons = daemons
  246. 32
  247. 33 def request_updates(self):
  248. 34 # Get required revision
  249. 35 logger.info("Requesting updates from %s", self.url)
  250. 36 try:
  251. 37 ==> f = urllib2.urlopen(self.url, timeout=30)
  252. 38 data = json.loads(f.read())[0]
  253. 39 f.close()
  254. 40 except urllib2.URLError, why:
  255. 41 logger.error("Failed to get updates: %s", why)
  256. 42 return False
  257. 43 # Compare
  258. Variables:
  259. self = <noc.lib.updateclient.UpdateClient object at 0x2f81050>
  260. ------------------------------------------------------------------------
  261. File: /opt/noc/main/launcher.py (Line: 271)
  262. Function: check_updates
  263. 264 def check_updates(self):
  264. 265 if not self.update_url:
  265. 266 return
  266. 267 # Update
  267. 268 self.logger.info("Checking for updates")
  268. 269 daemons = set(d.name for d in self.daemons)
  269. 270 uc = UpdateClient(self.update_url, daemons)
  270. 271 ==> if uc.request_updates():
  271. 272 # Updated, restart
  272. 273 self.logger.info("Updates are applied. Restarting")
  273. 274 self.stop_all_daemons()
  274. 275 os.execv(sys.argv[0], sys.argv)
  275. 276 self.next_update_check = time.time() + self.next_update_check_interval
  276. 277
  277. Variables:
  278. daemons = set(['noc-probe'])
  279. self = <noc.main.launcher.Launcher object at 0x7fbdc9dbeb50>
  280. uc = <noc.lib.updateclient.UpdateClient object at 0x2f81050>
  281. ------------------------------------------------------------------------
  282. File: /opt/noc/main/launcher.py (Line: 262)
  283. Function: run
  284. 255 self.logger.error(
  285. 256 "Failed to fix permissions for %s",
  286. 257 path
  287. 258 )
  288. 259 last_crashinfo_check = t
  289. 260 # Check for updates
  290. 261 if self.update_url and t > self.next_update_check:
  291. 262 ==> self.check_updates()
  292. 263
  293. 264 def check_updates(self):
  294. 265 if not self.update_url:
  295. 266 return
  296. 267 # Update
  297. 268 self.logger.info("Checking for updates")
  298. Variables:
  299. status = 0
  300. d = <DaemonData noc-probe>
  301. self = <noc.main.launcher.Launcher object at 0x7fbdc9dbeb50>
  302. pid = 0
  303. last_crashinfo_check = 1414482257.845806
  304. t = 1414494271.621705
  305. ------------------------------------------------------------------------
  306. File: /opt/noc/lib/daemon/base.py (Line: 412)
  307. Function: guarded_run
  308. 405
  309. 406 def guarded_run(self):
  310. 407 """
  311. 408 Run daemon and catch common exceptions
  312. 409 :return:
  313. 410 """
  314. 411 try:
  315. 412 ==> self.run()
  316. 413 except KeyboardInterrupt:
  317. 414 pass
  318. 415 except MemoryError:
  319. 416 self.logger.error("Out of memory. Exiting.")
  320. 417 except SystemExit:
  321. 418 self.logger.info("Exiting")
  322. Variables:
  323. self = <noc.main.launcher.Launcher object at 0x7fbdc9dbeb50>
  324. ------------------------------------------------------------------------
  325. END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment