https://prefect.io logo
Title
d

Deceivious

08/19/2022, 2:18 PM
Hi all, Unsure if this is a common issue or a configuration issue on my side. Getting the following issue:
ValueError: 'api.prefect.cloud' does not appear to be an IPv4 or IPv6 address
Complete error log in comment.
16:11:39.345 | INFO    | prefect.agent - Submitting flow run '71a37b9d-890a-4483-bd18-20f71dba14b6'
/home/dcvs/source_code/pref2/.venv/lib/python3.9/site-packages/prefect/agent.py:183: UserWarning: Block document has schema checksum sha256:cc5fd7bf7e129ced2bf2b25cb0fac04e0c0596464bb5a001c699ddf43d05f752 which does not match the schema checksum for class 'DockerContainer'. This indicates the schema has changed and this block may not load.
  infrastructure_block = Block._from_block_document(infra_document)
16:11:39.998 | INFO    | prefect.infrastructure.docker-container - Creating Docker container 'spiked-beagle'...
16:11:40.310 | INFO    | prefect.agent - Completed submission of flow run '71a37b9d-890a-4483-bd18-20f71dba14b6'
16:11:40.323 | INFO    | prefect.infrastructure.docker-container - Docker container 'spiked-beagle' has status 'running'
14:11:53.561 | ERROR   | prefect.engine - Engine execution of flow run '71a37b9d-890a-4483-bd18-20f71dba14b6' exited with unexpected exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/anyio/_core/_sockets.py", line 186, in connect_tcp
    addr_obj = ip_address(remote_host)
  File "/usr/local/lib/python3.10/ipaddress.py", line 54, in ip_address
    raise ValueError(f'{address!r} does not appear to be an IPv4 or IPv6 address')
ValueError: 'api.prefect.cloud' does not appear to be an IPv4 or IPv6 address

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/httpcore/_exceptions.py", line 8, in map_exceptions
    yield
  File "/usr/local/lib/python3.10/site-packages/httpcore/backends/asyncio.py", line 109, in connect_tcp
    stream: anyio.abc.ByteStream = await anyio.connect_tcp(
  File "/usr/local/lib/python3.10/site-packages/anyio/_core/_sockets.py", line 189, in connect_tcp
    gai_res = await getaddrinfo(
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.10/socket.py", line 955, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -3] Temporary failure in name resolution

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/httpx/_transports/default.py", line 60, in map_httpcore_exceptions
    yield
  File "/usr/local/lib/python3.10/site-packages/httpx/_transports/default.py", line 353, in handle_async_request
    resp = await self._pool.handle_async_request(req)
  File "/usr/local/lib/python3.10/site-packages/httpcore/_async/connection_pool.py", line 253, in handle_async_request
    raise exc
  File "/usr/local/lib/python3.10/site-packages/httpcore/_async/connection_pool.py", line 237, in handle_async_request
    response = await connection.handle_async_request(request)
  File "/usr/local/lib/python3.10/site-packages/httpcore/_async/connection.py", line 86, in handle_async_request
    raise exc
  File "/usr/local/lib/python3.10/site-packages/httpcore/_async/connection.py", line 63, in handle_async_request
    stream = await self._connect(request)
  File "/usr/local/lib/python3.10/site-packages/httpcore/_async/connection.py", line 111, in _connect
    stream = await self._network_backend.connect_tcp(**kwargs)
  File "/usr/local/lib/python3.10/site-packages/httpcore/backends/auto.py", line 29, in connect_tcp
    return await self._backend.connect_tcp(
  File "/usr/local/lib/python3.10/site-packages/httpcore/backends/asyncio.py", line 107, in connect_tcp
    with map_exceptions(exc_map):
  File "/usr/local/lib/python3.10/contextlib.py", line 153, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/usr/local/lib/python3.10/site-packages/httpcore/_exceptions.py", line 12, in map_exceptions
    raise to_exc(exc)
httpcore.ConnectError: [Errno -3] Temporary failure in name resolution

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

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/prefect/engine.py", line 1316, in <module>
    enter_flow_run_engine_from_subprocess(flow_run_id)
  File "/usr/local/lib/python3.10/site-packages/prefect/engine.py", line 172, in enter_flow_run_engine_from_subprocess
    return anyio.run(retrieve_flow_then_begin_flow_run, flow_run_id)
  File "/usr/local/lib/python3.10/site-packages/anyio/_core/_eventloop.py", line 70, in run
    return asynclib.run(func, *args, **backend_options)
  File "/usr/local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 292, in run
    return native_run(wrapper(), debug=debug)
  File "/usr/local/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete
    return future.result()
  File "/usr/local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 287, in wrapper
    return await func(*args)
  File "/usr/local/lib/python3.10/site-packages/prefect/client.py", line 104, in with_injected_client
    return await fn(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/prefect/engine.py", line 244, in retrieve_flow_then_begin_flow_run
    flow_run = await client.read_flow_run(flow_run_id)
  File "/usr/local/lib/python3.10/site-packages/prefect/client.py", line 1477, in read_flow_run
    response = await self._client.get(f"/flow_runs/{flow_run_id}")
  File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 1751, in get
    return await self.request(
  File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 1527, in request
    return await self.send(request, auth=auth, follow_redirects=follow_redirects)
  File "/usr/local/lib/python3.10/site-packages/prefect/client.py", line 258, in send
    await super().send(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 1614, in send
    response = await self._send_handling_auth(
  File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 1642, in _send_handling_auth
    response = await self._send_handling_redirects(
  File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 1679, in _send_handling_redirects
    response = await self._send_single_request(request)
  File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 1716, in _send_single_request
    response = await transport.handle_async_request(request)
  File "/usr/local/lib/python3.10/site-packages/httpx/_transports/default.py", line 352, in handle_async_request
    with map_httpcore_exceptions():
  File "/usr/local/lib/python3.10/contextlib.py", line 153, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/usr/local/lib/python3.10/site-packages/httpx/_transports/default.py", line 77, in map_httpcore_exceptions
    raise mapped_exc(message) from exc
httpx.ConnectError: [Errno -3] Temporary failure in name resolution
16:11:53.929 | INFO    | prefect.infrastructure.docker-container - Docker container 'spiked-beagle' has status 'exited'
^C
Aborted.
I am running the flow on a infrastructure on docker container [ docker hosted on dockerhub ]. But I think the issue starts even before attempting to communicate with dockerhub.
k

Khuyen Tran

08/19/2022, 2:45 PM
Are you using Cloud 2?
d

Deceivious

08/19/2022, 2:53 PM
2.1.1
k

Khuyen Tran

08/19/2022, 2:55 PM
Just to make sure I’m on the same page, you got this error when running
prefect agent start
right?
d

Deceivious

08/19/2022, 3:02 PM
No
After i run a flow
k

Khuyen Tran

08/19/2022, 3:19 PM
you mean running
python path-to-your-flow
?
n

Nate

08/19/2022, 3:21 PM
@Deceivious did you register your own version of the DockerContainer infra block?
d

Deceivious

08/19/2022, 3:34 PM
yes - the dockerfile content is
FROM prefecthq/prefect:2-latest
RUN python -m pip install adlfs
n

Nate

08/19/2022, 3:40 PM
what I mean to ask, is somewhere in your project did you do
from prefect.blocks.core import Block

class DockerContainer(Block):
   # custom implementation
and then
prefect block register -m your_module_where_block_definition_is
because looking at this
UserWarning: Block document has schema checksum sha256:cc5fd7bf7e129ced2bf2b25cb0fac04e0c0596464bb5a001c699ddf43d05f752 which does not match the schema checksum for class 'DockerContainer'. This indicates the schema has changed and this block may not load.
it looks like the block definition for
DockerContainer
is invalid
d

Deceivious

08/19/2022, 3:59 PM
Let me check 🫡