Replies: 5 comments 4 replies
-
Hi @TheJeran -- sorry you're having issues with the API. That error doesn't seem to correspond to any known service issues. Could you share the search that you constructed which then fails on the |
Beta Was this translation helpful? Give feedback.
-
I received a similar message this morning when requesting a Here is a screenshot of the message I received: |
Beta Was this translation helpful? Give feedback.
-
This showed up in our integration tests yesterday, which are run on the Hub ConnectionError Traceback (most recent call last)Input In [3], in ()
----> 1 signed_asset = planetary_computer.sign(raster_item.assets["soc0_20"])
2 data = (
3 rioxarray.open_rasterio(signed_asset.href)
4 .squeeze()
(...)
7 .mean()
8 )
10 print(raster_item.assets["soc0_20"].description)
File /srv/conda/envs/notebook/lib/python3.8/functools.py:875, in singledispatch.<locals>.wrapper(*args, **kw)
871 if not args:
872 raise TypeError(f'{funcname} requires at least '
873 '1 positional argument')
--> 875 return dispatch(args[0].__class__)(*args, **kw)
File /srv/conda/envs/notebook/lib/python3.8/site-packages/planetary_computer/sas.py:204, in sign_asset(asset)
193 @sign.register(Asset)
194 def sign_asset(asset: Asset) -> Asset:
195 """Sign a PySTAC asset
196
197 Args:
(...)
202 signed version.
203 """
--> 204 return _sign_asset_in_place(asset.clone())
File /srv/conda/envs/notebook/lib/python3.8/site-packages/planetary_computer/sas.py:217, in _sign_asset_in_place(asset)
207 def _sign_asset_in_place(asset: Asset) -> Asset:
208 """Sign a PySTAC asset
209
210 Args:
(...)
215 with a signed version.
216 """
--> 217 asset.href = sign(asset.href)
218 if is_fsspec_asset(asset):
219 key: Optional[str]
File /srv/conda/envs/notebook/lib/python3.8/functools.py:875, in singledispatch.<locals>.wrapper(*args, **kw)
871 if not args:
872 raise TypeError(f'{funcname} requires at least '
873 '1 positional argument')
--> 875 return dispatch(args[0].__class__)(*args, **kw)
File /srv/conda/envs/notebook/lib/python3.8/site-packages/planetary_computer/sas.py:108, in sign_string(url)
106 return sign_vrt_string(url)
107 else:
--> 108 return sign_url(url)
File /srv/conda/envs/notebook/lib/python3.8/site-packages/planetary_computer/sas.py:130, in sign_url(url)
127 return url
129 account, container = parse_blob_url(parsed_url)
--> 130 token = get_token(account, container)
131 return token.sign(url).href
File /srv/conda/envs/notebook/lib/python3.8/site-packages/planetary_computer/sas.py:352, in get_token(account_name, container_name)
346 if not token or token.ttl() < 60:
347 headers = (
348 {"Ocp-Apim-Subscription-Key": settings.subscription_key}
349 if settings.subscription_key
350 else None
351 )
--> 352 response = requests.get(token_request_url, headers=headers)
353 response.raise_for_status()
354 token = SASToken(**response.json())
File /srv/conda/envs/notebook/lib/python3.8/site-packages/requests/api.py:75, in get(url, params, **kwargs)
64 def get(url, params=None, **kwargs):
65 r"""Sends a GET request.
66
67 :param url: URL for the new :class:`Request` object.
(...)
72 :rtype: requests.Response
73 """
---> 75 return request('get', url, params=params, **kwargs)
File /srv/conda/envs/notebook/lib/python3.8/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 /srv/conda/envs/notebook/lib/python3.8/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 /srv/conda/envs/notebook/lib/python3.8/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 /srv/conda/envs/notebook/lib/python3.8/site-packages/requests/adapters.py:501, in HTTPAdapter.send(self, request, stream, timeout, verify, cert, proxies)
498 raise
500 except (ProtocolError, socket.error) as err:
--> 501 raise ConnectionError(err, request=request)
503 except MaxRetryError as e:
504 if isinstance(e.reason, ConnectTimeoutError):
505 # TODO: Remove this in 3.0.0: see #2811
ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) The cause is an HTTP request to the SAS endpoint from the Hub. |
Beta Was this translation helpful? Give feedback.
-
I have received a similar error as above, but in a new context and it looks slightly different. I am unsure if this is related to the above, as it looks like it could also be an issue with my details---------------------------------------------------------------------------
URLError Traceback (most recent call last)
File <timed exec>:161, in <module>
File /srv/conda/envs/notebook/lib/python3.8/site-packages/torch/utils/data/dataloader.py:521, in _BaseDataLoaderIter.__next__(self)
519 if self._sampler_iter is None:
520 self._reset()
--> 521 data = self._next_data()
522 self._num_yielded += 1
523 if self._dataset_kind == _DatasetKind.Iterable and \
524 self._IterableDataset_len_called is not None and \
525 self._num_yielded > self._IterableDataset_len_called:
File /srv/conda/envs/notebook/lib/python3.8/site-packages/torch/utils/data/dataloader.py:1183, in _MultiProcessingDataLoaderIter._next_data(self)
1181 if len(self._task_info[self._rcvd_idx]) == 2:
1182 data = self._task_info.pop(self._rcvd_idx)[1]
-> 1183 return self._process_data(data)
1185 assert not self._shutdown and self._tasks_outstanding > 0
1186 idx, data = self._get_data()
File /srv/conda/envs/notebook/lib/python3.8/site-packages/torch/utils/data/dataloader.py:1229, in _MultiProcessingDataLoaderIter._process_data(self, data)
1227 self._try_put_index()
1228 if isinstance(data, ExceptionWrapper):
-> 1229 data.reraise()
1230 return data
File /srv/conda/envs/notebook/lib/python3.8/site-packages/torch/_utils.py:434, in ExceptionWrapper.reraise(self)
430 except TypeError:
431 # If the exception takes multiple arguments, don't try to
432 # instantiate since we don't know how to
433 raise RuntimeError(msg) from None
--> 434 raise exception
URLError: <urlopen error Caught URLError in DataLoader worker process 3.
Original Traceback (most recent call last):
File "/srv/conda/envs/notebook/lib/python3.8/urllib/request.py", line 1354, in do_open
h.request(req.get_method(), req.selector, req.data, headers,
File "/srv/conda/envs/notebook/lib/python3.8/http/client.py", line 1256, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/srv/conda/envs/notebook/lib/python3.8/http/client.py", line 1302, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/srv/conda/envs/notebook/lib/python3.8/http/client.py", line 1251, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/srv/conda/envs/notebook/lib/python3.8/http/client.py", line 1011, in _send_output
self.send(msg)
File "/srv/conda/envs/notebook/lib/python3.8/http/client.py", line 951, in send
self.connect()
File "/srv/conda/envs/notebook/lib/python3.8/http/client.py", line 1425, in connect
self.sock = self._context.wrap_socket(self.sock,
File "/srv/conda/envs/notebook/lib/python3.8/ssl.py", line 500, in wrap_socket
return self.sslsocket_class._create(
File "/srv/conda/envs/notebook/lib/python3.8/ssl.py", line 1040, in _create
self.do_handshake()
File "/srv/conda/envs/notebook/lib/python3.8/ssl.py", line 1309, in do_handshake
self._sslobj.do_handshake()
ConnectionResetError: [Errno 104] Connection reset by peer
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/srv/conda/envs/notebook/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 287, in _worker_loop
data = fetcher.fetch(index)
File "/srv/conda/envs/notebook/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 49, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/srv/conda/envs/notebook/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 49, in <listcomp>
data = [self.dataset[idx] for idx in possibly_batched_index]
File "<timed exec>", line 126, in __getitem__
File "/srv/conda/envs/notebook/lib/python3.8/site-packages/stackstac/stack.py", line 270, in stack
plain_items = items_to_plain(items)
File "/srv/conda/envs/notebook/lib/python3.8/site-packages/stackstac/stac_types.py", line 162, in items_to_plain
return [items.to_dict()]
File "/srv/conda/envs/notebook/lib/python3.8/site-packages/pystac/item.py", line 308, in to_dict
"links": [link.to_dict(transform_href=transform_hrefs) for link in links],
File "/srv/conda/envs/notebook/lib/python3.8/site-packages/pystac/item.py", line 308, in <listcomp>
"links": [link.to_dict(transform_href=transform_hrefs) for link in links],
File "/srv/conda/envs/notebook/lib/python3.8/site-packages/pystac/link.py", line 334, in to_dict
"href": self.get_href(transform_href=transform_href),
File "/srv/conda/envs/notebook/lib/python3.8/site-packages/pystac/link.py", line 159, in get_href
and self.owner.get_root()
File "/srv/conda/envs/notebook/lib/python3.8/site-packages/pystac/stac_object.py", line 198, in get_root
root_link.resolve_stac_object()
File "/srv/conda/envs/notebook/lib/python3.8/site-packages/pystac/link.py", line 293, in resolve_stac_object
obj = stac_io.read_stac_object(target_href, root=root)
File "/srv/conda/envs/notebook/lib/python3.8/site-packages/pystac/stac_io.py", line 226, in read_stac_object
d = self.read_json(source, *args, **kwargs)
File "/srv/conda/envs/notebook/lib/python3.8/site-packages/pystac/stac_io.py", line 197, in read_json
txt = self.read_text(source, *args, **kwargs)
File "/srv/conda/envs/notebook/lib/python3.8/site-packages/pystac/stac_io.py", line 279, in read_text
return self.read_text_from_href(href)
File "/srv/conda/envs/notebook/lib/python3.8/site-packages/pystac/stac_io.py", line 296, in read_text_from_href
with urlopen(href) as f:
File "/srv/conda/envs/notebook/lib/python3.8/urllib/request.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "/srv/conda/envs/notebook/lib/python3.8/urllib/request.py", line 525, in open
response = self._open(req, data)
File "/srv/conda/envs/notebook/lib/python3.8/urllib/request.py", line 542, in _open
result = self._call_chain(self.handle_open, protocol, protocol +
File "/srv/conda/envs/notebook/lib/python3.8/urllib/request.py", line 502, in _call_chain
result = func(*args)
File "/srv/conda/envs/notebook/lib/python3.8/urllib/request.py", line 1397, in https_open
return self.do_open(http.client.HTTPSConnection, req,
File "/srv/conda/envs/notebook/lib/python3.8/urllib/request.py", line 1357, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [Errno 104] Connection reset by peer>
> |
Beta Was this translation helpful? Give feedback.
-
Here is a new and similar error message. This time I reduced my number of workers to 0 to see if the problem I have been having is in my DataLoader. details---------------------------------------------------------------------------
ConnectionResetError Traceback (most recent call last)
File <timed exec>:188, in <module>
File /srv/conda/envs/notebook/lib/python3.8/site-packages/torch/utils/data/dataloader.py:521, in _BaseDataLoaderIter.__next__(self)
519 if self._sampler_iter is None:
520 self._reset()
--> 521 data = self._next_data()
522 self._num_yielded += 1
523 if self._dataset_kind == _DatasetKind.Iterable and \
524 self._IterableDataset_len_called is not None and \
525 self._num_yielded > self._IterableDataset_len_called:
File /srv/conda/envs/notebook/lib/python3.8/site-packages/torch/utils/data/dataloader.py:561, in _SingleProcessDataLoaderIter._next_data(self)
559 def _next_data(self):
560 index = self._next_index() # may raise StopIteration
--> 561 data = self._dataset_fetcher.fetch(index) # may raise StopIteration
562 if self._pin_memory:
563 data = _utils.pin_memory.pin_memory(data)
File /srv/conda/envs/notebook/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py:49, in _MapDatasetFetcher.fetch(self, possibly_batched_index)
47 def fetch(self, possibly_batched_index):
48 if self.auto_collation:
---> 49 data = [self.dataset[idx] for idx in possibly_batched_index]
50 else:
51 data = self.dataset[possibly_batched_index]
File /srv/conda/envs/notebook/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py:49, in <listcomp>(.0)
47 def fetch(self, possibly_batched_index):
48 if self.auto_collation:
---> 49 data = [self.dataset[idx] for idx in possibly_batched_index]
50 else:
51 data = self.dataset[possibly_batched_index]
File <timed exec>:141, in __getitem__(self, idx)
File /srv/conda/envs/notebook/lib/python3.8/site-packages/stackstac/stack.py:270, in stack(items, assets, epsg, resolution, bounds, bounds_latlon, snap_bounds, resampling, chunksize, dtype, fill_value, rescale, sortby_date, xy_coords, properties, band_coords, gdal_env, errors_as_nodata, reader)
20 def stack(
21 items: Union[ItemCollectionIsh, ItemIsh],
22 assets: Optional[Union[List[str], AbstractSet[str]]] = frozenset(
(...)
43 reader: Type[Reader] = AutoParallelRioReader,
44 ) -> xr.DataArray:
45 """
46 Create an `xarray.DataArray` of all the STAC items, reprojected to the same grid and stacked by time.
47
(...)
268 automatically computed from the items you pass in.
269 """
--> 270 plain_items = items_to_plain(items)
272 if sortby_date is not False:
273 plain_items = sorted(
274 plain_items,
275 key=lambda item: item["properties"].get("datetime", "") or "",
276 reverse=sortby_date == "desc",
277 )
File /srv/conda/envs/notebook/lib/python3.8/site-packages/stackstac/stac_types.py:162, in items_to_plain(items)
158 return [items._data]
160 if isinstance(items, PystacItem):
161 # TODO this is wasteful.
--> 162 return [items.to_dict()]
164 if isinstance(items, SatstacItemCollection):
165 return [item._data for item in items]
File /srv/conda/envs/notebook/lib/python3.8/site-packages/pystac/item.py:308, in Item.to_dict(self, include_self_link, transform_hrefs)
299 else:
300 self.properties["datetime"] = None
302 d: Dict[str, Any] = {
303 "type": "Feature",
304 "stac_version": pystac.get_stac_version(),
305 "id": self.id,
306 "properties": self.properties,
307 "geometry": self.geometry,
--> 308 "links": [link.to_dict(transform_href=transform_hrefs) for link in links],
309 "assets": assets,
310 }
312 if self.bbox is not None:
313 d["bbox"] = self.bbox
File /srv/conda/envs/notebook/lib/python3.8/site-packages/pystac/item.py:308, in <listcomp>(.0)
299 else:
300 self.properties["datetime"] = None
302 d: Dict[str, Any] = {
303 "type": "Feature",
304 "stac_version": pystac.get_stac_version(),
305 "id": self.id,
306 "properties": self.properties,
307 "geometry": self.geometry,
--> 308 "links": [link.to_dict(transform_href=transform_hrefs) for link in links],
309 "assets": assets,
310 }
312 if self.bbox is not None:
313 d["bbox"] = self.bbox
File /srv/conda/envs/notebook/lib/python3.8/site-packages/pystac/link.py:334, in Link.to_dict(self, transform_href)
320 def to_dict(self, transform_href: bool = True) -> Dict[str, Any]:
321 """Generate a dictionary representing the JSON of this serialized Link.
322
323 Returns:
(...)
329 if this is a hierarchical link relation.
330 """
332 d: Dict[str, Any] = {
333 "rel": self.rel,
--> 334 "href": self.get_href(transform_href=transform_href),
335 }
337 if self.media_type is not None:
338 d["type"] = self.media_type
File /srv/conda/envs/notebook/lib/python3.8/site-packages/pystac/link.py:159, in Link.get_href(self, transform_href)
151 else:
152 href = self._target_href
154 if (
155 transform_href
156 and href
157 and is_absolute_href(href)
158 and self.owner
--> 159 and self.owner.get_root()
160 ):
161 root = self.owner.get_root()
162 rel_links = [
163 *HIERARCHICAL_LINKS,
164 *pystac.EXTENSION_HOOKS.get_extended_object_links(self.owner),
165 ]
File /srv/conda/envs/notebook/lib/python3.8/site-packages/pystac/stac_object.py:198, in STACObject.get_root(self)
196 if root_link:
197 if not root_link.is_resolved():
--> 198 root_link.resolve_stac_object()
199 # Use set_root, so Catalogs can merge ResolvedObjectCache instances.
200 self.set_root(cast(pystac.Catalog, root_link.target))
File /srv/conda/envs/notebook/lib/python3.8/site-packages/pystac/link.py:293, in Link.resolve_stac_object(self, root)
290 if stac_io is None:
291 stac_io = pystac.StacIO.default()
--> 293 obj = stac_io.read_stac_object(target_href, root=root)
294 obj.set_self_href(target_href)
295 if root is not None:
File /srv/conda/envs/notebook/lib/python3.8/site-packages/pystac/stac_io.py:226, in StacIO.read_stac_object(self, source, root, *args, **kwargs)
200 def read_stac_object(
201 self,
202 source: Union[str, "Link_Type"],
(...)
205 **kwargs: Any,
206 ) -> "STACObject_Type":
207 """Read a STACObject from a JSON file at the given source.
208
209 See :func:`StacIO.read_text <pystac.StacIO.read_text>` for usage of
(...)
224 contained in the file at the given uri.
225 """
--> 226 d = self.read_json(source, *args, **kwargs)
227 href = source if isinstance(source, str) else source.get_absolute_href()
228 return self.stac_object_from_dict(d, href=href, root=root, preserve_dict=False)
File /srv/conda/envs/notebook/lib/python3.8/site-packages/pystac/stac_io.py:197, in StacIO.read_json(self, source, *args, **kwargs)
178 def read_json(
179 self, source: Union[str, "Link_Type"], *args: Any, **kwargs: Any
180 ) -> Dict[str, Any]:
181 """Read a dict from the given source.
182
183 See :func:`StacIO.read_text <pystac.StacIO.read_text>` for usage of
(...)
195 given source.
196 """
--> 197 txt = self.read_text(source, *args, **kwargs)
198 return self.json_loads(txt)
File /srv/conda/envs/notebook/lib/python3.8/site-packages/pystac/stac_io.py:279, in DefaultStacIO.read_text(self, source, *_, **__)
277 if href is None:
278 raise IOError(f"Could not get an absolute HREF from link {source}")
--> 279 return self.read_text_from_href(href)
File /srv/conda/envs/notebook/lib/python3.8/site-packages/pystac/stac_io.py:296, in DefaultStacIO.read_text_from_href(self, href)
294 if parsed.scheme != "":
295 try:
--> 296 with urlopen(href) as f:
297 href_contents = f.read().decode("utf-8")
298 except HTTPError as e:
File /srv/conda/envs/notebook/lib/python3.8/urllib/request.py:222, in urlopen(url, data, timeout, cafile, capath, cadefault, context)
220 else:
221 opener = _opener
--> 222 return opener.open(url, data, timeout)
File /srv/conda/envs/notebook/lib/python3.8/urllib/request.py:525, in OpenerDirector.open(self, fullurl, data, timeout)
522 req = meth(req)
524 sys.audit('urllib.Request', req.full_url, req.data, req.headers, req.get_method())
--> 525 response = self._open(req, data)
527 # post-process response
528 meth_name = protocol+"_response"
File /srv/conda/envs/notebook/lib/python3.8/urllib/request.py:542, in OpenerDirector._open(self, req, data)
539 return result
541 protocol = req.type
--> 542 result = self._call_chain(self.handle_open, protocol, protocol +
543 '_open', req)
544 if result:
545 return result
File /srv/conda/envs/notebook/lib/python3.8/urllib/request.py:502, in OpenerDirector._call_chain(self, chain, kind, meth_name, *args)
500 for handler in handlers:
501 func = getattr(handler, meth_name)
--> 502 result = func(*args)
503 if result is not None:
504 return result
File /srv/conda/envs/notebook/lib/python3.8/urllib/request.py:1397, in HTTPSHandler.https_open(self, req)
1396 def https_open(self, req):
-> 1397 return self.do_open(http.client.HTTPSConnection, req,
1398 context=self._context, check_hostname=self._check_hostname)
File /srv/conda/envs/notebook/lib/python3.8/urllib/request.py:1358, in AbstractHTTPHandler.do_open(self, http_class, req, **http_conn_args)
1356 except OSError as err: # timeout error
1357 raise URLError(err)
-> 1358 r = h.getresponse()
1359 except:
1360 h.close()
File /srv/conda/envs/notebook/lib/python3.8/http/client.py:1348, in HTTPConnection.getresponse(self)
1346 try:
1347 try:
-> 1348 response.begin()
1349 except ConnectionError:
1350 self.close()
File /srv/conda/envs/notebook/lib/python3.8/http/client.py:316, in HTTPResponse.begin(self)
314 # read until we get a non-100 response
315 while True:
--> 316 version, status, reason = self._read_status()
317 if status != CONTINUE:
318 break
File /srv/conda/envs/notebook/lib/python3.8/http/client.py:277, in HTTPResponse._read_status(self)
276 def _read_status(self):
--> 277 line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
278 if len(line) > _MAXLINE:
279 raise LineTooLong("status line")
File /srv/conda/envs/notebook/lib/python3.8/socket.py:669, in SocketIO.readinto(self, b)
667 while True:
668 try:
--> 669 return self._sock.recv_into(b)
670 except timeout:
671 self._timeout_occurred = True
File /srv/conda/envs/notebook/lib/python3.8/ssl.py:1241, in SSLSocket.recv_into(self, buffer, nbytes, flags)
1237 if flags != 0:
1238 raise ValueError(
1239 "non-zero flags not allowed in calls to recv_into() on %s" %
1240 self.__class__)
-> 1241 return self.read(nbytes, buffer)
1242 else:
1243 return super().recv_into(buffer, nbytes, flags)
File /srv/conda/envs/notebook/lib/python3.8/ssl.py:1099, in SSLSocket.read(self, len, buffer)
1097 try:
1098 if buffer is not None:
-> 1099 return self._sslobj.read(len, buffer)
1100 else:
1101 return self._sslobj.read(len)
ConnectionResetError: [Errno 104] Connection reset by peer
|
Beta Was this translation helpful? Give feedback.
-
I'm having a lot of issues with signing URLs and or simply retrieving catalogs. I believe it's a service issue but I'm unsure.
search.get_all_items()
spits out ~200 line error culminating in
APIError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
Anyway to check if this is user error or a server thing?
Beta Was this translation helpful? Give feedback.
All reactions