<@ULVA73B9P> I have updated prefect from 2.14 to 2...
# ask-marvin
a
@Marvin I have updated prefect from 2.14 to 2.20 and I am getting this error when runing prefect docker image Deploying AWS BLOCKS prefect_2_test_default-1 | Traceback (most recent call last): prefect_2_test_default-1 | File "/.venv/lib/python3.12/site-packages/httpx/_transports/default.py", line 72, in map_httpcore_exceptions prefect_2_test_default-1 | yield prefect_2_test_default-1 | File "/.venv/lib/python3.12/site-packages/httpx/_transports/default.py", line 377, in handle_async_request prefect_2_test_default-1 | resp = await self._pool.handle_async_request(req) prefect_2_test_default-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ prefect_2_test_default-1 | File "/.venv/lib/python3.12/site-packages/httpcore/_async/connection_pool.py", line 216, in handle_async_request prefect_2_test_default-1 | raise exc from None prefect_2_test_default-1 | File "/.venv/lib/python3.12/site-packages/httpcore/_async/connection_pool.py", line 196, in handle_async_request prefect_2_test_default-1 | response = await connection.handle_async_request( prefect_2_test_default-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ prefect_2_test_default-1 | File "/.venv/lib/python3.12/site-packages/httpcore/_async/connection.py", line 99, in handle_async_request prefect_2_test_default-1 | raise exc prefect_2_test_default-1 | File "/.venv/lib/python3.12/site-packages/httpcore/_async/connection.py", line 76, in handle_async_request prefect_2_test_default-1 | stream = await self._connect(request) prefect_2_test_default-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ prefect_2_test_default-1 | File "/.venv/lib/python3.12/site-packages/httpcore/_async/connection.py", line 122, in _connect prefect_2_test_default-1 | stream = await self._network_backend.connect_tcp(**kwargs) prefect_2_test_default-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ prefect_2_test_default-1 | File "/.venv/lib/python3.12/site-packages/httpcore/_backends/auto.py", line 30, in connect_tcp prefect_2_test_default-1 | return await self._backend.connect_tcp( prefect_2_test_default-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ prefect_2_test_default-1 | File "/.venv/lib/python3.12/site-packages/httpcore/_backends/anyio.py", line 115, in connect_tcp prefect_2_test_default-1 | with map_exceptions(exc_map): prefect_2_test_default-1 | ^^^^^^^^^^^^^^^^^^^^^^^ prefect_2_test_default-1 | File "/usr/local/lib/python3.12/contextlib.py", line 158, in exit prefect_2_test_default-1 | self.gen.throw(value) prefect_2_test_default-1 | File "/.venv/lib/python3.12/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions prefect_2_test_default-1 | raise to_exc(exc) from exc prefect_2_test_default-1 | httpcore.ConnectError: All connection attempts failed prefect_2_test_default-1 | prefect_2_test_default-1 | The above exception was the direct cause of the following exception: prefect_2_test_default-1 | prefect_2_test_default-1 | Traceback (most recent call last): prefect_2_test_default-1 | File "/home/appuser/prefect_project/deployment.py", line 127, in <module> prefect_2_test_default-1 | main() prefect_2_test_default-1 | File "/home/appuser/prefect_project/deployment.py", line 12, in main prefect_2_test_default-1 | execute_log_statements(deploy_aws_blocks, "AWS BLOCKS") prefect_2_test_default-1 | File "/home/appuser/prefect_project/deployment.py", line 4, in execute_log_statements prefect_2_test_default-1 | func() prefect_2_test_default-1 | File "/home/appuser/prefect_project/blocks/aws_block.py", line 12, in deploy_blocks prefect_2_test_default-1 | ).save("aws-creds", overwrite=True) prefect_2_test_default-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ prefect_2_test_default-1 | File "/.venv/lib/python3.12/site-packages/prefect/utilities/asyncutils.py", line 311, in coroutine_wrapper prefect_2_test_default-1 | return call() prefect_2_test_default-1 | ^^^^^^ prefect_2_test_default-1 | File "/.venv/lib/python3.12/site-packages/prefect/_internal/concurrency/calls.py", line 432, in call prefect_2_test_default-1 | return self.result() prefect_2_test_default-1 | ^^^^^^^^^^^^^ prefect_2_test_default-1 | File "/.venv/lib/python3.12/site-packages/prefect/_internal/concurrency/calls.py", line 318, in result prefect_2_test_default-1 | return self.future.result(timeout=timeout) prefect_2_test_default-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ prefect_2_test_default-1 | File "/.venv/lib/python3.12/site-packages/prefect/_internal/concurrency/calls.py", line 179, in result prefect_2_test_default-1 | return self.__get_result() prefect_2_test_default-1 | ^^^^^^^^^^^^^^^^^^^ prefect_2_test_default-1 | File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result prefect_2_test_default-1 | raise self._exception prefect_2_test_default-1 | File "/.venv/lib/python3.12/site-packages/prefect/_internal/concurrency/calls.py", line 389, in _run_async prefect_2_test_default-1 | result = await coro prefect_2_test_default-1 | ^^^^^^^^^^ prefect_2_test_default-1 | File "/.venv/lib/python3.12/site-packages/prefect/events/instrument.py", line 62, in inner prefect_2_test_default-1 | raise exc prefect_2_test_default-1 | File "/.venv/lib/python3.12/site-packages/prefect/events/instrument.py", line 59, in inner prefect_2_test_default-1 | return await function(self, *args, **kwargs) prefect_2_test_default-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ prefect_2_test_default-1 | File "/.venv/lib/python3.12/site-packages/prefect/blocks/core.py", line 1022, in save prefect_2_test_default-1 | document_id = await self._save(name=name, overwrite=overwrite, client=client) prefect_2_test_default-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ prefect_2_test_default-1 | File "/.venv/lib/python3.12/site-packages/prefect/client/utilities.py", line 100, in with_injected_client prefect_2_test_default-1 | return await fn(*args, **kwargs) prefect_2_test_default-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^ prefect_2_test_default-1 | File "/.venv/lib/python3.12/site-packages/prefect/blocks/core.py", line 971, in _save prefect_2_test_default-1 | await self.register_type_and_schema(client=client) prefect_2_test_default-1 | File "/.venv/lib/python3.12/site-packages/prefect/client/utilities.py", line 100, in with_injected_client prefect_2_test_default-1 | return await fn(*args, **kwargs) prefect_2_test_default-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^ prefect_2_test_default-1 | File "/.venv/lib/python3.12/site-packages/prefect/blocks/core.py", line 906, in register_type_and_schema prefect_2_test_default-1 | block_type = await client.read_block_type_by_slug( prefect_2_test_default-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ prefect_2_test_default-1 | File "/.venv/lib/python3.12/site-packages/prefect/client/orchestration.py", line 1323, in read_block_type_by_slug prefect_2_test_default-1 | response = await self._client.get(f"/block_types/slug/{slug}") prefect_2_test_default-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ prefect_2_test_default-1 | File "/.venv/lib/python3.12/site-packages/httpx/_client.py", line 1814, in get prefect_2_test_default-1 | return await self.request( prefect_2_test_default-1 | ^^^^^^^^^^^^^^^^^^^ prefect_2_test_default-1 | File "/.venv/lib/python3.12/site-packages/httpx/_client.py", line 1585, in request prefect_2_test_default-1 | return await self.send(request, auth=auth, follow_redirects=follow_redirects) prefect_2_test_default-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ prefect_2_test_default-1 | File "/.venv/lib/python3.12/site-packages/prefect/client/base.py", line 327, in send prefect_2_test_default-1 | response = await self._send_with_retry( prefect_2_test_default-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ prefect_2_test_default-1 | File "/.venv/lib/python3.12/site-packages/prefect/client/base.py", line 251, in _send_with_retry prefect_2_test_default-1 | response = await send(request, *send_args, **send_kwargs) prefect_2_test_default-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ prefect_2_test_default-1 | File "/.venv/lib/python3.12/site-packages/httpx/_client.py", line 1674, in send prefect_2_test_default-1 | response = await self._send_handling_auth( prefect_2_test_default-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ prefect_2_test_default-1 | File "/.venv/lib/python3.12/site-packages/httpx/_client.py", line 1702, in _send_handling_auth prefect_2_test_default-1 | response = await self._send_handling_redirects( prefect_2_test_default-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ prefect_2_test_default-1 | File "/.venv/lib/python3.12/site-packages/httpx/_client.py", line 1739, in _send_handling_redirects prefect_2_test_default-1 | response = await self._send_single_request(request) prefect_2_test_default-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ prefect_2_test_default-1 | File "/.venv/lib/python3.12/site-packages/httpx/_client.py", line 1776, in _send_single_request prefect_2_test_default-1 | response = await transport.handle_async_request(request) prefect_2_test_default-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ prefect_2_test_default-1 | File "/.venv/lib/python3.12/site-packages/httpx/_transports/default.py", line 376, in handle_async_request prefect_2_test_default-1 | with map_httpcore_exceptions(): prefect_2_test_default-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^ prefect_2_test_default-1 | File "/usr/local/lib/python3.12/contextlib.py", line 158, in exit prefect_2_test_default-1 | self.gen.throw(value) prefect_2_test_default-1 | File "/.venv/lib/python3.12/site-packages/httpx/_transports/default.py", line 89, in map_httpcore_exceptions prefect_2_test_default-1 | raise mapped_exc(message) from exc prefect_2_test_default-1 | httpx.ConnectError: All connection attempts failed
m
Your message was too long by 2698 tokens - please shorten it and try again. For reference, here's your message at the allowed limit:
I have updated prefect from 2.14 to 2.20 and I am getting this error when runing prefect docker image
Deploying AWS BLOCKS prefect_2_test_default-1 | Traceback (most recent call last): prefect_2_test_default-1 | File "/.venv/lib/python3.12/site-packages/httpx/_transports/default.py", line 72, in map_httpcore_exceptions prefect_2_test_default-1 | yield prefect_2_test_default-1 | File "/.venv/lib/python3.12/site-packages/httpx/_transports/default.py", line 377, in handle_async_request prefect_2_test_default-1 | resp = await self._pool.handle_async_request(req) prefect_2_test_default-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ prefect_2_test_default-1 | File "/.venv/lib/python3.12/site-packages/httpcore/_async/connection_pool.py", line 216, in handle_async_request prefect_2_test_default-1 | raise exc from None prefect_2_test_default-1 | File "/.venv/lib/python3.12/site-packages/httpcore/_async/connection_pool.py", line 196, in handle_async_request prefect_2_test_default-1 |
a
@Marvin I have updated prefect from 2.14 to 2.20 and I am getting this error when runing prefect docker image Deploying AWS BLOCKS prefect_2_test_default-1 | Traceback (most recent call last): prefect_2_test_default-1 | File "/.venv/lib/python3.12/site-packages/httpx/_transports/default.py", line 72, in map_httpcore_exceptions prefect_2_test_default-1 | yield prefect_2_test_default-1 | File "/.venv/lib/python3.12/site-packages/httpx/_transports/default.py", line 377, in handle_async_request prefect_2_test_default-1 | resp = await self._pool.handle_async_request(req)
m
The error you're facing seems to be related to network requests within the Prefect Docker environment, possibly due to an exception handling issue in the
httpx
library. Here are a couple of potential avenues to explore: 1. HTTPX Configuration: The error trace you provided, stemming from
httpx._transports.default.py
, hints that it might be related to how HTTPX is managing network requests. You might want to look into HTTPX documentation for details on configuring timeout values, retries, and exception handling to see if an adjustment could resolve the issue. 2. Prefect Version 2.20.9 Issues: There is a GitHub issue related to Prefect 2.20.9 where users experienced
httpx.ConnectTimeout
errors. Though it was in a different context (related to
prefect cloud login
), it suggests there might be underlying network communication challenges with Prefect at this version. To troubleshoot further: - Check Your Network Configuration: Ensure that the Docker container has the necessary network permissions and settings to access any required external resources. - Increase Timeout and Retry: Consider increasing the timeout and retry settings for HTTP requests if these are part of your flow. If none of these suggestions seem to apply or solve your issue, I recommend creating a minimal reproducible example and reaching out on the Prefect Discourse forum or by posting a detailed issue on GitHub with the trace and relevant details about your environment and setup.