1. Marcin Kuzminski
  2. RhodeCode

Issues

Issue #333 resolved

Call to API get_repo results in HTTP 500

lee
created an issue

Other API calls (get_repos, get_users, get_user, create_users_group, get_users_group, get_users_groups) have been working but calling the get_repo api method (documented [[http://packages.python.org/RhodeCode/api/api.html|here]]) via: {{{ curl http://localhost:5000/_admin/api -X POST -H 'content-type:text/plain' --data-binary '{"api_key":"29f22...d2ad0","method":"get_repo","args":{"name":"src/repo1"}}' }}} results in a HTTP 500 server error with the following stack trace:

{{{ 2012-01-06 15:23:51.865 ERROR [JSONRPC] Encountered unhandled exception: Traceback (most recent call last): File "/srv/rhodecode-venv/lib/python2.6/site-packages/rhodecode/controllers/api/init.py", line 201, in _dispatch_call raw_response = self._inspect_call(self._func) File "/srv/rhodecode-venv/lib/python2.6/site-packages/pylons/controllers/core.py", line 105, in _inspect_call result = self._perform_call(func, args) File "/srv/rhodecode-venv/lib/python2.6/site-packages/pylons/controllers/core.py", line 57, in _perform_call return func(**args) TypeError: get_repo() takes exactly 3 non-keyword arguments (2 given) }}}

At first glance it seems to be attempting to call [[https://bitbucket.org/marcinkuzminski/rhodecode/src/d0e477b5dc95/rhodecode/controllers/api/api.py#cl-242|api.py]] which indeed has three arguments.

Comments (1)

  1. Marcin Kuzminski repo owner

    The bug is with mismatch of param name, This is something i fixed in beta to show back as error, not to throw 500 error fix for now will be to call {"repo_name":"src/repo1"}}' and not {"name":"src/repo1"}}' I'll fixed that in default now that docs==actually api method. Thanks for posting this bug !

  2. Log in to comment