Bug #103713
Les logs crash quand on log un caractère NUL - DataError: unsupported Unicode escape sequence
Start date:
20 March 2025
Due date:
% Done:
0%
Estimated time:
Patch proposed:
No
Planning:
No
Description
https://sentry.entrouvert.org/entrouvert/publik/issues/137696/
On reproduit avec ResourceLog.objects.create(levelno=1, extra='\x00\x00').extra
UntranslatableCharacter: unsupported Unicode escape sequence LINE 1: ...is.grandlyon.fr/grc-rest-pro/1.0/creer (=> 200)', '{"request... ^ DETAIL: \u0000 cannot be converted to text. CONTEXT: JSON data, line 1: ...ent-Type: application/octet-stream\r\n\r\nV\u0000... File "django/db/backends/utils.py", line 89, in _execute return self.cursor.execute(sql, params) DataError: unsupported Unicode escape sequence LINE 1: ...is.grandlyon.fr/grc-rest-pro/1.0/creer (=> 200)', '{"request... ^ DETAIL: \u0000 cannot be converted to text. CONTEXT: JSON data, line 1: ...ent-Type: application/octet-stream\r\n\r\nV\u0000... (21 additional frame(s) were not displayed) ... File "django/db/backends/utils.py", line 67, in execute return self._execute_with_wrappers( File "django/db/backends/utils.py", line 80, in _execute_with_wrappers return executor(sql, params, many, context) File "django/db/backends/utils.py", line 84, in _execute with self.db.wrap_database_errors: File "django/db/utils.py", line 91, in __exit__ raise dj_exc_value.with_traceback(traceback) from exc_value File "django/db/backends/utils.py", line 89, in _execute return self.cursor.execute(sql, params) Error occurred while processing request
Associated revisions
History
Updated by Gael Pasgrimaud (retour le 12 mai) about 1 month ago
- Project changed from Suivi des traces to Passerelle
Updated by Robot Gitea about 1 month ago
- Status changed from Nouveau to En cours
- Assignee set to Gael Pasgrimaud (retour le 12 mai)
Gael Pasgrimaud (gpasgrimaud) a ouvert une pull request sur Gitea concernant cette demande :
- URL : https://git.entrouvert.org/entrouvert/passerelle/pulls/742
- Titre : WIP: base: escape NUL caracters in extra before sending logs to postgres JSONB (#103713)
- Modifications : https://git.entrouvert.org/entrouvert/passerelle/pulls/742/files
Updated by Robot Gitea about 1 month ago
- Status changed from Solution proposée to Solution validée
Emmanuel Cazenave (ecazenave) a approuvé une pull request sur Gitea concernant cette demande :
Updated by Robot Gitea about 1 month ago
- Status changed from Solution validée to Résolu (à déployer)
Gael Pasgrimaud (gpasgrimaud) a mergé une pull request sur Gitea concernant cette demande :
- URL : https://git.entrouvert.org/entrouvert/passerelle/pulls/742
- Titre : base: escape NUL caracters in extra before sending logs to postgres JSONB (#103713)
- Modifications : https://git.entrouvert.org/entrouvert/passerelle/pulls/742/files
Updated by Transition automatique about 1 month ago
- Status changed from Résolu (à déployer) to Solution déployée
base: escape NUL caracters in extra before sending value to postgres JSONB (#103713)