cliquet icon indicating copy to clipboard operation
cliquet copied to clipboard

UnicodeDecodeError: invalid_start_byte

Open Natim opened this issue 9 years ago • 8 comments

{"Pid":11823,"EnvVersion":"2.0","Hostname":"ip-172-31-22-215","Timestamp":1452819351327000000,"Fields":{"lang":"en","exception":"Traceback (most recent call last):\\n  File \\"~\\/pyramid\\/tweens.py\\", line 20, in excview_tween\\n    response = handler(request)\\n  File \\"~\\/pyramid_tm\\/__init__.py\\", line 101, in tm_tween\\n    reraise(*exc_info)\\n  File \\"~\\/pyramid_tm\\/__init__.py\\", line 83, in tm_tween\\n    response = handler(request)\\n  File \\"~\\/pyramid\\/router.py\\", line 78, in handle_request\\n    has_listeners and notify(NewRequest(request))\\n  File \\"~\\/pyramid\\/registry.py\\", line 91, in notify\\n    [ _ for _ in self.subscribers(events, None) ]\\n  File \\"~\\/zope\\/interface\\/registry.py\\", line 328, in subscribers\\n    return self.adapters.subscribers(objects, provided)\\n  File \\"~\\/zope\\/interface\\/adapter.py\\", line 596, in subscribers\\n    subscription(*objects)\\n  File \\"~\\/pyramid\\/config\\/adapters.py\\", line 103, in derived_subscriber\\n    return subscriber(arg[0])\\n  File \\"~\\/cliquet\\/initialization.py\\", line 346, in on_new_request\\n    path=event.request.path,\\n  File \\"~\\/webob\\/request.py\\", line 486, in path\\n    bpath = bytes_(self.path_info, self.url_encoding)\\n  File \\"~\\/webob\\/descriptors.py\\", line 68, in fget\\n    return req.encget(key, encattr=encattr)\\n  File \\"~\\/webob\\/request.py\\", line 178, in encget\\n    return val.decode(encoding)\\n  File \\"\\/data\\/syncto\\/lib64\\/python2.7\\/encodings\\/utf_8.py\\", line 16, in decode\\n    return codecs.utf_8_decode(input, errors, True)\\nUnicodeDecodeError: \'utf8\' codec can\'t decode byte 0x80 in position 1: invalid start byte","code":307,"uid":null,"errno":null,"querystring":"{}","agent":"Mozilla\\/5.0 [en] (X11, U; OpenVAS 7.0.5)","method":"GET","t":0,"time":"2016-01-15T00:55:50","path":"\\/webtools\\/control\\/main","authn_type":null},"Logger":"syncto","Type":["utf8","\\/\x80..\\/\x80..\\/\x80..\\/\x80..\\/\x80..\\/\x80..\\/\x80..\\/\x80..\\/boot.ini",1,2,"invalid start byte"],"Severity":2}

https://sentry.prod.mozaws.net/operations/syncto/group/206744/

Natim avatar Jan 15 '16 08:01 Natim

This is related to this code:

        # New logger context, with infos for request summary logger.
        logger.new(agent=request.headers.get('User-Agent'),
                   path=event.request.path,
                   method=request.method,
                   querystring=dict(request.GET),
                   uid=request.authenticated_userid,
                   lang=request.headers.get('Accept-Language'),
                   authn_type=getattr(request, 'authn_type', None),
                   errno=None)

Natim avatar Jan 15 '16 09:01 Natim

Any idea how to reproduce ? Should we close and wait for a second occurence ?

leplatrem avatar Mar 07 '16 15:03 leplatrem

Closing until next occurence

tarekziade avatar May 23 '16 06:05 tarekziade

New occurence.

Natim avatar Jul 26 '16 09:07 Natim

Apparently it is a bug in Pyramid. We can reproduce quite easily with every Cliquet related projects :(

Natim avatar Jul 26 '16 10:07 Natim

And probably cornice and pyramid projects too...

Natim avatar Jul 26 '16 10:07 Natim

This is a fix in Kinto: https://github.com/Kinto/kinto/pull/740/files (Which should be backported for Syncto in cliquet)

Natim avatar Jul 26 '16 12:07 Natim

I have created an issue in Pyramid: https://github.com/Pylons/pyramid/pull/2725

Natim avatar Jul 26 '16 12:07 Natim