kinto icon indicating copy to clipboard operation
kinto copied to clipboard

Kinto returns HTTP 500 on get_records endpoint (unbalanced parenthesis)

Open AlexB1986 opened this issue 4 years ago • 4 comments

Steps to reproduce docker run -p 8888:8888 kinto/kinto-server Running kinto 14.0.1.dev0.

Request

GET /v1/buckets/)EFg9=)%5E(M~%2037/collections/M*D;1Z/records HTTP/1.1
Host: 127.0.0.1:8888

Response

{
    "code": 500,
    "errno": 999,
    "error": "Internal Server Error",
    "message": "A programmatic error occured, developers have been informed.",
    "info": "https://github.com/Kinto/kinto/issues/"
}

Log:

"GET /v1/buckets/)EFg9=)%5E(M~%2037/collections/M*D;1Z/records?" ? (? ms) unbalanced parenthesis at position 10 errno=999
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/pyramid/tweens.py", line 41, in excview_tween
response = handler(request)
File "/app/kinto/core/events.py", line 157, in tween
File "/usr/local/lib/python3.7/site-packages/pyramid/router.py", line 148, in handle_request
registry, request, context, context_iface, view_name
File "/usr/local/lib/python3.7/site-packages/pyramid/view.py", line 683, in _call_view
response = view_callable(context, request)
File "/usr/local/lib/python3.7/site-packages/pyramid/config/views.py", line 169, in __call__
return view(context, request)
File "/usr/local/lib/python3.7/site-packages/pyramid/config/views.py", line 188, in attr_view
File "/usr/local/lib/python3.7/site-packages/pyramid/config/views.py", line 214, in predicate_wrapper

File "/usr/local/lib/python3.7/site-packages/pyramid/viewderivers.py", line 323, in secured_view

result = permitted(context, request)
File "/usr/local/lib/python3.7/site-packages/pyramid/viewderivers.py", line 320, in permitted
return authz_policy.permits(context, principals, permission)
File "/app/kinto/core/authorization.py", line 94, in permits
context.fetch_shared_objects(permission, principals, self.get_bound_permissions)
File "/app/kinto/core/authorization.py", line 229, in fetch_shared_objects
by_obj_id = self._get_accessible_objects(principals, bound_perms, with_children=False)
File "/app/kinto/core/decorators.py", line 45, in decorated
re.error: unbalanced parenthesis at position 10
"GET /v1/buckets/)EFg9=)%5E(M~%2037/collections/M*D;1Z/records?" 500 (5 ms) agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36 errno=999 lang=en-US,en;q=0.9 time=2020-12-14T13:18:58.482000

AlexB1986 avatar Dec 14 '20 13:12 AlexB1986

Nice catch!

leplatrem avatar Dec 15 '20 10:12 leplatrem

I would like to work on this issue

pawankm21 avatar Oct 01 '21 18:10 pawankm21

@pawankm21 are you still planning on working on this? I would like to give it a try if not. Thanks :-)

robinbanbury avatar Nov 01 '21 12:11 robinbanbury

yeah, you can take this.

pawankm21 avatar Nov 02 '21 16:11 pawankm21