Bug #1267
Crash cron sur un session._access_time alors que session==None
Statut:
Fermé
Priorité:
Normal
Assigné à:
-
Version cible:
-
Début:
21 février 2012
Echéance:
% réalisé:
0%
Temps estimé:
Patch proposed:
Planning:
Description
Ci-dessous le traceback reçu par mail (meyzieux.auquo)
A priori ça vient de clean_vhost_sessions dans wcs/ctl/clean_sessions.py qui ne teste pas si une session est malformée (voir le code identique dans wcs/qommon/publisher.py).
Subject: Quixote Traceback ([CRON] KeyError)
Exception: type = '<type 'exceptions.KeyError'>', value = '' Stack trace (most recent call first): File "/usr/lib/pymodules/python2.6/wcs/qommon/sessions.py", line 229, in __delitem__ 227 self.session_class.remove_object(session_id) 228 except OSError: > 229 raise KeyError 230 231 def get_sessions_for_liberty(self, name_identifier = Ellipsis, \ locals: self = <StorageSessionManager at 3116680> session_id = '6992ae5453ff33330HHJ2I' File "/usr/lib/pymodules/python2.6/wcs/qommon/publisher.py", line 495, in clean_sessions 493 continue 494 finally: > 495 os.close(fd) 496 497 def clean_afterjobs(self): locals: one_week_ago = 1329170420.60726 session_key = '6992ae5453ff33330HHJ2I' self = <publisher.WcsPublisher instance at 0x372ed40> KeyError = AttributeError("'NoneType' object has no attribute '_access_time'",) cleaning_lock_file = '/var/lib/wcs-au-quotidien/meyzieu.au-quotidien.com/cleaning_sessions.lock' manager = <StorageSessionManager at 3116680> session = None fd = 24 one_month_ago = 1327183220.60726 now = 1329775220.60726 File "/usr/lib/pymodules/python2.6/wcs/qommon/cron.py", line 92, in cron 90 None, 91 exc_type, exc_value, > 92 tb) 93 publisher.logger.log_internal_error(error_summary, plain_error_msg) 94 time.sleep(10) locals: publisher = <publisher.WcsPublisher instance at 0x372ed40> last = time.struct_time(tm_year=2012, tm_mon=2, tm_mday=20, tm_hour=23, tm_min=0, tm_sec=5, tm_wday=0, tm_yday=51, tm_isdst=0) app_dir = '/var/lib/wcs-au-quotidien' hostname = 'meyzieu.au-quotidien.com' exc_type = <type 'exceptions.KeyError'> job = <qommon.cron.CronJob instance at 0x37625a8> error_summary = '[CRON] KeyError' now = time.struct_time(tm_year=2012, tm_mon=2, tm_mday=20, tm_hour=23, tm_min=0, tm_sec=5, tm_wday=0, tm_yday=51, tm_isdst=0) tb = <traceback object at 0x2a9c950> exc_value = KeyError() File "/usr/lib/pymodules/python2.6/wcs/qommon/cron.py", line 117, in spawn_cron 115 print >> f, os.getpid() 116 f.close() > 117 cron(pub) 118 sys.exit(0) 119 else: locals: create_publisher = <bound method classobj.create_publisher of <class publisher.WcsPublisher at 0x28efd70>> pub = <publisher.WcsPublisher instance at 0x372ed40> f = <closed file '/tmp/wcs-auquotidien-cron.pid', mode 'w' at 0x25eaa50> File "/usr/lib/pymodules/python2.6/wcs/qommon/scgi_server.py", line 71, in run 69 70 if spawn_cron: > 71 cron.spawn_cron(create_publisher) 72 73 def create_handler(parent_fd): locals: handler_connection_limit = -1 max_children = 5 create_publisher = <bound method classobj.create_publisher of <class publisher.WcsPublisher at 0x28efd70>> script_name = None host = 'localhost' spawn_cron = True port = 3001 File "/usr/lib/pymodules/python2.6/wcs/ctl/start.py", line 63, in execute 61 62 try: > 63 run_function(publisher.WcsPublisher.create_publisher, **run_kwargs) 64 except socket.error, e: 65 if e[0] == 98: locals: publisher = <module 'publisher' from '/usr/lib/pymodules/python2.6/wcs/publisher.py'> self = <wcs.ctl.start.CmdStart instance at 0x25053f8> args = [] sub_options = <Values at 0x25045f0: {'http': False, 'silent': False, 'app_dir': None, 'handler_connection_limit': None, 'extra': ['/usr/li b/pymodules/python2.6/extra-wcs-au-quotidien/'], 'script_name': None, 'data_dir': None, 'port': 3001}> run_function = <function run at 0x27b39b0> base_options = <Values at 0x2508bd8: {'configfile': '/etc/wcs/wcs-au-quotidien.cfg'}> run_kwargs = {'port': 3001, 'spawn_cron': True} ...
Historique
Mis à jour par Frédéric Péters il y a environ 12 ans
- Statut changé de Nouveau à Fermé
Je pense c'était juste pire que ça, le "except AttributeError, KeyError", il lui manquait des parenthèses, du coup il n'attrapait pas correctement l'affaire. r2274.