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

[multitenancy + askar] connection error occurs occasionally #1323

Closed
baegjae opened this issue Jul 16, 2021 · 0 comments · Fixed by #1324
Closed

[multitenancy + askar] connection error occurs occasionally #1323

baegjae opened this issue Jul 16, 2021 · 0 comments · Fixed by #1324

Comments

@baegjae
Copy link
Contributor

baegjae commented Jul 16, 2021

Congratulations on releasing 0.7.0.
With this, we are testing askar features.
I encountered connection error occasionally, and below is the situation.

  1. Faber sub-wallet is created with wallet_type askar.
  2. Alice sub-wallet is created with wallet_type askar.
  3. Do Faber-Alice demo (connection, issue, proof), and delete Alice sub-wallet.
    (no public invitation)

I did Step 2 and 3 repeatedly.
A connection error occurred once in 5 times.
Specifically, when Faber Agent receives the connection request message from Alice, below logs printed.

2021-07-16 16:43:01,981 aiohttp.server ERROR Error handling request
Traceback (most recent call last):
  File "/Users/baegjae/src/aries-cloudagent-python/aries_cloudagent/transport/pack_format.py", line 214, in get_recipient_keys
    protected = json.loads(b64decode(message_dict["protected"]))
  File "/usr/local/Cellar/[email protected]/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/base64.py", line 87, in b64decode
    return binascii.a2b_base64(s)
binascii.Error: Incorrect padding
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/Users/baegjae/venv/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request
    resp = await self._request_handler(request)
  File "/Users/baegjae/venv/lib/python3.9/site-packages/aiohttp/web_app.py", line 499, in _handle
    resp = await handler(request)
  File "/Users/baegjae/src/aries-cloudagent-python/aries_cloudagent/transport/inbound/http.py", line 105, in inbound_message_handler
    inbound = await session.receive(body)
  File "/Users/baegjae/src/aries-cloudagent-python/aries_cloudagent/transport/inbound/session.py", line 218, in receive
    await self.handle_relay_context(payload_enc)
  File "/Users/baegjae/src/aries-cloudagent-python/aries_cloudagent/transport/inbound/session.py", line 165, in handle_relay_context
    [wallet] = await multitenant_mgr.get_wallets_by_message(
  File "/Users/baegjae/src/aries-cloudagent-python/aries_cloudagent/multitenant/manager.py", line 481, in get_wallets_by_message
    recipient_keys = wire_format.get_recipient_keys(message_body)
  File "/Users/baegjae/src/aries-cloudagent-python/aries_cloudagent/transport/pack_format.py", line 219, in get_recipient_keys
    raise RecipientKeysError(
aries_cloudagent.transport.error.RecipientKeysError: ('Error trying to extract recipient keys from JWE', Error('Incorrect padding'))

I hope the below log values will be useful.

Log value of message_dict["protected"] in the normal case:

eyJlbmMiOiAieGNoYWNoYTIwcG9seTEzMDVfaWV0ZiIsICJ0eXAiOiAiSldNLzEuMCIsICJhbGciOiAiQXV0aGNyeXB0IiwgInJlY2lwaWVudHMiOiBbeyJlbmNyeXB0ZWRfa2V5IjogIkVDanE0ZHp4TUZ1Q0JWZ0ZBeXB3NnVQb3hXakdESUdRMW40QWFJZzdhdUpPdlppT3dhZ0ZaNTB4d2pmbWRLa1giLCAiaGVhZGVyIjogeyJraWQiOiAiOW5VWFkzV1ZwRGJYMkdEYzFZdFlhZkZpTHpHMmEzV2tyS0NldEtvQzNEd1AiLCAic2VuZGVyIjogIk1XZWZWYlo5Z2dSV1FkZEgwV1AyWkdMUENDamd0UmRmMFVoT1BQTGwwVWZxUTJIbjlOTEpSYXBXQ3BHT0hBLWFxTnkyWk1pMW9rWGRrWG50bTczVGN6QVZwdEg1VFYwdVBseUdtdjlqWTZXdUI4cXdpVEcwNDRnOTN4cyIsICJpdiI6ICIxcnZoMUhQd0dxN2gwZWVvcHpRbEQzWHBOMlo1NHVYWSJ9fV19

Log value of message_dict["protected"] in the error case:

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