Open-event-frontend: Admin Users Page 50

Created on 13 May 2019  路  13Comments  路  Source: fossasia/open-event-frontend

The admin users page shows a 500 error: https://eventyay.com/admin/users/deleted

Screenshot from 2019-05-13 10-14-32

bug

All 13 comments

@uds5501 @kushthedude @shreyanshdwivedi Can you reproduce this locally?

@CosmicCoder96 I was able to get this error when i had two superusers . Needed to remove one and it was fine then.

@CosmicCoder96 No, I can't.

@CosmicCoder96 I also can't reproduce this locally

@CosmicCoder96 I was able to get this error when I had two superusers . Needed to remove one and it was fine then.

Hmm, I can't either, but this might be a clue. If anyone finds what's wrong please claim this, can't access this page in production at all.

Docker container logs:

2019-05-15T19:18:58.502461473Z Traceback (most recent call last):
2019-05-15T19:18:58.502466359Z   File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app
2019-05-15T19:18:58.502478796Z     response = self.full_dispatch_request()
2019-05-15T19:18:58.502483918Z   File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1815, in full_dispatch_request
2019-05-15T19:18:58.502489113Z     rv = self.handle_user_exception(e)
2019-05-15T19:18:58.502493667Z   File "/usr/local/lib/python3.6/site-packages/flask_cors/extension.py", line 161, in wrapped_function
2019-05-15T19:18:58.502498895Z     return cors_after_request(app.make_response(f(*args, **kwargs)))
2019-05-15T19:18:58.502504096Z   File "/usr/local/lib/python3.6/site-packages/flask_cors/extension.py", line 161, in wrapped_function
2019-05-15T19:18:58.502509528Z     return cors_after_request(app.make_response(f(*args, **kwargs)))
2019-05-15T19:18:58.502514570Z   File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1718, in handle_user_exception
2019-05-15T19:18:58.502535146Z     reraise(exc_type, exc_value, tb)
2019-05-15T19:18:58.502539776Z   File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
2019-05-15T19:18:58.502544665Z     raise value
2019-05-15T19:18:58.502549647Z   File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request
2019-05-15T19:18:58.502554545Z     rv = self.dispatch_request()
2019-05-15T19:18:58.502559330Z   File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request
2019-05-15T19:18:58.502564465Z     return self.view_functions[rule.endpoint](**req.view_args)
2019-05-15T19:18:58.502569611Z   File "/usr/local/lib/python3.6/site-packages/flask_rest_jsonapi/api.py", line 133, in decorated
2019-05-15T19:18:58.502574594Z     return self.check_permissions(view, view_args, view_kwargs, *args, **kwargs)
2019-05-15T19:18:58.502579119Z   File "/data/app/app/api/helpers/permission_manager.py", line 439, in permission_manager
2019-05-15T19:18:58.502583944Z     return permissions[args[0]](view, view_args, view_kwargs, *args, **kwargs)
2019-05-15T19:18:58.502588752Z   File "/data/app/app/api/helpers/permissions.py", line 45, in decorator
2019-05-15T19:18:58.502594333Z     return fn(*args, **kwargs)
2019-05-15T19:18:58.502614162Z   File "/data/app/app/api/helpers/permission_manager.py", line 38, in is_admin
2019-05-15T19:18:58.502620398Z     return view(*view_args, **view_kwargs)
2019-05-15T19:18:58.502625660Z   File "/usr/local/lib/python3.6/site-packages/flask_rest_jsonapi/decorators.py", line 32, in wrapper
2019-05-15T19:18:58.502631333Z     return func(*args, **kwargs)
2019-05-15T19:18:58.502636299Z   File "/usr/local/lib/python3.6/site-packages/flask/views.py", line 88, in view
2019-05-15T19:18:58.502642546Z     return self.dispatch_request(*args, **kwargs)
2019-05-15T19:18:58.502647634Z   File "/usr/local/lib/python3.6/site-packages/flask_rest_jsonapi/resource.py", line 68, in dispatch_request
2019-05-15T19:18:58.502652912Z     response = method(*args, **kwargs)
2019-05-15T19:18:58.502663704Z   File "/usr/local/lib/python3.6/site-packages/flask_rest_jsonapi/decorators.py", line 56, in wrapper
2019-05-15T19:18:58.502668629Z     return func(*args, **kwargs)
2019-05-15T19:18:58.502673288Z   File "/usr/local/lib/python3.6/site-packages/flask_rest_jsonapi/resource.py", line 161, in get
2019-05-15T19:18:58.502678267Z     url_for(self.view, **view_kwargs))
2019-05-15T19:18:58.502698911Z   File "/usr/local/lib/python3.6/site-packages/flask_rest_jsonapi/pagination.py", line 53, in add_pagination_links
2019-05-15T19:18:58.502704861Z     data['links'] = links
2019-05-15T19:18:58.502709794Z TypeError: list indices must be integers or slices, not str

@CosmicCoder96 this is an error at flask JSON rest API level.

@uds5501 Yes, also it is data dependent which is worrisome, probably Unicode related.

@CosmicCoder96 have a look at this , see if it helps

https://github.com/fossasia/open-event-server/issues/5661#issuecomment-470048751

@uds5501 I have tried that before, its a partial fix, more of a hack. On going deeper in the source code I was able to conclude it was a validation issue. Schema rejected the value it was getting. In some cases it was bad URLs which were 'supposed' to be URLs but contained spaces etc. Hence it couldn't become a list, but of course the data was there, so your solution forces the data into the list bypassing the validation.

@uds5501 @mariobehling a non-friendly unicoded single inverted comma in FOSDEM's (event id 711) code of conduct, 4 test events with bad external ticket URLs and three rouge users with emails of format abx@xyz (created in legacy due to lack of email validation were causing it). I have modified the CoC of FOSDEM, and deleted the fake users and events from production DB. Hence resolved now.

@CosmicCoder96 do we have any check to take care of these unicodes in text fields for now?

Yeah the new API will reject any data by default which does not fulfil validations.

Was this page helpful?
0 / 5 - 0 ratings