Often, but not always, I get the following error message when I communicate with a running ledger. Notwithstanding the error, the communication is successful.
It’s harmless but annoying, can I do anything to prevent it from happening?
This is an example command:
from dazl.ledgerutil import ACS
async with dazl.connect(**ENV) as conn:
acs = ACS(conn, {'*'})
await acs.start()
SNAPSHOT = acs.read().result()
print(f"SNAPSHOT contains {len(SNAPSHOT)} contracts")
The command is being run from a Colab notebook, so I don’t need asyncio.run
to run it.
The error message and the success message at the end:
Future exception was never retrieved
future: <Future finished exception=ConnectionClosedError()>
Traceback (most recent call last):
File "/Users/gyorgybalazsi/Library/Python/3.9/lib/python/site-packages/grpc/aio/_call.py", line 539, in _send_unary_request
async def _send_unary_request(self) -> ResponseType:
asyncio.exceptions.CancelledError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/dazl/ledger/grpc/conn_aio.py", line 904, in items
async for event in self._tx_events(tx_filter_pb, offset, self._offset_range.end):
File "/usr/local/lib/python3.9/site-packages/dazl/ledger/grpc/conn_aio.py", line 958, in _tx_events
async for response in response_stream:
File "/Users/gyorgybalazsi/Library/Python/3.9/lib/python/site-packages/grpc/aio/_call.py", line 315, in _fetch_stream_responses
message = await self._read()
File "/Users/gyorgybalazsi/Library/Python/3.9/lib/python/site-packages/grpc/aio/_call.py", line 331, in _read
await self._preparation
asyncio.exceptions.CancelledError
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/dazl/ledgerutil/acs.py", line 197, in _main
async for state, snapshot in snapshots(self._conn, self._queries):
File "/usr/local/lib/python3.9/site-packages/dazl/ledgerutil/acs.py", line 255, in snapshots
async for obj in stream:
File "/usr/local/lib/python3.9/site-packages/dazl/ledger/grpc/conn_aio.py", line 914, in items
yield event
File "/usr/local/lib/python3.9/site-packages/dazl/ledger/errors.py", line 97, in __aexit__
raise ConnectionClosedError() from exc_val
dazl.ledger.errors.ConnectionClosedError
Future exception was never retrieved
future: <Future finished exception=ConnectionClosedError()>
Traceback (most recent call last):
File "/Users/gyorgybalazsi/Library/Python/3.9/lib/python/site-packages/grpc/aio/_call.py", line 539, in _send_unary_request
async def _send_unary_request(self) -> ResponseType:
asyncio.exceptions.CancelledError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/dazl/ledger/grpc/conn_aio.py", line 904, in items
async for event in self._tx_events(tx_filter_pb, offset, self._offset_range.end):
File "/usr/local/lib/python3.9/site-packages/dazl/ledger/grpc/conn_aio.py", line 958, in _tx_events
async for response in response_stream:
File "/Users/gyorgybalazsi/Library/Python/3.9/lib/python/site-packages/grpc/aio/_call.py", line 315, in _fetch_stream_responses
message = await self._read()
File "/Users/gyorgybalazsi/Library/Python/3.9/lib/python/site-packages/grpc/aio/_call.py", line 331, in _read
await self._preparation
asyncio.exceptions.CancelledError
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/dazl/ledgerutil/acs.py", line 197, in _main
async for state, snapshot in snapshots(self._conn, self._queries):
File "/usr/local/lib/python3.9/site-packages/dazl/ledgerutil/acs.py", line 255, in snapshots
async for obj in stream:
File "/usr/local/lib/python3.9/site-packages/dazl/ledger/grpc/conn_aio.py", line 914, in items
yield event
File "/usr/local/lib/python3.9/site-packages/dazl/ledger/errors.py", line 97, in __aexit__
raise ConnectionClosedError() from exc_val
dazl.ledger.errors.ConnectionClosedError
Future exception was never retrieved
future: <Future finished exception=ConnectionClosedError()>
Traceback (most recent call last):
File "/Users/gyorgybalazsi/Library/Python/3.9/lib/python/site-packages/grpc/aio/_call.py", line 539, in _send_unary_request
async def _send_unary_request(self) -> ResponseType:
asyncio.exceptions.CancelledError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/dazl/ledger/grpc/conn_aio.py", line 904, in items
async for event in self._tx_events(tx_filter_pb, offset, self._offset_range.end):
File "/usr/local/lib/python3.9/site-packages/dazl/ledger/grpc/conn_aio.py", line 958, in _tx_events
async for response in response_stream:
File "/Users/gyorgybalazsi/Library/Python/3.9/lib/python/site-packages/grpc/aio/_call.py", line 315, in _fetch_stream_responses
message = await self._read()
File "/Users/gyorgybalazsi/Library/Python/3.9/lib/python/site-packages/grpc/aio/_call.py", line 331, in _read
await self._preparation
asyncio.exceptions.CancelledError
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/dazl/ledgerutil/acs.py", line 197, in _main
async for state, snapshot in snapshots(self._conn, self._queries):
File "/usr/local/lib/python3.9/site-packages/dazl/ledgerutil/acs.py", line 255, in snapshots
async for obj in stream:
File "/usr/local/lib/python3.9/site-packages/dazl/ledger/grpc/conn_aio.py", line 914, in items
yield event
File "/usr/local/lib/python3.9/site-packages/dazl/ledger/errors.py", line 97, in __aexit__
raise ConnectionClosedError() from exc_val
dazl.ledger.errors.ConnectionClosedError
SNAPSHOT contains 71 contracts