Closed stefanlenoach closed 2 years ago
has same issue.
self = <urllib.request.HTTPHandler object at 0x10bdf22c0> http_class = <class 'http.client.HTTPConnection'> req = <urllib.request.Request object at 0x10be4ce50>, http_conn_args = {} host = 'localhost:4002', h = <http.client.HTTPConnection object at 0x10be4c0d0>
def do_open(self, http_class, req, **http_conn_args):
"""Return an HTTPResponse object for the request, using http_class.
http_class must implement the HTTPConnection API from http.client.
"""
host = req.host
if not host:
raise URLError('no host given')
# will parse host:port
h = http_class(host, timeout=req.timeout, **http_conn_args)
h.set_debuglevel(self._debuglevel)
headers = dict(req.unredirected_hdrs)
headers.update({k: v for k, v in req.headers.items()
if k not in headers})
# TODO(jhylton): Should this be redesigned to handle
# persistent connections?
# We want to make an HTTP/1.1 request, but the addinfourl
# class isn't prepared to deal with a persistent connection.
# It will try to read all remaining data from the socket,
# which will block while the server waits for the next request.
# So make sure the connection gets closed after the (only)
# request.
headers["Connection"] = "close"
headers = {name.title(): val for name, val in headers.items()}
if req._tunnel_host:
tunnel_headers = {}
proxy_auth_hdr = "Proxy-Authorization"
if proxy_auth_hdr in headers:
tunnel_headers[proxy_auth_hdr] = headers[proxy_auth_hdr]
# Proxy-Authorization should not be sent to origin
# server.
del headers[proxy_auth_hdr]
h.set_tunnel(req._tunnel_host, headers=tunnel_headers)
try:
try:
h.request(req.get_method(), req.selector, req.data, headers,
encode_chunked=req.has_header('Transfer-encoding'))
except OSError as err: # timeout error
raise URLError(err)
E urllib.error.URLError: <urlopen error [Errno 61] Connection refused>
/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py:1351: URLError =========================== short test summary info ============================ FAILED auction/operations_test.py::test_create - urllib.error.URLError: <urlo... FAILED auction/operations_test.py::test_setup - urllib.error.URLError: <urlop... FAILED auction/operations_test.py::test_first_bid_before_start - urllib.error... FAILED auction/operations_test.py::test_first_bid - urllib.error.URLError: <u... FAILED auction/operations_test.py::test_second_bid - urllib.error.URLError: <... FAILED auction/operations_test.py::test_close_before_start - urllib.error.URL... FAILED auction/operations_test.py::test_close_no_bids - urllib.error.URLError... FAILED auction/operations_test.py::test_close_reserve_not_met - urllib.error.... FAILED auction/operations_test.py::test_close_reserve_met - urllib.error.URLE... FAILED auction/testing/setup_test.py::test_getAlgodClient - urllib.error.URLE... FAILED auction/testing/setup_test.py::test_getKmdClient - urllib.error.URLErr... FAILED auction/testing/setup_test.py::test_getGenesisAccounts - urllib.error....
Also on forum: https://forum.algorand.org/t/urllib-error-urlerror-urlopen-error-errno-61-connection-refused/5236/3
Is sandbox
running as specified in https://developer.algorand.org/docs/get-started/dapps/pyteal/#install-sandbox?
If yes, can you show the output of ./sandbox up
?
see sandbox.log for detailed progress, or use -v.
I guess there is no kmd server in docker image.
It looks like your sandbox did not start properly.
You can see that because it does not display the algod version at the end.
You can also look at sandbox.log
and see the error at the end.
Most likely you are not using the latest version of sandbox.
Please try in the sandbox folder:
git pull
and then
./sandbox clean
./sandbox up nightly -v
If this does not work, please provide the content of sandbox.log
and of the above commands.
just wanted to say thank you, I had a similar error for hours on m1 macOS and this solved my issue.
Hello! Trying to follow the example project here: https://developer.algorand.org/docs/get-started/dapps/pyteal/
When I ran example.py (and pytest) I got the following issue. Any idea what might be happening? Thanks!