Projet

Général

Profil

Bug #1217

crash cron de nettoyage des comptes

Ajouté par Thomas Noël il y a plus de 12 ans. Mis à jour il y a plus de 8 ans.

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

Révision c8e6a5ec (diff)
Ajouté par Thomas Noël il y a plus de 12 ans

don't remove a user when it doesn't exist ...

fix #1217 https://dev.entrouvert.org/issues/1217

Révision cc55c1e5 (diff)
Ajouté par Thomas Noël il y a plus de 12 ans

warned_about_unused_account is an account attribute (not a user one)

fix #1217 https://dev.entrouvert.org/issues/1217

Historique

#1

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.

#2

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.

#3

Mis à jour par Thomas Noël il y a plus de 12 ans

Appliqué par commit r2234.

#4

Mis à jour par Thomas Noël il y a plus de 12 ans

  • Statut changé de Solution déployée à Fermé
#5

Mis à jour par Frédéric Péters il y a presque 11 ans

  • % réalisé changé de 90 à 100
#6

Mis à jour par Thomas Noël il y a plus de 8 ans

  • Version cible Au-quotidien 2012.2 supprimé

Formats disponibles : Atom PDF