Scifabric / pbs

PYBOSSA command line client
GNU Affero General Public License v3.0
10 stars 11 forks source link

Update redundancy fails #32

Open alexandermendes opened 7 years ago

alexandermendes commented 7 years ago

Hi, I might try and track this down later but there seems to be an issue when updating the task redundancy, see below:

Traceback (most recent call last):
  File "c:\python27\lib\runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "c:\python27\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "C:\Python27\Scripts\pbs.exe\__main__.py", line 9, in <module>
  File "c:\python27\lib\site-packages\click\core.py", line 488, in __call__
    return self.main(*args, **kwargs)
  File "c:\python27\lib\site-packages\click\core.py", line 474, in main
    self.invoke(ctx)
  File "c:\python27\lib\site-packages\click\core.py", line 775, in invoke
    return self.invoke_subcommand(ctx, cmd, cmd_name, ctx.args[1:])
  File "c:\python27\lib\site-packages\click\core.py", line 784, in invoke_subcommand
    return cmd.invoke(cmd_ctx)
  File "c:\python27\lib\site-packages\click\core.py", line 676, in invoke
    ctx.invoke(self.callback, **ctx.params)
  File "c:\python27\lib\site-packages\click\core.py", line 325, in invoke
    return callback(*args, **kwargs)
  File "c:\python27\lib\site-packages\click\decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args[1:], **kwargs)
  File "c:\python27\lib\site-packages\click\core.py", line 325, in invoke
    return callback(*args, **kwargs)
  File "c:\python27\lib\site-packages\pbs.py", line 193, in update_task_redundancy
    res = _update_tasks_redundancy(config, task_id, redundancy)
  File "c:\python27\lib\site-packages\helpers.py", line 252, in _update_tasks_redundancy
    check_api_error(response)
  File "c:\python27\lib\site-packages\helpers.py", line 290, in check_api_error
    error=api_response)
pbsexceptions.TaskNotFound: ('PyBossa Task not found', {u'status': u'failed', u'target': u'task', u'exception_msg': u'Reserved keys in payload', u'status_code': 400, u'exception_cls': u'BadRequest', u'action': u'PUT'})
alexandermendes commented 7 years ago

Oh and that's just after creating the project, adding tasks, then throws the above when updating redundancy

teleyinex commented 7 years ago

Interesting. We're updating the tasks redundancy without problems so far. Can you share the post that you are doing? It looks like some private reserved keys are in the payload.

teleyinex commented 7 years ago

Forget about my previous post. I thought this was in pbclient. We need to double check it, as pbs might be sending reserved keys in its payload.

teleyinex commented 7 years ago

So, [this is](https://github.com/Scifabric/pbs/blob/master/helpers.py#L233 where we update the task n_answers. In principle is using pbclient so it should be fine. I'll try to debug this asap.

alexandermendes commented 7 years ago

It looks like this is probably explained by #36!

alexandermendes commented 7 years ago

Oh, nope, got ahead of myself there - it's probably a different error.