SDK V0.7.0 Upgrade ConnectionRefusedError: [Errno 61] Connection refused #155
Replies: 3 comments
-
@emanuel-skai I repeated the steps you listed above and everything looks good on my end. The only suspicious looking thing in your output is the "500 Internal Server Error" log message. I'm wondering if maybe you caught our NilChain GRPC endpoint at a bad time, when it was temporarily unavailable. Can you try again and tell me if you get any different results? |
Beta Was this translation helpful? Give feedback.
-
Hey @jwolski2 thanks for the quick response. After trying a few more I'm still getting the same error message so I'm trying to debug deeper. I'm wonder if maybe some of the deprecated dependencies are creating an issue here. Would you mind to share your virtual environment so I can validate them. Mine looks as follows:
|
Beta Was this translation helpful? Give feedback.
-
@emanuel-skai Here's the list from a fresh virtualenv. Are you also running from a virtualenv?
|
Beta Was this translation helpful? Give feedback.
-
Hello, I'm trying to upgrade my services to use the latest version of the SDK= nillion v0.7.0
To do soI have followed these notes: https://github.com/orgs/NillionNetwork/discussions/150, Installed the new nillion-client 0.1.0 from https://pypi.org/project/nillion-client/0.1.0/ and update my env variables for the network configuration as detailed here https://docs.nillion.com/network-configuration.
I'm using a simple script to test the changes based on the example provided here https://github.com/NillionNetwork/nillion-python-starter/blob/main/quickstart_complete/client_code/secret_addition_complete.py.
However I'm adjusting the network configuration to use the testnet instead of the devnet. My client code looks as follows.
AttributeError: 'VmClient' object has no attribute 'leader'
WARNING:root:Invocation of cluster failed with error: [Errno 61] Connection refused, attempt: 1, sleep_time: 0.0s, timeout: 60s
WARNING:root:Invocation of cluster failed with error: [Errno 61] Connection refused, attempt: 2, sleep_time: 1s, timeout: 60s
WARNING:root:Invocation of cluster failed with error: [Errno 61] Connection refused, attempt: 3, sleep_time: 2s, timeout: 60s
WARNING:root:Invocation of cluster failed with error: [Errno 61] Connection refused, attempt: 4, sleep_time: 4s, timeout: 60s
WARNING:root:Invocation of cluster failed with error: [Errno 61] Connection refused, attempt: 5, sleep_time: 5.0s, timeout: 60s
WARNING:root:Invocation of cluster failed with error: [Errno 61] Connection refused, attempt: 6, sleep_time: 5.0s, timeout: 60s
WARNING:root:Invocation of cluster failed with error: [Errno 61] Connection refused, attempt: 7, sleep_time: 5.0s, timeout: 60s
WARNING:root:Invocation of cluster failed with error: [Errno 61] Connection refused, attempt: 8, sleep_time: 5.0s, timeout: 60s
WARNING:root:Invocation of cluster failed with error: [Errno 61] Connection refused, attempt: 9, sleep_time: 5.0s, timeout: 60s
WARNING:root:Invocation of cluster failed with error: [Errno 61] Connection refused, attempt: 10, sleep_time: 5.0s, timeout: 60s
INFO: 127.0.0.1:60149 - "POST /debug/?input_value=1&input_value_blob=t HTTP/1.1" 500 Internal Server Error
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/Users/emanuelhc/Desktop/code/nillion-mvp/mvp/services/nillion/.venv/lib/python3.12/site-packages/uvicorn/protocols/http/httptools_impl.py", line 411, in run_asgi
result = await app( # type: ignore[func-returns-value]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/emanuelhc/Desktop/code/nillion-mvp/mvp/services/nillion/.venv/lib/python3.12/site-packages/uvicorn/middleware/proxy_headers.py", line 69, in call
return await self.app(scope, receive, send)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/emanuelhc/Desktop/code/nillion-mvp/mvp/services/nillion/.venv/lib/python3.12/site-packages/fastapi/applications.py", line 1054, in call
await super().call(scope, receive, send)
File "/Users/emanuelhc/Desktop/code/nillion-mvp/mvp/services/nillion/.venv/lib/python3.12/site-packages/starlette/applications.py", line 123, in call
await self.middleware_stack(scope, receive, send)
File "/Users/emanuelhc/Desktop/code/nillion-mvp/mvp/services/nillion/.venv/lib/python3.12/site-packages/starlette/middleware/errors.py", line 186, in call
raise exc
File "/Users/emanuelhc/Desktop/code/nillion-mvp/mvp/services/nillion/.venv/lib/python3.12/site-packages/starlette/middleware/errors.py", line 164, in call
await self.app(scope, receive, _send)
File "/Users/emanuelhc/Desktop/code/nillion-mvp/mvp/services/nillion/.venv/lib/python3.12/site-packages/starlette/middleware/cors.py", line 93, in call
await self.simple_response(scope, receive, send, request_headers=headers)
File "/Users/emanuelhc/Desktop/code/nillion-mvp/mvp/services/nillion/.venv/lib/python3.12/site-packages/starlette/middleware/cors.py", line 148, in simple_response
await self.app(scope, receive, send)
File "/Users/emanuelhc/Desktop/code/nillion-mvp/mvp/services/nillion/.venv/lib/python3.12/site-packages/starlette/middleware/exceptions.py", line 65, in call
await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
File "/Users/emanuelhc/Desktop/code/nillion-mvp/mvp/services/nillion/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
raise exc
File "/Users/emanuelhc/Desktop/code/nillion-mvp/mvp/services/nillion/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
await app(scope, receive, sender)
File "/Users/emanuelhc/Desktop/code/nillion-mvp/mvp/services/nillion/.venv/lib/python3.12/site-packages/starlette/routing.py", line 756, in call
await self.middleware_stack(scope, receive, send)
File "/Users/emanuelhc/Desktop/code/nillion-mvp/mvp/services/nillion/.venv/lib/python3.12/site-packages/starlette/routing.py", line 776, in app
await route.handle(scope, receive, send)
File "/Users/emanuelhc/Desktop/code/nillion-mvp/mvp/services/nillion/.venv/lib/python3.12/site-packages/starlette/routing.py", line 297, in handle
await self.app(scope, receive, send)
File "/Users/emanuelhc/Desktop/code/nillion-mvp/mvp/services/nillion/.venv/lib/python3.12/site-packages/starlette/routing.py", line 77, in app
await wrap_app_handling_exceptions(app, request)(scope, receive, send)
File "/Users/emanuelhc/Desktop/code/nillion-mvp/mvp/services/nillion/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
raise exc
File "/Users/emanuelhc/Desktop/code/nillion-mvp/mvp/services/nillion/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
await app(scope, receive, sender)
File "/Users/emanuelhc/Desktop/code/nillion-mvp/mvp/services/nillion/.venv/lib/python3.12/site-packages/starlette/routing.py", line 72, in app
response = await func(request)
^^^^^^^^^^^^^^^^^^^
File "/Users/emanuelhc/Desktop/code/nillion-mvp/mvp/services/nillion/.venv/lib/python3.12/site-packages/fastapi/routing.py", line 278, in app
raw_response = await run_endpoint_function(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/emanuelhc/Desktop/code/nillion-mvp/mvp/services/nillion/.venv/lib/python3.12/site-packages/fastapi/routing.py", line 191, in run_endpoint_function
return await dependant.call(**values)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/emanuelhc/Desktop/code/nillion-mvp/mvp/services/nillion/web_app/routes/maintenance_routes.py", line 39, in debug
program_result = await run_debug_program(
^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/emanuelhc/Desktop/code/nillion-mvp/mvp/services/nillion/web_app/clients/debug_program_client.py", line 61, in run_debug_program
client = await VmClient.create(signing_key, network, payer)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/emanuelhc/Desktop/code/nillion-mvp/mvp/services/nillion/.venv/lib/python3.12/site-packages/nillion_client/client.py", line 317, in create
await client._async_init()
File "/Users/emanuelhc/Desktop/code/nillion-mvp/mvp/services/nillion/.venv/lib/python3.12/site-packages/nillion_client/client.py", line 246, in _async_init
self.cluster = await _invoke_with_retry(membership_service.cluster)(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/emanuelhc/Desktop/code/nillion-mvp/mvp/services/nillion/.venv/lib/python3.12/site-packages/tenacity/asyncio/init.py", line 189, in async_wrapped
return await copy(fn, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/emanuelhc/Desktop/code/nillion-mvp/mvp/services/nillion/.venv/lib/python3.12/site-packages/tenacity/asyncio/init.py", line 111, in call
do = await self.iter(retry_state=retry_state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/emanuelhc/Desktop/code/nillion-mvp/mvp/services/nillion/.venv/lib/python3.12/site-packages/tenacity/asyncio/init.py", line 153, in iter
result = await action(retry_state)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/emanuelhc/Desktop/code/nillion-mvp/mvp/services/nillion/.venv/lib/python3.12/site-packages/tenacity/_utils.py", line 99, in inner
return call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/Users/emanuelhc/Desktop/code/nillion-mvp/mvp/services/nillion/.venv/lib/python3.12/site-packages/tenacity/init.py", line 418, in exc_check
raise retry_exc.reraise()
^^^^^^^^^^^^^^^^^^^
File "/Users/emanuelhc/Desktop/code/nillion-mvp/mvp/services/nillion/.venv/lib/python3.12/site-packages/tenacity/init.py", line 185, in reraise
raise self.last_attempt.result()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/[email protected]/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/python3.12/concurrent/futures/_base.py", line 449, in result
return self.__get_result()
^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/[email protected]/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
raise self._exception
File "/Users/emanuelhc/Desktop/code/nillion-mvp/mvp/services/nillion/.venv/lib/python3.12/site-packages/tenacity/asyncio/init.py", line 114, in call
result = await fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/emanuelhc/Desktop/code/nillion-mvp/mvp/services/nillion/.venv/lib/python3.12/site-packages/nillion_client_proto/nillion/membership/v1/init.py", line 33, in cluster
return await self._unary_unary(
^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/emanuelhc/Desktop/code/nillion-mvp/mvp/services/nillion/.venv/lib/python3.12/site-packages/betterproto/grpc/grpclib_client.py", line 84, in _unary_unary
await stream.send_message(request, end=True)
File "/Users/emanuelhc/Desktop/code/nillion-mvp/mvp/services/nillion/.venv/lib/python3.12/site-packages/grpclib/client.py", line 241, in send_message
await self.send_request()
File "/Users/emanuelhc/Desktop/code/nillion-mvp/mvp/services/nillion/.venv/lib/python3.12/site-packages/grpclib/client.py", line 173, in send_request
protocol = await self._channel.connect()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/emanuelhc/Desktop/code/nillion-mvp/mvp/services/nillion/.venv/lib/python3.12/site-packages/grpclib/client.py", line 748, in connect
self._protocol = await self._create_connection()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/emanuelhc/Desktop/code/nillion-mvp/mvp/services/nillion/.venv/lib/python3.12/site-packages/grpclib/client.py", line 725, in _create_connection
_, protocol = await self._loop.create_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "uvloop/loop.pyx", line 2039, in create_connection
File "uvloop/loop.pyx", line 2016, in uvloop.loop.Loop.create_connection
ConnectionRefusedError: [Errno 61] Connection refused
Beta Was this translation helpful? Give feedback.
All reactions