Skip to content
This repository has been archived by the owner on Apr 19, 2022. It is now read-only.

deployr api: improved exception handling and script failure messaging #78

Open
alee opened this issue Jul 3, 2016 · 0 comments
Open

Comments

@alee
Copy link
Member

alee commented Jul 3, 2016

We are incorrectly trying to convert HTTP 400 responses from DeployR as JSON, which lead to the following stack traces and useless information being passed back to the client. The information from DeployR is a bit confusing however, for some reason when we try to run a script with invalid parameters (i.e., sdb=31 on luxedemo Figure 1), it generates the following Project param not specified on projectDirectoryList call error:

[miracle.core.deployr|check_status:155] results response: 400: Project param not specified on projectDirectoryList call, request denied.
[2016-07-03 07:57:29,999: ERROR/MainProcess] Task miracle.core.tasks.run_analysis_task[0834c421-507f-4670-8688-d7e1c7bba5f7] raised unexpected: ValueError('Extra data: line 1 column 4 - line 2 column 1 (char 3 - 79)',)
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/celery/app/trace.py", line 240, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/celery/app/trace.py", line 438, in __protected_call__
    return self.run(*args, **kwargs)
  File "/code/django/miracle/core/tasks.py", line 37, in run_analysis_task
    job_name='{}-{}'.format(analysis.name, output.pk))
  File "/code/django/miracle/core/deployr.py", line 238, in run_script
    job = Job(session)
  File "/code/django/miracle/core/deployr.py", line 156, in check_status
    try:
  File "/usr/lib/python2.7/site-packages/requests/models.py", line 812, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/lib64/python2.7/json/__init__.py", line 338, in loads
    return _default_decoder.decode(s)
  File "/usr/lib64/python2.7/json/decoder.py", line 368, in decode
    raise ValueError(errmsg("Extra data", s, end, len(s)))
ValueError: Extra data: line 1 column 4 - line 2 column 1 (char 3 - 79)

alee added a commit that referenced this issue Jul 3, 2016
- fix #69 but need to propagate better error messages.
We currently pass python exceptions resulting from attempting to parse
an http 400 response from DeployR as json. See #78
- specify KO ProjectModel to not rebuild its entire analyses object
graph whenever it refreshes via ko.mapping.fromJS(ON)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant