Kallithea issues archive

Issue #260: JSON-RPC get_repos fails if any repository is locked

Reported by: Brandon Jones
State: resolved
Created on: 2016-12-18 01:57
Updated on: 2016-12-21 00:40

Description

When calling the get_repos API command, it is returning this error.

016-12-17 20:51:11.273 ERROR [JSONRPC] Encountered unhandled exception: Traceback (most recent call last):
  File "c:\kallithea\env\lib\site-packages\kallithea\controllers\api\__init__.py", line 256, in _dispatch_call
    raw_response = self._inspect_call(self._func)
  File "c:\kallithea\env\lib\site-packages\pylons\controllers\core.py", line 107, in _inspect_call
    result = self._perform_call(func, args)
  File "c:\kallithea\env\lib\site-packages\pylons\controllers\core.py", line 57, in _perform_call
    return func(**args)
  File "c:\kallithea\env\lib\site-packages\kallithea\controllers\api\api.py", line 1330, in get_repos
    result.append(repo.get_api_data())
  File "c:\kallithea\env\lib\site-packages\kallithea\model\db.py", line 1234, in get_api_data
    if self.locked[0] else None,
AttributeError: 'NoneType' object has no attribute 'get_api_data'

Four repositories in my installation had locking enabled and were locked when that error was generated. Once I removed those locks, the get_repos command worked fine.

Attachments

Comments

Comment by Mads Kiilerich, on 2016-12-18 22:31

Can you reproduce it as a testcase in kallithea/tests/api/api_base.py ?

Comment by Brandon Jones, on 2016-12-20 15:10

Is there any documentation on how to run test cases? Not sure how to go about it.

Comment by Brandon Jones, on 2016-12-20 21:11

Was not able to reproduce as a test case. Must be specific to my implementation - very possible that something got mixed up when I migrated from RhodeCode 1.5.2.

Comment by Brandon Jones, on 2016-12-20 21:12

Not able to reproduce

Comment by Mads Kiilerich, on 2016-12-21 00:40