Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • beat.web beat.web
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 54
    • Issues 54
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 2
    • Merge requests 2
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • beatbeat
  • beat.webbeat.web
  • Issues
  • #405
Closed
Open
Issue created Feb 23, 2016 by André Anjos@andre.anjos💬Owner

[databases] Hitting API issues a 500 error

For some reason, hitting the databases API this way:

https://www.beat-eu.org/platform/api/v1/databases/?fields=name,hash,description,creation_date

Raises an internal error:

Internal Server Error: /platform/api/v1/databases/
Traceback (most recent call last):
  File "/remote/sw/beat.env.web-1.0.0/usr/lib/python2.7/site-packages/django/core/handlers/base.py", line 132, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/remote/sw/beat.env.web-1.0.0/usr/lib/python2.7/site-packages/django/views/decorators/csrf.py", line 58, in wrapped_view
    return view_func(*args, **kwargs)
  File "/remote/sw/beat.env.web-1.0.0/usr/lib/python2.7/site-packages/django/views/generic/base.py", line 71, in view
    return self.dispatch(request, *args, **kwargs)
  File "/remote/sw/beat.env.web-1.0.0/usr/lib/python2.7/site-packages/rest_framework/views.py", line 466, in dispatch
    response = self.handle_exception(exc)
  File "/remote/sw/beat.env.web-1.0.0/usr/lib/python2.7/site-packages/rest_framework/views.py", line 463, in dispatch
    response = handler(request, *args, **kwargs)
  File "/remote/sw/beat.web/src/beat.web/beat/web/databases/api.py", line 95, in get
    return Response(serializer.data)
  File "/remote/sw/beat.env.web-1.0.0/usr/lib/python2.7/site-packages/rest_framework/serializers.py", line 674, in data
    ret = super(ListSerializer, self).data
  File "/remote/sw/beat.env.web-1.0.0/usr/lib/python2.7/site-packages/rest_framework/serializers.py", line 239, in data
    self._data = self.to_representation(self.instance)
  File "/remote/sw/beat.env.web-1.0.0/usr/lib/python2.7/site-packages/rest_framework/serializers.py", line 614, in to_representation
    self.child.to_representation(item) for item in iterable
  File "/remote/sw/beat.env.web-1.0.0/usr/lib/python2.7/site-packages/rest_framework/serializers.py", line 472, in to_representation
    ret[field.field_name] = field.to_representation(attribute)
  File "/remote/sw/beat.env.web-1.0.0/usr/lib/python2.7/site-packages/rest_framework/fields.py", line 703, in to_representation
    return six.text_type(value)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 902: ordinal not in range(128)

Request repr():
<WSGIRequest
path:/platform/api/v1/databases/,
GET:<QueryDict: {u'fields': [u'name,hash,description,creation_date']}>,
POST:<QueryDict: {}>,
COOKIES:{},
META:{'CONTENT_LENGTH': '',
 'CONTENT_TYPE': '',
 'HTTP_ACCEPT_ENCODING': 'identity',
 'HTTP_AUTHORIZATION': 'Token 1137793fe71df5d3451292e02a5bc288e6646e5c',
 'HTTP_CONNECTION': 'Keep-Alive',
 'HTTP_HOST': 'beatweb.lab.idiap.ch',
 'HTTP_X_FORWARDED_FOR': '172.29.17.14',
 'HTTP_X_FORWARDED_HOST': 'www.beat-eu.org',
 'HTTP_X_FORWARDED_SERVER': 'www.beat-eu.org',
 'PATH_INFO': u'/platform/api/v1/databases/',
 'QUERY_STRING': 'fields=name,hash,description,creation_date',
 'REMOTE_ADDR': '172.30.90.51',
 'REQUEST_METHOD': 'GET',
 u'SCRIPT_NAME': u'',
 'SERVER_ADDR': '172.31.100.250',
 'SERVER_NAME': 'www.beat-eu.org',
 'SERVER_PORT': '80',
 'SERVER_PROTOCOL': 'HTTP/1.1',
 'X_FORWARDED_HOST': 'www.beat-eu.org',
 'X_FORWARDED_PROTO': 'https',
 'uwsgi.node': 'beatweb.lab.kvm',
 'uwsgi.version': '2.0.12',
 'wsgi.errors': <open file 'wsgi_errors', mode 'w' at 0x7f769d0f2930>,
 'wsgi.file_wrapper': <built-in function uwsgi_sendfile>,
 'wsgi.input': <uwsgi._Input object at 0x7f76993f6138>,
 'wsgi.multiprocess': True,
 'wsgi.multithread': False,
 'wsgi.run_once': False,
 'wsgi.url_scheme': 'http',
 'wsgi.version': (1, 0)}>
Assignee
Assign to
Time tracking