agimus-project / happypose

Toolbox and trackers for object pose-estimation. Based on the work CosyPose and MegaPose
https://agimus-project.github.io/happypose/
BSD 2-Clause "Simplified" License
22 stars 8 forks source link

download: improve error handling #131

Closed nim65s closed 4 months ago

nim65s commented 6 months ago

From CI issue in #130: https://github.com/agimus-project/happypose/actions/runs/7918837653/job/21618212085


Traceback (most recent call last):
  File "/home/runner/miniconda3/envs/happypose/lib/python3.9/site-packages/httpx/_transports/default.py", line 66, in map_httpcore_exceptions
    yield
  File "/home/runner/miniconda3/envs/happypose/lib/python3.9/site-packages/httpx/_transports/default.py", line 366, in handle_async_request
    resp = await self._pool.handle_async_request(req)
  File "/home/runner/miniconda3/envs/happypose/lib/python3.9/site-packages/httpcore/_async/connection_pool.py", line 216, in handle_async_request
    raise exc from None
  File "/home/runner/miniconda3/envs/happypose/lib/python3.9/site-packages/httpcore/_async/connection_pool.py", line 196, in handle_async_request
    response = await connection.handle_async_request(
  File "/home/runner/miniconda3/envs/happypose/lib/python3.9/site-packages/httpcore/_async/connection.py", line 101, in handle_async_request
    return await self._connection.handle_async_request(request)
  File "/home/runner/miniconda3/envs/happypose/lib/python3.9/site-packages/httpcore/_async/http11.py", line 132, in handle_async_request
    raise exc
  File "/home/runner/miniconda3/envs/happypose/lib/python3.9/site-packages/httpcore/_async/http11.py", line 110, in handle_async_request
    ) = await self._receive_response_headers(**kwargs)
  File "/home/runner/miniconda3/envs/happypose/lib/python3.9/site-packages/httpcore/_async/http11.py", line 175, in _receive_response_headers
    event = await self._receive_event(timeout=timeout)
  File "/home/runner/miniconda3/envs/happypose/lib/python3.9/site-packages/httpcore/_async/http11.py", line 225, in _receive_event
    raise RemoteProtocolError(msg)
httpcore.RemoteProtocolError: Server disconnected without sending a response.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/runner/miniconda3/envs/happypose/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/home/runner/miniconda3/envs/happypose/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/runner/work/happypose/happypose/happypose/toolbox/utils/download.py", line 474, in <module>
    asyncio.run(main())
  File "/home/runner/miniconda3/envs/happypose/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/home/runner/miniconda3/envs/happypose/lib/python3.9/asyncio/base_events.py", line 647, in run_until_complete
    return future.result()
  File "/home/runner/work/happypose/happypose/happypose/toolbox/utils/download.py", line 301, in main
    dl_client.create_task(dl_client.adownload(*args))
  File "/home/runner/work/happypose/happypose/happypose/toolbox/utils/download.py", line 326, in __aexit__
    await self.aclose()
  File "/home/runner/work/happypose/happypose/happypose/toolbox/utils/download.py", line 332, in aclose
    await asyncio.gather(*list(self.task_set))
  File "/home/runner/work/happypose/happypose/happypose/toolbox/utils/download.py", line 426, in download_file
    async with self.client.stream("GET", download_path) as r:
  File "/home/runner/miniconda3/envs/happypose/lib/python3.9/contextlib.py", line 181, in __aenter__
    return await self.gen.__anext__()
  File "/home/runner/miniconda3/envs/happypose/lib/python3.9/site-packages/httpx/_client.py", line 1573, in stream
    response = await self.send(
  File "/home/runner/miniconda3/envs/happypose/lib/python3.9/site-packages/httpx/_client.py", line 1617, in send
    response = await self._send_handling_auth(
  File "/home/runner/miniconda3/envs/happypose/lib/python3.9/site-packages/httpx/_client.py", line 1645, in _send_handling_auth
    response = await self._send_handling_redirects(
  File "/home/runner/miniconda3/envs/happypose/lib/python3.9/site-packages/httpx/_client.py", line 1682, in _send_handling_redirects
    response = await self._send_single_request(request)
  File "/home/runner/miniconda3/envs/happypose/lib/python3.9/site-packages/httpx/_client.py", line 1719, in _send_single_request
    response = await transport.handle_async_request(request)
  File "/home/runner/miniconda3/envs/happypose/lib/python3.9/site-packages/httpx/_transports/default.py", line 366, in handle_async_request
    resp = await self._pool.handle_async_request(req)
  File "/home/runner/miniconda3/envs/happypose/lib/python3.9/contextlib.py", line 137, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/home/runner/miniconda3/envs/happypose/lib/python3.9/site-packages/httpx/_transports/default.py", line 83, in map_httpcore_exceptions
    raise mapped_exc(message) from exc
httpx.RemoteProtocolError: Server disconnected without sending a response.
Error: Process completed with exit code 1.