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

[develop] TypeError when assigning a ranking #362

Closed
DePierre opened this issue Nov 4, 2014 · 2 comments
Closed

[develop] TypeError when assigning a ranking #362

DePierre opened this issue Nov 4, 2014 · 2 comments

Comments

@DePierre
Copy link
Contributor

DePierre commented Nov 4, 2014

This looks like an error I reported for re-architecture.

It happens when assigning a ranking to a plugin report:

[E 141104 20:27:15 web:1407] Uncaught exception PATCH /api/targets/1/poutput/web/active/OWTF-CM-008 (127.0.0.1)
    HTTPServerRequest(protocol='http', host='127.0.0.1:8009', method='PATCH', uri='/api/targets/1/poutput/web/active/OWTF-CM-008', version='HTTP/1.1', remote_ip='127.0.0.1', headers={'Content-Length': '11', 'Accept-Language': 'en-US,en;q=0.5', 'Accept-Encoding': 'gzip, deflate', 'Host': '127.0.0.1:8009', 'Accept': '*/*', 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:33.0) Gecko/20100101 Firefox/33.0', 'Connection': 'keep-alive', 'X-Requested-With': 'XMLHttpRequest', 'Referer': 'http://127.0.0.1:8009/ui/targets/1', 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'})
    Traceback (most recent call last):
      File "/usr/lib/python2.7/site-packages/tornado/web.py", line 1332, in _execute
        result = method(*self.path_args, **self.path_kwargs)
      File "/home/depierre/git-repo/owcs/owtf/framework/interface/api_handlers.py", line 513, in patch
        self.get_component("plugin_output").Update(plugin_group, plugin_type, plugin_code, patch_data, target_id)
      File "/home/depierre/git-repo/owcs/owtf/framework/db/target_manager.py", line 57, in wrapped_function
        return func(*args, **kwargs)
    TypeError: Update() got multiple values for keyword argument 'target_id'
[E 141104 20:27:15 web:1811] 500 PATCH /api/targets/1/poutput/web/active/OWTF-CM-008 (127.0.0.1) 1.57ms

Because of this error, the user is not able to assign a ranking that will be saved to the database. Reloading the page will in fact reset the ranking to none.

Could you have a look @alessandrofg ?

@DePierre DePierre added the Bug label Nov 4, 2014
@DePierre DePierre changed the title TypeError when assigning a ranking [develop] TypeError when assigning a ranking Nov 4, 2014
@flabbergastedbd
Copy link
Contributor

https://github.com/owtf/owtf/blob/develop/framework/interface/api_handlers.py#L513

Anywhere if there is a target_id as optional argument, please provide it using the keyword, it is required for our decorator. So it must be something like

Update(...., target_id=target_id)

@DePierre
Copy link
Contributor Author

@alessandrofg Please check if any other errors of that kind still exist.

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

No branches or pull requests

2 participants