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

Hitting /api/task/result/<id> for failed task will result in server error #25

Closed
tebeka opened this issue Oct 16, 2012 · 1 comment
Closed

Comments

@tebeka
Copy link
Contributor

tebeka commented Oct 16, 2012

I have a "div" task which divides two numbers. I invoked it with /api/task/apply-async/div with 1 and 0 parameters (which will cause an exception). The flower server had the following error (and returned 500):

[E 121016 09:14:18 web:1085] Uncaught exception GET /api/task/result/cca8490d-db6f-4623-ab66-ec5cae53c29a (127.0.0.1)
    HTTPRequest(protocol='http', host='localhost:5555', method='GET', uri='/api/task/result/cca8490d-db6f-4623-ab66-ec5cae53c29a', version='HTTP/1.1', remote_ip='127.0.0.1', body='', headers={'Host': 'localhost:5555', 'Accept-Encoding': 'identity, deflate, compress, gzip', 'Accept': '*/*', 'User-Agent': 'python-requests/0.13.3 CPython/2.7.3 Linux/3.2.0-32-generic'})
    Traceback (most recent call last):
      File "/usr/local/lib/python2.7/dist-packages/tornado/web.py", line 1042, in _execute
        getattr(self, self.request.method.lower())(*args, **kwargs)
      File "/usr/local/lib/python2.7/dist-packages/tornado/web.py", line 1809, in wrapper
        return method(self, *args, **kwargs)
      File "/usr/local/lib/python2.7/dist-packages/flower/api/tasks.py", line 60, in get
        self.write(response)
      File "/usr/local/lib/python2.7/dist-packages/tornado/web.py", line 493, in write
        chunk = escape.json_encode(chunk)
      File "/usr/local/lib/python2.7/dist-packages/tornado/escape.py", line 90, in json_encode
        return _json_encode(recursive_unicode(value)).replace("</", "<\\/")
      File "/usr/lib/python2.7/json/__init__.py", line 231, in dumps
        return _default_encoder.encode(obj)
      File "/usr/lib/python2.7/json/encoder.py", line 201, in encode
        chunks = self.iterencode(o, _one_shot=True)
      File "/usr/lib/python2.7/json/encoder.py", line 264, in iterencode
        return _iterencode(o, 0)
      File "/usr/lib/python2.7/json/encoder.py", line 178, in default
        raise TypeError(repr(o) + " is not JSON serializable")
    TypeError: ZeroDivisionError('integer division or modulo by zero',) is not JSON serializable
mher added a commit that referenced this issue Oct 17, 2012
@mher
Copy link
Owner

mher commented Oct 17, 2012

Thanks fixed!

@mher mher closed this as completed Oct 17, 2012
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

2 participants