Project

General

Profile

Bug #47767

DataError: value "424508729041982" is out of range for type integer

Added by sentry io 13 days ago. Updated 8 days ago.

Status:
Solution déployée
Priority:
Normal
Target version:
-
Start date:
16 Oct 2020
Due date:
% Done:

0%

Patch proposed:
Yes
Planning:
No

Description

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

KeyError: 
  File "wcs/backoffice/data_management.py", line 171, in import_csv
    job = AfterJob.get(get_request().form.get('job'))
  File "wcs/qommon/storage.py", line 411, in get
    raise KeyError()

DataError: value "424508729041982" is out of range for type integer
LINE 2: ...ta_9_iodas_copie WHERE status != 'draft' AND id = '424508729...
                                                             ^

(17 additional frame(s) were not displayed)
...
  File "wcs/data_sources.py", line 470, in get_card_structured_value_by_id
    values = CardDef.get_data_source_items(self.type, get_by_id=option_id)
  File "wcs/carddef.py", line 193, in get_data_source_items
    limit=limit)]
  File "wcs/sql.py", line 432, in f
    return func(*args, **kwargs)
  File "wcs/sql.py", line 1316, in select
    return list(objects)
  File "wcs/sql.py", line 1292, in select_iterator
    cur.execute(sql_statement, parameters)

0001-misc-don-t-look-for-cards-with-an-id-over-postgresql.patch View (1.64 KB) Frédéric Péters, 18 Oct 2020 02:57 PM

Associated revisions

Revision 16a147d5 (diff)
Added by Frédéric Péters 8 days ago

misc: don't look for cards with an id over postgresql limit (#47767)

History

#1 Updated by Lauréline Guerin 13 days ago

  • Project changed from Suivi des traces to w.c.s.

#2 Updated by Frédéric Péters 10 days ago

  File "wcs/backoffice/data_management.py", line 184, in import_csv
    return self.import_csv_submit(form)
  File "wcs/backoffice/data_management.py", line 253, in import_csv_submit
    display_value = field.store_display_value(data_line, field_id)
  File "wcs/fields.py", line 1595, in store_display_value
    return self.get_display_value(value)
  File "wcs/fields.py", line 1517, in get_display_value
    display_value = data_source.get_display_value(value)
  File "wcs/data_sources.py", line 478, in get_display_value
    value = self.get_structured_value(option_id)
  File "wcs/data_sources.py", line 486, in get_structured_value
    value = self.get_card_structured_value_by_id(option_id)
  File "wcs/data_sources.py", line 470, in get_card_structured_value_by_id
    values = CardDef.get_data_source_items(self.type, get_by_id=option_id)
  File "wcs/carddef.py", line 193, in get_data_source_items
    limit=limit)]

Dans le reste de la trace on voit que c'est lors d'un import CSV, avec cette valeur (424508729041982) tapée dans une colonne correspondant à un champ liste alimenté depuis un modèle de fiches; j'imagine le fichier CSV mauvais à la base, avec ce nombre qui est en fait autre chose, genre numéro d'allocataire RSA (aucune idée de la gueule que ça a en vrai).

#3 Updated by Lauréline Guerin 9 days ago

  • Assignee set to Frédéric Péters
  • Status changed from Solution proposée to Solution validée

#4 Updated by Frédéric Péters 8 days ago

  • Status changed from Solution validée to Résolu (à déployer)
commit 16a147d5373fb8cc967bed93d7fac2e749a675f9
Author: Frédéric Péters <fpeters@entrouvert.com>
Date:   Sun Oct 18 14:51:55 2020 +0200

    misc: don't look for cards with an id over postgresql limit (#47767)

#5 Updated by Frédéric Péters 8 days ago

  • Status changed from Résolu (à déployer) to Solution déployée

Also available in: Atom PDF