Development #68273
échec de migration sur le SaaS recette
Début:
18 août 2022
Echéance:
% réalisé:
0%
Temps estimé:
Patch proposed:
Oui
Planning:
Non
Description
août 18 19:23:47 authentic authentic2-multitenant-manage[989720]: AttributeError: 'str' object has no attribute 'get' août 18 19:23:47 authentic authentic2-multitenant-manage[989720]: action = obj.get('action') or '' août 18 19:23:47 authentic authentic2-multitenant-manage[989720]: File "/usr/lib/python3/dist-packages/authentic2_auth_saml/migrations/0006_migrate_jsonfields.py", line 96, in migrate_jsonfields août 18 19:23:47 authentic authentic2-multitenant-manage[989720]: self.code(from_state.apps, schema_editor) août 18 19:23:47 authentic authentic2-multitenant-manage[989720]: File "/usr/lib/python3/dist-packages/django/db/migrations/operations/special.py", line 190, in database_forwards août 18 19:23:47 authentic authentic2-multitenant-manage[989720]: operation.database_forwards(self.app_label, schema_editor, old_state, project_state) août 18 19:23:47 authentic authentic2-multitenant-manage[989720]: File "/usr/lib/python3/dist-packages/django/db/migrations/migration.py", line 124, in apply août 18 19:23:47 authentic authentic2-multitenant-manage[989720]: state = migration.apply(state, schema_editor)
Il faudra faire un patch et en attendant, pour réparer, trouver quel tenant a un json invalide et aller le corriger directos en base.
Fichiers
Révisions associées
Historique
Mis à jour par Valentin Deniaud il y a plus d'un an
- Fichier 0001-auth_saml-catch-any-exception-in-data-migration-6827.patch 0001-auth_saml-catch-any-exception-in-data-migration-6827.patch ajouté
- Statut changé de Nouveau à Solution proposée
- Patch proposed changé de Non à Oui
La config qui avait été posée n'avait probablement jamais tourné, sinon ça aurait fait une 500.
Donc ce genre de config n'existe pas en prod, ça n'est pas intéressant de prévoir ce cas.
Plus intéressant par contre, ne jamais crasher (ça commence à bien faire), logger l'exception et la config fautive, pour aller voir les choses à la main à tête reposée une fois la migration passée. Avec un peu de chance on a un mail, sinon on aura vite des traces/un ticket.
Mis à jour par A. Berriot il y a plus d'un an
Le test fail sur jenkins à cause de la PK hardcodée, sinon c'est okay pour moi :)
Mis à jour par Valentin Deniaud il y a plus d'un an
Mis à jour par A. Berriot il y a plus d'un an
- Statut changé de Solution proposée à Solution validée
Mis à jour par Valentin Deniaud il y a plus d'un an
- Statut changé de Solution validée à Résolu (à déployer)
commit c5b4c0205c13f01278b68c0d67d2be340f8531d2 Author: Valentin Deniaud <vdeniaud@entrouvert.com> Date: Mon Aug 22 10:14:38 2022 +0200 auth_saml: catch any exception in data migration (#68273)
Mis à jour par Transition automatique il y a plus d'un an
- Statut changé de Résolu (à déployer) à Solution déployée
auth_saml: catch any exception in data migration (#68273)