Project

General

Profile

Bug #28124

crash sur log d'erreur avec un caractère pas ascii

Added by Frédéric Péters 5 months ago. Updated 5 months ago.

Status:
Nouveau
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
19 Nov 2018
Due date:
% Done:

0%

Patch proposed:
No
Planning:
No

Description

Internal Server Error: /csvdatasource/numeros-voies-31555/query/sti/
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py", line 132, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/lib/python2.7/dist-packages/django/views/generic/base.py", line 71, in view
    return self.dispatch(request, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/django/views/decorators/csrf.py", line 58, in wrapped_view
    return view_func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/passerelle/views.py", line 326, in dispatch
    return super(GenericEndpointView, self).dispatch(request, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/passerelle/views.py", line 138, in dispatch
    request, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/django/views/generic/base.py", line 89, in dispatch
    return handler(request, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/passerelle/views.py", line 402, in get
    return to_json(logger=connector.logger)(self.perform)(request, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/passerelle/utils/jsonresponse.py", line 57, in wrapper
    return method(f, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/passerelle/utils/jsonresponse.py", line 113, in api_func
    return self.api(f, args[0], *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/passerelle/utils/jsonresponse.py", line 135, in api
    logger.exception("Error occurred while processing request", extra=extras)
  File "/usr/lib/python2.7/dist-packages/passerelle/base/models.py", line 548, in exception
    self._log('ERROR', message, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/passerelle/base/models.py", line 544, in _log
    getattr(self._logger, levelname.lower())(message, *args, **kwargs)
  File "/usr/lib/python2.7/logging/__init__.py", line 1186, in error
    self._log(ERROR, msg, args, **kwargs)
  File "/usr/lib/python2.7/logging/__init__.py", line 1279, in _log
    self.handle(record)
  File "/usr/lib/python2.7/logging/__init__.py", line 1289, in handle
    self.callHandlers(record)
  File "/usr/lib/python2.7/logging/__init__.py", line 1329, in callHandlers
    hdlr.handle(record)
  File "/usr/lib/python2.7/logging/__init__.py", line 757, in handle
    self.emit(record)
  File "/usr/lib/python2.7/dist-packages/django/utils/log.py", line 126, in emit
    message = "%s\n\nRequest repr(): %s" % (self.format(record), request_repr)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 2796: ordinal not in range(128)

History

#1 Updated by Frédéric Péters 5 months ago

Pour info l'exception d'origine, qui amène le problème :

  IntegrityError: ERREUR:  la valeur d\'une cl\xc3\xa9 dupliqu\xc3\xa9e rompt la contrainte unique \xc2\xab csvdatasource_tablerow_resource_id_4f8f84bd25db6670_uniq \xc2\xbb\nDETAIL:  La cl\xc3\xa9 \xc2\xab (resource_id, line_number)=(46, 0) \xc2\xbb existe d\xc3\xa9j\xc3\xa0.\n', 2796, 2797, 'ordinal not in range(128)')

Also available in: Atom PDF