Projet

Général

Profil

Bug #66119

KeyError

Ajouté par Sentry Io il y a presque 2 ans. Mis à jour il y a presque 2 ans.

Statut:
Fermé
Priorité:
Normal
Assigné à:
Version cible:
-
Début:
10 juin 2022
Echéance:
% réalisé:

0%

Temps estimé:
Patch proposed:
Oui
Planning:
Non

Description

https://sentry.entrouvert.org/entrouvert/publik/issues/61363/

FileNotFoundError: [Errno 2] No such file or directory: b'/var/lib/wcs/demarches.services.metzmetropole.fr/formdefs-url_name/ccas-messin-e-s-solidaires-personnes'
  File "wcs/qommon/storage.py", line 668, in get_filename
    fd = open(force_bytes(filename, 'utf-8'), 'rb')  # pylint: disable=consider-using-with

KeyError: 
(29 additional frame(s) were not displayed)
...
  File "wcs/publisher.py", line 430, in record_error
    **kwargs,
  File "wcs/logged_errors.py", line 132, in record_error
    formdef = klass.get_by_urlname(formdef_urlname)
  File "wcs/formdef.py", line 749, in get_by_urlname
    return cls.get_on_index(url_name, 'url_name', ignore_migration=ignore_migration)
  File "wcs/qommon/storage.py", line 628, in get_on_index
    return cls.get_filename(filename, ignore_errors=ignore_errors, ignore_migration=ignore_migration)
  File "wcs/qommon/storage.py", line 673, in get_filename
    raise KeyError()

Fichiers

Révisions associées

Révision 558176c5 (diff)
Ajouté par Frédéric Péters il y a presque 2 ans

misc: require both slug and classname to attach form/card to error (#66119)

Historique

#1

Mis à jour par Lauréline Guérin il y a presque 2 ans

  • Projet changé de Suivi des traces à w.c.s.

(dommage de planter sur l'enregistrement d'une erreur, parce qu'on ne trouve pas le formdef)

#3

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

  • Statut changé de Nouveau à En cours
  • Assigné à mis à Frédéric Péters

La trace trouve ce formdef_urlname, formdef_urlname = context.get('form_slug') alors que dans le context affiché dans la trace sentry il n'y a pas form_slug dans le contexte, c'est bizarre cette affichage et je ne trouve pas dans mes archives la trace mail.

Patch en cours de jenkins pour cherche le formdef uniquement si on reçoit aussi form_classname.

#4

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

Voilà, ça a permis d'identifier la situation, on est sur un moment "pur lazy", il n'y a pas ajout au contexte du get_static_substitution_variables de FormDef, et donc on a form_slug dispo en lazy mais on avait pas form_class_name en lazy. (ça n'explique pas vraiment la trace dans sentry).

#5

Mis à jour par Lauréline Guérin il y a presque 2 ans

  • Statut changé de Solution proposée à Solution validée
#6

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

  • Statut changé de Solution validée à Résolu (à déployer)
commit 558176c52c5f7c212fb656cd9e07196fb0b77e60
Author: Frédéric Péters <fpeters@entrouvert.com>
Date:   Fri Jun 17 13:32:40 2022 +0200

    misc: require both slug and classname to attach form/card to error (#66119)
#7

Mis à jour par Transition automatique il y a presque 2 ans

  • Statut changé de Résolu (à déployer) à Solution déployée
#8

Mis à jour par Transition automatique il y a plus d'un an

Automatic expiration

Formats disponibles : Atom PDF