OpenMined / courses

A place where our community can discuss OpenMined Courses, including posting questions, sharing feedback, or providing comments for discussion!

Home Page:http://courses.openmined.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Duet server not working from tutorial 1

VIGNESHinZONE opened this issue · comments

In first tutorial, the sy.launch_duet is giving a connection TimeoutError. Could you please update with the correct link?

My code-

duet = sy.launch_duet(network_url="http://ec2-18-216-8-163.us-east-2.compute.amazonaws.com:5000/")

notebook link - here

Error Message-

ConnectionError: HTTPConnectionPool(host='ec2-18-216-8-163.us-east-2.compute.amazonaws.com', port=5000): Max retries exceeded with url: //metadata (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f04988c9b20>: Failed to establish a new connection: [Errno 110] Connection timed out'))

Here is the full output error message -

🎤  🎸  ♪♪♪ Starting Duet ♫♫♫  🎻  🎹

♫♫♫ > DISCLAIMER: Duet is an experimental feature currently in beta.
♫♫♫ > Use at your own risk.


    > ❤️ Love Duet? Please consider supporting our community!
    > https://github.com/sponsors/OpenMined

♫♫♫ > Punching through firewall to OpenGrid Network Node at:
♫♫♫ > http://ec2-18-216-8-163.us-east-2.compute.amazonaws.com:5000/
♫♫♫ >
♫♫♫ > ...waiting for response from OpenGrid Network... 
---------------------------------------------------------------------------
TimeoutError                              Traceback (most recent call last)
~/miniconda3/envs/fed/lib/python3.9/site-packages/urllib3/connection.py in _new_conn(self)
    173         try:
--> 174             conn = connection.create_connection(
    175                 (self._dns_host, self.port), self.timeout, **extra_kw

~/miniconda3/envs/fed/lib/python3.9/site-packages/urllib3/util/connection.py in create_connection(address, timeout, source_address, socket_options)
     94     if err is not None:
---> 95         raise err
     96 

~/miniconda3/envs/fed/lib/python3.9/site-packages/urllib3/util/connection.py in create_connection(address, timeout, source_address, socket_options)
     84                 sock.bind(source_address)
---> 85             sock.connect(sa)
     86             return sock

TimeoutError: [Errno 110] Connection timed out

During handling of the above exception, another exception occurred:

NewConnectionError                        Traceback (most recent call last)
~/miniconda3/envs/fed/lib/python3.9/site-packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)
    702             # Make the request on the httplib connection object.
--> 703             httplib_response = self._make_request(
    704                 conn,

~/miniconda3/envs/fed/lib/python3.9/site-packages/urllib3/connectionpool.py in _make_request(self, conn, method, url, timeout, chunked, **httplib_request_kw)
    397             else:
--> 398                 conn.request(method, url, **httplib_request_kw)
    399 

~/miniconda3/envs/fed/lib/python3.9/site-packages/urllib3/connection.py in request(self, method, url, body, headers)
    238             headers["User-Agent"] = _get_default_user_agent()
--> 239         super(HTTPConnection, self).request(method, url, body=body, headers=headers)
    240 

~/miniconda3/envs/fed/lib/python3.9/http/client.py in request(self, method, url, body, headers, encode_chunked)
   1278         """Send a complete request to the server."""
-> 1279         self._send_request(method, url, body, headers, encode_chunked)
   1280 

~/miniconda3/envs/fed/lib/python3.9/http/client.py in _send_request(self, method, url, body, headers, encode_chunked)
   1324             body = _encode(body, 'body')
-> 1325         self.endheaders(body, encode_chunked=encode_chunked)
   1326 

~/miniconda3/envs/fed/lib/python3.9/http/client.py in endheaders(self, message_body, encode_chunked)
   1273             raise CannotSendHeader()
-> 1274         self._send_output(message_body, encode_chunked=encode_chunked)
   1275 

~/miniconda3/envs/fed/lib/python3.9/http/client.py in _send_output(self, message_body, encode_chunked)
   1033         del self._buffer[:]
-> 1034         self.send(msg)
   1035 

~/miniconda3/envs/fed/lib/python3.9/http/client.py in send(self, data)
    973             if self.auto_open:
--> 974                 self.connect()
    975             else:

~/miniconda3/envs/fed/lib/python3.9/site-packages/urllib3/connection.py in connect(self)
    204     def connect(self):
--> 205         conn = self._new_conn()
    206         self._prepare_conn(conn)

~/miniconda3/envs/fed/lib/python3.9/site-packages/urllib3/connection.py in _new_conn(self)
    185         except SocketError as e:
--> 186             raise NewConnectionError(
    187                 self, "Failed to establish a new connection: %s" % e

NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f04988c9b20>: Failed to establish a new connection: [Errno 110] Connection timed out

During handling of the above exception, another exception occurred:

MaxRetryError                             Traceback (most recent call last)
~/miniconda3/envs/fed/lib/python3.9/site-packages/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
    439             if not chunked:
--> 440                 resp = conn.urlopen(
    441                     method=request.method,

~/miniconda3/envs/fed/lib/python3.9/site-packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)
    784 
--> 785             retries = retries.increment(
    786                 method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]

~/miniconda3/envs/fed/lib/python3.9/site-packages/urllib3/util/retry.py in increment(self, method, url, response, error, _pool, _stacktrace)
    591         if new_retry.is_exhausted():
--> 592             raise MaxRetryError(_pool, url, error or ResponseError(cause))
    593 

MaxRetryError: HTTPConnectionPool(host='ec2-18-216-8-163.us-east-2.compute.amazonaws.com', port=5000): Max retries exceeded with url: //metadata (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f04988c9b20>: Failed to establish a new connection: [Errno 110] Connection timed out'))

During handling of the above exception, another exception occurred:

ConnectionError                           Traceback (most recent call last)
/tmp/ipykernel_40661/1517725941.py in <module>
----> 1 duet = sy.launch_duet(network_url="http://ec2-18-216-8-163.us-east-2.compute.amazonaws.com:5000/")

~/miniconda3/envs/fed/lib/python3.9/site-packages/syft/grid/duet/__init__.py in launch_duet(logging, network_url, loopback, credential_exchanger, db_path)
    204     info("♫♫♫ > ...waiting for response from OpenGrid Network... ", print=True)
    205 
--> 206     signaling_client = register(url=network_url)
    207 
    208     info("♫♫♫ > " + bcolors.OKGREEN + "DONE!" + bcolors.ENDC, print=True)

~/miniconda3/envs/fed/lib/python3.9/site-packages/syft/grid/duet/om_signaling_client.py in register(url)
     13 ) -> SignalingClient:
     14 
---> 15     client = SignalingClient(
     16         url=url, conn_type=HTTPConnection, client_type=NetworkClient
     17     )

~/miniconda3/envs/fed/lib/python3.9/site-packages/syft/grid/duet/signaling_client.py in __init__(self, url, conn_type, client_type)
     35             client_id,
     36         ) = client_type.deserialize_client_metadata_from_node(
---> 37             metadata=conn._get_metadata()
     38         )
     39 

~/miniconda3/envs/fed/lib/python3.9/site-packages/syft/grid/connections/http_connection.py in _get_metadata(self)
    108         :rtype: str of bytes
    109         """
--> 110         data: bytes = requests.get(self.base_url + "/metadata").content
    111         metadata_pb = Metadata_PB()
    112         metadata_pb.ParseFromString(data)

~/miniconda3/envs/fed/lib/python3.9/site-packages/requests/api.py in get(url, params, **kwargs)
     73     """
     74 
---> 75     return request('get', url, params=params, **kwargs)
     76 
     77 

~/miniconda3/envs/fed/lib/python3.9/site-packages/requests/api.py in request(method, url, **kwargs)
     59     # cases, and look like a memory leak in others.
     60     with sessions.Session() as session:
---> 61         return session.request(method=method, url=url, **kwargs)
     62 
     63 

~/miniconda3/envs/fed/lib/python3.9/site-packages/requests/sessions.py in request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)
    527         }
    528         send_kwargs.update(settings)
--> 529         resp = self.send(prep, **send_kwargs)
    530 
    531         return resp

~/miniconda3/envs/fed/lib/python3.9/site-packages/requests/sessions.py in send(self, request, **kwargs)
    643 
    644         # Send the request
--> 645         r = adapter.send(request, **kwargs)
    646 
    647         # Total elapsed time of the request (approximately)

~/miniconda3/envs/fed/lib/python3.9/site-packages/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
    517                 raise SSLError(e, request=request)
    518 
--> 519             raise ConnectionError(e, request=request)
    520 
    521         except ClosedPoolError as e:

ConnectionError: HTTPConnectionPool(host='ec2-18-216-8-163.us-east-2.compute.amazonaws.com', port=5000): Max retries exceeded with url: //metadata (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f04988c9b20>: Failed to establish a new connection: [Errno 110] Connection timed out'))

same issue here! any progress on this?

This was supposed to be fixed, so please test again without any custom network_url. Also please note that if you want support with the courses we have people who respond in less than 24 hours inside our slack.
https://slack.openmined.org/