Development #39373
crash d'accès aux données si le formdef comporte une variable nommée "category"
Début:
29 janvier 2020
Echéance:
% réalisé:
0%
Temps estimé:
Patch proposed:
Oui
Planning:
Non
Description
Crash en prod:
Internal Server Error: /visualization/warehouse/teleservices_moncompte_orleans_metropole_fr/formdata_debit_de_boissons_temporaire/ ProgrammingError at /visualization/warehouse/teleservices_moncompte_orleans_metropole_fr/formdata_debit_de_boissons_temporaire/ missing FROM-clause entry for table "category" LINE 1: SELECT "category".id AS value, "category".label::text AS lab... ^ Request Method: GET Request URL: https://statistiques.moncompte.orleans-metropole.fr/visualization/warehouse/teleservices_moncompte_orleans_metropole_fr/formdata_debit_de_boissons_temporaire/ Django Version: 1.11.20 Python Executable: /usr/bin/uwsgi-core Python Version: 2.7.13 Python Path: ['.', '', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages'] Server time: mer, 29 Jan 2020 11:25:06 +0100 Installed Applications: '' Installed Middleware: '' Traceback: File "/usr/lib/python2.7/dist-packages/django/core/handlers/exception.py" in inner 41. response = get_response(request) File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py" in _legacy_get_response 249. response = self._get_response(request) File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py" in _get_response 187. response = self.process_exception_by_middleware(e, request) File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py" in _get_response 185. response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/usr/lib/python2.7/dist-packages/django/views/generic/base.py" in view 68. return self.dispatch(request, *args, **kwargs) File "/usr/lib/python2.7/dist-packages/bijoe/views.py" in dispatch 53. return super(AuthorizationMixin, self).dispatch(request, *args, **kwargs) File "/usr/lib/python2.7/dist-packages/bijoe/visualization/views.py" in dispatch 85. self.visualization = self.visualization(request, cube) File "/usr/lib/python2.7/dist-packages/bijoe/visualization/views.py" in visualization 71. self.form = forms.CubeForm(cube=self.cube, data=request.GET or request.POST) File "/usr/lib/python2.7/dist-packages/bijoe/visualization/forms.py" in __init__ 189. for _id, label in dimension.members(): File "/usr/lib/python2.7/dist-packages/bijoe/engine.py" in members 197. cursor.execute(sql) Exception Type: ProgrammingError at /visualization/warehouse/teleservices_moncompte_orleans_metropole_fr/formdata_debit_de_boissons_temporaire/ Exception Value: missing FROM-clause entry for table "category" LINE 1: SELECT "category".id AS value, "category".label::text AS lab... ^
La structure de la table créée:
Colonne | Type | Modificateurs ----------------------------------+----------+----------------------------------------------------------- id | integer | non NULL Par défaut, nextval('formdata_id_seq'::regclass) formdef_id | smallint | receipt_time | date | hour_id | smallint | channel_id | smallint | backoffice | boolean | generic_status_id | smallint | endpoint_delay | interval | first_agent_id | smallint | geolocation_base | point | json_data | jsonb | status_id | smallint | field_demandeur | integer | field_civilite_demandeur | integer | field_ville_demandeur | integer | field_ville_organisme | integer | field_qualite_organisme | integer | field_category | integer | field_salle_municipale | integer | field_ville_manifestation | integer | field_nombre_jours_manifestation | integer | function__receiver | smallint |
Mais le schéma annonce category
comme attribut du formdef:
"fact_table": "\"formdata_debit_de_boissons_temporaire\"", "joins": [ ... { "detail": "id", "kind": "left", "master": "formdef.category_id", "name": "category", "table": "category" }, { "detail": "id", "kind": "left", "master": "\"field_demandeur\"", "name": "demandeur", "table": "\"formdata_debit_de_boissons_temporaire_field_demandeur\"" }, ... ], ...
Fichiers
Révisions associées
feeder: add prefix to join's names of fields (#39373)
wcs_api: handle empty dict in FormData.workflow (#39373)
wcs_api: handle empty dict in FormData.workflow (#39373)
Historique
Mis à jour par Serghei Mihai il y a environ 4 ans
- Projet changé de BiJoe à OLAP / Business Intelligence pour Publik
Mis à jour par Benjamin Dauvergne il y a environ 4 ans
- Fichier 0001-feeder-factorize-values-in-field-s-schemas-39373.patch 0001-feeder-factorize-values-in-field-s-schemas-39373.patch ajouté
- Fichier 0002-feeder-add-prefix-to-join-s-names-of-fields-39373.patch 0002-feeder-add-prefix-to-join-s-names-of-fields-39373.patch ajouté
- Statut changé de Nouveau à Solution proposée
- Patch proposed changé de Non à Oui
Mis à jour par Serghei Mihai il y a environ 4 ans
- Fichier 0001-feeder-add-prefix-to-join-s-names-of-fields-39373.patch 0001-feeder-add-prefix-to-join-s-names-of-fields-39373.patch ajouté
Mis à part que ça pète à cause de wcs qui est passé en python3, il manque l'adaptation du test:
# verify JSON schema with (olap_cmd.model_dir / 'olap.model').open() as fd, \ (pathlib2.Path(__file__).parent / 'olap.model').open() as fd2: json_schema = json.load(fd) expected_json_schema = json.load(fd2) expected_json_schema['pg_dsn'] = postgres_db.dsn > assert json_schema == expected_json_schema E AssertionError: assert {'cubes': [{'...b942083', ...} == {'cubes': [{'d...b942083', ...} E Omitting 5 identical items, use -vv to show
Mis à jour par Benjamin Dauvergne il y a environ 4 ans
- Fichier 0001-feeder-factorize-values-in-field-s-schemas-39373.patch 0001-feeder-factorize-values-in-field-s-schemas-39373.patch ajouté
- Fichier 0002-feeder-add-prefix-to-join-s-names-of-fields-39373.patch 0002-feeder-add-prefix-to-join-s-names-of-fields-39373.patch ajouté
Rebasé sur la branche python3.
Mis à jour par Serghei Mihai il y a environ 4 ans
- Statut changé de Solution proposée à Solution validée
Mis à jour par Benjamin Dauvergne il y a environ 4 ans
- Statut changé de Solution validée à Résolu (à déployer)
commit 8fc092f4d786badf42202b249489ae95881f7ea7 Author: Benjamin Dauvergne <bdauvergne@entrouvert.com> Date: Wed Jan 29 12:50:43 2020 +0100 feeder: add prefix to join's names of fields (#39373) commit 04ad4ee2d2900aebdecebee5563f9da8ea13edfa Author: Benjamin Dauvergne <bdauvergne@entrouvert.com> Date: Wed Jan 29 12:49:43 2020 +0100 feeder: factorize values in field's schemas (#39373)
Mis à jour par Frédéric Péters il y a environ 4 ans
- Statut changé de Résolu (à déployer) à Solution déployée
feeder: factorize values in field's schemas (#39373)