bcgov/TheOrgBook

[von-x] sync fails on second boot unless TOB is restarted

Closed this issue · 2 comments

TOB error:

tob-api_1     | WARNING 2018-09-12 21:10:59,761 views 10 140353535297280 >>> Register issuer
tob-api_1     | ERROR 2018-09-12 21:10:59,788 web_protocol 10 140353535297280 Error handling request
tob-api_1     | Traceback (most recent call last):
tob-api_1     |   File "/home/indy/.pyenv/versions/3.6.3/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 378, in start
tob-api_1     |     resp = await self._request_handler(request)
tob-api_1     |   File "/home/indy/.pyenv/versions/3.6.3/lib/python3.6/site-packages/aiohttp/web_app.py", line 341, in _handle
tob-api_1     |     resp = await handler(request)
tob-api_1     |   File "/home/indy/tob_anchor/views.py", line 443, in register_issuer
tob-api_1     |     await KEY_CACHE._cache_invalidate(didauth["keyId"], didauth["algorithm"])
tob-api_1     |   File "/home/indy/.pyenv/versions/3.6.3/lib/python3.6/site-packages/didauth/base.py", line 46, in _cache_invalidate
tob-api_1     |     self.remove_key(key_id, key_type)
tob-api_1     |   File "/home/indy/.pyenv/versions/3.6.3/lib/python3.6/site-packages/didauth/base.py", line 39, in remove_key
tob-api_1     |     del self._keys[key_type][key_id]
tob-api_1     | KeyError: 'did:sov:6qnvgJtqwK44D8LFYnV5Yf'
tob-api_1     | INFO 2018-09-12 21:10:59,790 helpers 10 140353535297280 172.19.0.11 [12/Sep/2018:21:10:59 +0000] "POST /api/v2/indy/register-issuer HTTP/1.1" 500 330 "-" "Python/3.6 aiohttp/3.3.2"

permitify error:

city-surrey-agent_1       | 2018-09-12 21:11:00,108 ERROR [vonx.common.service]: Error during indy sync:
city-surrey-agent_1       | Traceback (most recent call last):
city-surrey-agent_1       |   File "/home/indy/.pyenv/versions/3.6.3/lib/python3.6/site-packages/vonx/common/service.py", line 177, in _sync
city-surrey-agent_1       |     synced = await self._service_sync()
city-surrey-agent_1       |   File "/home/indy/.pyenv/versions/3.6.3/lib/python3.6/site-packages/vonx/indy/service.py", line 227, in _service_sync
city-surrey-agent_1       |     if not await self._sync_connection(connection):
city-surrey-agent_1       |   File "/home/indy/.pyenv/versions/3.6.3/lib/python3.6/site-packages/vonx/indy/service.py", line 421, in _sync_connection
city-surrey-agent_1       |     connection.connection_id, str(e))) from None
city-surrey-agent_1       | vonx.common.service.ServiceSyncError: Error syncing connection ministry-finance: Bad response from post_json: (500) <html><head><title>500 Internal Server Error</title></head><body><h1>500 Internal Server Error</h1>Server got itself in trouble</body></html>

steps to reproduce:

  • start TOB
  • start permitify (von-x)
  • restart permitify
  • fails with above error

Fixed in didauth 1.2.2

Verified with bcreg-x-agent (von-x).