Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Single image upload fails with a 500 when a multipart/form-data request is made #540

Open
brianhelba opened this issue Mar 15, 2018 · 1 comment

Comments

@brianhelba
Copy link
Member

This should not result in unhandled exceptions, but should just cause the request to be gracefully rejected with a 400 error (ideally, with a descriptive error message).

@brianhelba
Copy link
Member Author

An example stack trace from this:

ERROR: 500 Error
Traceback (most recent call last):
  File "/home/ubuntu/girder/girder/api/rest.py", line 593, in endpointDecorator
    val = fun(self, args, kwargs)
  File "/home/ubuntu/girder/girder/api/rest.py", line 1175, in POST
    return self.handleRoute(method, path, params)
  File "/home/ubuntu/girder/girder/api/rest.py", line 918, in handleRoute
    val = handler(**kwargs)
  File "/home/ubuntu/girder/girder/api/access.py", line 63, in wrapped
    return fun(*args, **kwargs)
  File "/home/ubuntu/girder/girder/api/rest.py", line 410, in wrapped
    return fun(*args, **kwargs)
  File "/home/ubuntu/girder/plugins/isic_archive/server/api/dataset.py", line 224, in addImage
    params = self._decodeParams(params)
  File "/home/ubuntu/girder/plugins/isic_archive/server/api/base.py", line 47, in _decodeParams
    decodedValue = json.loads(value)
  File "/usr/lib/python2.7/json/__init__.py", line 339, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 364, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
TypeError: expected string or buffer
Additional info:
  Request URL: POST https://stage.isic-archive.com/api/v1/dataset/5aa63dab14773a2232d2dd61/image
  Query string: filename=test.jpg&signature=df

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant