Skip to content

Instantly share code, notes, and snippets.

@soulitzer
Created June 29, 2022 22:12
Show Gist options
  • Save soulitzer/67403836d28735e096267737af6d22d6 to your computer and use it in GitHub Desktop.
Save soulitzer/67403836d28735e096267737af6d22d6 to your computer and use it in GitHub Desktop.
[... slack complaining message is too long]
File ~/Users/jw3468/local/install/miniconda3/envs/pysyft/lib/python3.9/site-packages/urllib3/connectionpool.py:340, in HTTPConnectionPool._raise_timeout(self, err, url, timeout_value)
339 if isinstance(err, SocketTimeout):
--> 340 raise ReadTimeoutError(
341 self, url, "Read timed out. (read timeout=%s)" % timeout_value
342 )
344 # See the above comment about EAGAIN in Python 3. In Python 2 we have
345 # to specifically catch it and throw the timeout error
ReadTimeoutError: HTTPConnectionPool(host='localhost', port=8081): Read timed out. (read timeout=1)
During handling of the above exception, another exception occurred:
ReadTimeout Traceback (most recent call last)
Input In [3], in <cell line: 2>()
1 ndarray = np.array([[1., 2., 3.]], dtype=np.float64)
----> 2 a = numpy_to_tensor_pointer(ndarray)
Input In [2], in numpy_to_tensor_pointer(np_arr)
10 data_asset_name = str(uuid1())
11 owner.load_dataset(
12 assets={
13 data_asset_name: single_data_subject,
(...)
16 description="description"
17 )
---> 18 tensor_pointer = user.datasets[-1][data_asset_name]
19 assert isinstance(tensor_pointer, TensorWrappedPhiTensorPointer)
20 return tensor_pointer
File ~/local/PySyft/packages/syft/src/syft/core/node/common/client_manager/dataset_api.py:155, in DatasetRequestAPI.__getitem__(self, key)
150 def __getitem__(self, key: Union[str, int, slice]) -> Any:
151 # optionally we should be able to pass in the index of the dataset we want
152 # according to the order displayed when displayed as a pandas table
154 if isinstance(key, int):
--> 155 a = self.all()
156 d = a[key : key + 1] # noqa: E203
157 return Dataset(d, self.client, key=key, **a[key])
File ~/local/PySyft/packages/syft/src/syft/core/node/common/client_manager/dataset_api.py:135, in DatasetRequestAPI.all(self)
132 def all(self) -> List[Any]:
133 result = [
134 content
--> 135 for content in self.perform_api_request(
136 syft_msg=self._get_all_message, timeout=1
137 ).metadatas
138 ]
140 new_all = list()
141 for dataset in result:
File ~/local/PySyft/packages/syft/src/syft/core/node/common/client_manager/request_api.py:139, in RequestAPI.perform_api_request(self, syft_msg, content, timeout)
134 content[RequestAPIFields.REPLY_TO] = self.client.address
136 signed_msg = syft_msg_constructor(**content).sign(
137 signing_key=self.client.signing_key
138 ) # type: ignore
--> 139 response = self.client.send_immediate_msg_with_reply(
140 msg=signed_msg, timeout=timeout
141 )
142 if isinstance(response, ExceptionMessage):
143 raise response.exception_type
File ~/local/PySyft/packages/syft/src/syft/core/node/common/client.py:240, in Client.send_immediate_msg_with_reply(self, msg, timeout, route_index)
237 debug(output)
238 msg = msg.sign(signing_key=self.signing_key)
--> 240 response = self.routes[route_index].send_immediate_msg_with_reply(
241 msg=msg, timeout=timeout
242 )
243 if response.is_valid:
244 # check if we have an ExceptionMessage to trigger a local exception
245 # from a remote exception that we caused
246 if isinstance(response.message, ExceptionMessage):
File ~/local/PySyft/packages/syft/src/syft/core/io/route.py:189, in SoloRoute.send_immediate_msg_with_reply(self, msg, timeout)
186 def send_immediate_msg_with_reply(
187 self, msg: SignedImmediateSyftMessageWithReply, timeout: Optional[float] = None
188 ) -> SignedImmediateSyftMessageWithoutReply:
--> 189 return self.connection.send_immediate_msg_with_reply(msg=msg, timeout=timeout)
File ~/local/PySyft/packages/syft/src/syft/grid/connections/http_connection.py:49, in HTTPConnection.send_immediate_msg_with_reply(self, msg, timeout)
37 """
38 Sends high priority messages and wait for their responses.
39
(...)
44 :rtype: SignedImmediateSyftMessageWithoutReply
45 """
47 # Serializes SignedImmediateSyftMessageWithReply
48 # and send it using HTTP protocol
---> 49 response = self._send_msg(msg=msg, timeout=timeout)
51 # Deserialize node's response
52 if response.status_code == requests.codes.ok:
53 # Return SignedImmediateSyftMessageWithoutReply
File ~/local/PySyft/packages/syft/src/syft/grid/client/grid_connection.py:123, in GridHTTPConnection._send_msg(self, msg, timeout)
119 timeout = timeout if timeout is not None else DEFAULT_TIMEOUT
121 # if sys.getsizeof(msg_bytes) < GridHTTPConnection.SIZE_THRESHOLD:
122 # if True:
--> 123 r = requests.post(
124 url=str(self.base_url) + route,
125 data=msg_bytes,
126 headers=header,
127 verify=verify_tls(),
128 timeout=timeout,
129 proxies=HTTPConnection.proxies,
130 )
131 # else:
132 # r = self.send_streamed_messages(blob_message=msg_bytes)
133
134 # Return request's response object
135 # r.text provides the response body as a str
136 return r
File ~/Users/jw3468/local/install/miniconda3/envs/pysyft/lib/python3.9/site-packages/requests/api.py:117, in post(url, data, json, **kwargs)
105 def post(url, data=None, json=None, **kwargs):
106 r"""Sends a POST request.
107
108 :param url: URL for the new :class:`Request` object.
(...)
114 :rtype: requests.Response
115 """
--> 117 return request('post', url, data=data, json=json, **kwargs)
File ~/Users/jw3468/local/install/miniconda3/envs/pysyft/lib/python3.9/site-packages/requests/api.py:61, in request(method, url, **kwargs)
57 # By using the 'with' statement we are sure the session is closed, thus we
58 # avoid leaving sockets open which can trigger a ResourceWarning in some
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)
File ~/Users/jw3468/local/install/miniconda3/envs/pysyft/lib/python3.9/site-packages/requests/sessions.py:529, in Session.request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)
524 send_kwargs = {
525 'timeout': timeout,
526 'allow_redirects': allow_redirects,
527 }
528 send_kwargs.update(settings)
--> 529 resp = self.send(prep, **send_kwargs)
531 return resp
File ~/Users/jw3468/local/install/miniconda3/envs/pysyft/lib/python3.9/site-packages/requests/sessions.py:645, in Session.send(self, request, **kwargs)
642 start = preferred_clock()
644 # Send the request
--> 645 r = adapter.send(request, **kwargs)
647 # Total elapsed time of the request (approximately)
648 elapsed = preferred_clock() - start
File ~/Users/jw3468/local/install/miniconda3/envs/pysyft/lib/python3.9/site-packages/requests/adapters.py:532, in HTTPAdapter.send(self, request, stream, timeout, verify, cert, proxies)
530 raise SSLError(e, request=request)
531 elif isinstance(e, ReadTimeoutError):
--> 532 raise ReadTimeout(e, request=request)
533 elif isinstance(e, _InvalidHeader):
534 raise InvalidHeader(e, request=request)
ReadTimeout: HTTPConnectionPool(host='localhost', port=8081): Read timed out. (read timeout=1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment