Projet

Général

Profil

Bug #15313

trace sur compteur d'échec de login

Ajouté par Frédéric Péters il y a environ 7 ans. Mis à jour il y a plus de 6 ans.

Statut:
Rejeté
Priorité:
Normal
Assigné à:
-
Catégorie:
-
Version cible:
-
Début:
07 mars 2017
Echéance:
% réalisé:

0%

Temps estimé:
Patch proposed:
Non
Planning:

Description

[...]
  File "/usr/lib/python2.7/dist-packages/authentic2/user_login_failure.py", line 17, in user_login_failure
    count = cache.incr(key(identifier))
  File "/usr/lib/python2.7/dist-packages/django/core/cache/backends/memcached.py", line 124, in incr
    raise ValueError("Key '%s' not found" % key)
ValueError: Key 'tournai_auth_guichet_citoyen_be_:1:user-login-failure-b1ddf2780ce22baedb3bc99bec712783' not found

Mais le code, c'est :

def user_login_failure(identifier):
    cache.add(key(identifier), 0)
    count = cache.incr(key(identifier))

Et je ne vois pas trop comment la clé ajoutée sur cache.add peut ne plus exister sur le cache.incr :/

Historique

#1

Mis à jour par Frédéric Péters il y a plus de 6 ans

Ça arrive pas mal à Tournai ces jours-ci, avec peut-être une piste supplémentaire, l'annuaire LDAP y est down.

  File "/usr/lib/python2.7/dist-packages/authentic2/auth_frontends.py", line 44, in login
    utils.csrf_token_check(request, form)
  File "/usr/lib/python2.7/dist-packages/authentic2/utils.py", line 539, in csrf_token_check
    if form.is_valid() and not getattr(request, 'csrf_processing_done', False):
  File "/usr/lib/python2.7/dist-packages/django/forms/forms.py", line 184, in is_valid
    return self.is_bound and not self.errors
  File "/usr/lib/python2.7/dist-packages/django/forms/forms.py", line 176, in errors
    self.full_clean()
  File "/usr/lib/python2.7/dist-packages/django/forms/forms.py", line 393, in full_clean
    self._clean_form()
  File "/usr/lib/python2.7/dist-packages/django/forms/forms.py", line 417, in _clean_form
    cleaned_data = self.clean()
  File "/usr/lib/python2.7/dist-packages/django/contrib/auth/forms.py", line 157, in clean
    password=password)
  File "/usr/lib/python2.7/dist-packages/django/contrib/auth/__init__.py", line 74, in authenticate
    user = backend.authenticate(**credentials)
  File "/usr/lib/python2.7/dist-packages/authentic2/backends/models_backend.py", line 63, in authenticate
    user_login_failure(user.get_username())
  File "/usr/lib/python2.7/dist-packages/authentic2/user_login_failure.py", line 17, in user_login_failure
    count = cache.incr(key(identifier))
  File "/usr/lib/python2.7/dist-packages/django/core/cache/backends/memcached.py", line 128, in incr
    raise ValueError("Key '%s' not found" % key)
ValueError: Key 'connexion_mytournai_be_:1:user-login-failure-29fc4f4931e5f4c0168e0a9abffca239' not found
#2

Mis à jour par Frédéric Péters il y a plus de 6 ans

Pas lié au LDAP, un truc très simple y foire :

>>> from django.core.cache import cache
>>> identifier = 'fred-xxxx-plop'
>>> key = lambda x:x
>>> cache.add(key(identifier), 0)
0
>>> count = cache.incr(key(identifier))
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/usr/lib/python2.7/dist-packages/django/core/cache/backends/memcached.py", line 128, in incr
    raise ValueError("Key '%s' not found" % key)
ValueError: Key 'connexion_mytournai_be_:1:fred-xxxx-plop' not found
#3

Mis à jour par Frédéric Péters il y a plus de 6 ans

  • Statut changé de Nouveau à Rejeté

Bon, memcached down, tout simplement.

#4

Mis à jour par Benjamin Dauvergne il y a plus de 6 ans

Je vais voir pour rendre ça indolore, on devrait pas planter sur l'absence d'un cache, c'est un peu l'idée.

Formats disponibles : Atom PDF