Skip to content

Commit

Permalink
Initialize my_endpoints with my_endpoint
Browse files Browse the repository at this point in the history
While I was trying to manually go through the invite/request process via Swagger I used the `/connections/{conn_id}/accept-request` endpoint and added My URL endpoint which resulted in an error 500.

```
Creating connection response
    connection_id: db0b89aa-df4c-4ec7-a99d-f11c1bcb18df

2020-09-09 12:32:12,290 aries_cloudagent.core.dispatcher ERROR Handler error: connections_accept_request
Traceback (most recent call last):
  File "/home/laurencedejong/.venv/aries-cloudagent-python/lib/python3.6/site-packages/aries_cloudagent/protocols/connections/v1_0/routes.py", line 435, in connections_accept_request
    response = await connection_mgr.create_response(connection, my_endpoint)
  File "/home/laurencedejong/.venv/aries-cloudagent-python/lib/python3.6/site-packages/aries_cloudagent/protocols/connections/v1_0/manager.py", line 488, in create_response
    my_info, connection.inbound_connection_id, my_endpoints
UnboundLocalError: local variable 'my_endpoints' referenced before assignment
2020-09-09 12:32:12,292 aries_cloudagent.admin.server ERROR Handler error with exception: local variable 'my_endpoints' referenced before assignment
2020-09-09 12:32:12,292 aiohttp.server ERROR Error handling request
Traceback (most recent call last):
  File "/home/laurencedejong/.venv/aries-cloudagent-python/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 418, in start
    resp = await task
  File "/home/laurencedejong/.venv/aries-cloudagent-python/lib/python3.6/site-packages/aiohttp/web_app.py", line 458, in _handle
    resp = await handler(request)
  File "/home/laurencedejong/.venv/aries-cloudagent-python/lib/python3.6/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/home/laurencedejong/.venv/aries-cloudagent-python/lib/python3.6/site-packages/aries_cloudagent/admin/server.py", line 146, in ready_middleware
    raise e
  File "/home/laurencedejong/.venv/aries-cloudagent-python/lib/python3.6/site-packages/aries_cloudagent/admin/server.py", line 136, in ready_middleware
    return await handler(request)
  File "/home/laurencedejong/.venv/aries-cloudagent-python/lib/python3.6/site-packages/aries_cloudagent/admin/server.py", line 161, in debug_middleware
    return await handler(request)
  File "/home/laurencedejong/.venv/aries-cloudagent-python/lib/python3.6/site-packages/aiohttp_apispec/middlewares.py", line 45, in validation_middleware
    return await handler(request)
  File "/home/laurencedejong/.venv/aries-cloudagent-python/lib/python3.6/site-packages/aries_cloudagent/admin/server.py", line 253, in apply_limiter
    return await task
  File "/home/laurencedejong/.venv/aries-cloudagent-python/lib/python3.6/site-packages/aries_cloudagent/protocols/connections/v1_0/routes.py", line 435, in connections_accept_request
    response = await connection_mgr.create_response(connection, my_endpoint)
  File "/home/laurencedejong/.venv/aries-cloudagent-python/lib/python3.6/site-packages/aries_cloudagent/protocols/connections/v1_0/manager.py", line 488, in create_response
    my_info, connection.inbound_connection_id, my_endpoints
UnboundLocalError: local variable 'my_endpoints' referenced before assignment
```

Signed-off-by: Laurence de Jong <[email protected]>
  • Loading branch information
ldej committed Sep 10, 2020
1 parent 25b7a9c commit 14951e9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions aries_cloudagent/protocols/connections/v1_0/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,8 @@ async def create_response(
if default_endpoint:
my_endpoints.append(default_endpoint)
my_endpoints.extend(self.context.settings.get("additional_endpoints", []))
else:
my_endpoints = [my_endpoint]
did_doc = await self.create_did_document(
my_info, connection.inbound_connection_id, my_endpoints
)
Expand Down

0 comments on commit 14951e9

Please sign in to comment.