Bug #1217
crash cron de nettoyage des comptes
Statut:
Fermé
Priorité:
Normal
Assigné à:
-
Version cible:
-
Début:
15 janvier 2012
Echéance:
% réalisé:
100%
Temps estimé:
Patch proposed:
Planning:
Description
En regardant des tracebacks générés lors du qommon/cron :
Exception: type = '<type 'exceptions.AttributeError'>', value = ''NoneType' object has no attribute 'remove_self'' Stack trace (most recent call first): File "/usr/lib/pymodules/python2.6/wcs/qommon/ident/password.ptl", line 1603, in handle_expired_tokens 1601 # XXX: theorically the user could have been associated with another 1602 # account, it is ignored. > 1603 user.remove_self() 1604 token.remove_self() 1605 locals: publisher = <publisher.WcsPublisher instance at 0x28e0950> account = <qommon.ident.password_accounts.PasswordAccount object at 0x2fd1ed0> token_key = 'o5MIJi36JPhl0BBP' token = <qommon.tokens.Token object at 0x2c2cfd0> user = None now = 1326517804.6439891
Révisions associées
warned_about_unused_account is an account attribute (not a user one)
Historique
Mis à jour par Thomas Noël il y a plus de 12 ans
- Statut changé de Nouveau à Solution déployée
- % réalisé changé de 0 à 90
Appliqué par commit r2233.
Mis à jour par Thomas Noël il y a plus de 12 ans
Crash aussi lors des warning :
AttributeError: 'User' object has no attribute 'warned_about_unused_account' Exception: type = '<type 'exceptions.AttributeError'>', value = ''User' object has no attribute 'warned_about_unused_account'' Stack trace (most recent call first): File "/usr/lib/pymodules/python2.6/wcs/qommon/ident/password.ptl", line 1558, in handle_unused_accounts 1556 if not hasattr(user, 'last_seen'): 1557 continue > 1558 if not user.warned_about_unused_account and ( 1559 time.time() - user.last_seen) > 86400*warn_about_unused_account_delay: 1560 account = PasswordAccount.get_on_index(user.id, 'user_id') locals: warn_about_unused_account_delay = 300 publisher = <publisher.WcsPublisher instance at 0x2a62908> remove_unused_account_delay = 360 user = <users.User object at 0x3132a90> identities_cfg = {'notify-on-register': False, 'creation': 'self', 'email-as-username': True, 'email-confirmation': True, 'warn_about_unused_account_delay': 300, 'remove_unused_account_delay': 360}
Il faut sans doute ajouter un 'if not hasattr(user, 'warned_about_unused_account') or ...' au début.
don't remove a user when it doesn't exist ...
fix #1217 https://dev.entrouvert.org/issues/1217