Hmm... in some cases prefect works fine with my do...
# prefect-community
a
Hmm... in some cases prefect works fine with my domain name as the PREFECT_API_URL and in other cases it doesn't work...quite confused.
1
Copy code
$ prefect config set PREFECT_API_URL='<http://10.6.0.4:4200/api>'
Set 'PREFECT_API_URL' to '<http://10.6.0.4:4200/api>'.
Updated profile 'default'.
[check] prefect@check-prefectagent01:~$ prefect block type ls
                                                                 Block Types
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Block Type Slug           ┃ Description                                                   ┃ Generate creation link                         ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ azure                     │ Store data as a file on Azure Datalake and Azure Blob Storage │ prefect block create azure                     │
├───────────────────────────┼───────────────────────────────────────────────────────────────┼────────────────────────────────────────────────┤
│ date-time                 │ A block that represents a datetime                            │ prefect block create date-time                 │
├───────────────────────────┼───────────────────────────────────────────────────────────────┼────────────────────────────────────────────────┤
│ docker-container          │ Runs a command in a container                                 │ prefect block create docker-container          │
├───────────────────────────┼───────────────────────────────────────────────────────────────┼────────────────────────────────────────────────┤
│ docker-registry           │ Connects to a Docker registry                                 │ prefect block create docker-registry           │
├───────────────────────────┼───────────────────────────────────────────────────────────────┼────────────────────────────────────────────────┤
│ gcs                       │ Store data as a file on Google Cloud Storage                  │ prefect block create gcs                       │
├───────────────────────────┼───────────────────────────────────────────────────────────────┼────────────────────────────────────────────────┤
│ github                    │ Interact with files stored on public GitHub repositories      │ prefect block create github                    │
├───────────────────────────┼───────────────────────────────────────────────────────────────┼────────────────────────────────────────────────┤
│ json                      │ A block that represents JSON                                  │ prefect block create json                      │
├───────────────────────────┼───────────────────────────────────────────────────────────────┼────────────────────────────────────────────────┤
│ kubernetes-cluster-config │ Stores configuration for interaction with Kubernetes clusters │ prefect block create kubernetes-cluster-config │
├───────────────────────────┼───────────────────────────────────────────────────────────────┼────────────────────────────────────────────────┤
│ kubernetes-job            │ Runs a command as a Kubernetes Job                            │ prefect block create kubernetes-job            │
├───────────────────────────┼───────────────────────────────────────────────────────────────┼────────────────────────────────────────────────┤
│ local-file-system         │ Store data as a file on a local file system                   │ prefect block create local-file-system         │
├───────────────────────────┼───────────────────────────────────────────────────────────────┼────────────────────────────────────────────────┤
│ process                   │ Run a command in a new process                                │ prefect block create process                   │
├───────────────────────────┼───────────────────────────────────────────────────────────────┼────────────────────────────────────────────────┤
│ remote-file-system        │ Store data as a file on a remote file system                  │ prefect block create remote-file-system        │
├───────────────────────────┼───────────────────────────────────────────────────────────────┼────────────────────────────────────────────────┤
│ s3                        │ Store data as a file on AWS S3                                │ prefect block create s3                        │
├───────────────────────────┼───────────────────────────────────────────────────────────────┼────────────────────────────────────────────────┤
│ smb                       │ Store data as a file on a SMB share                           │ prefect block create smb                       │
├───────────────────────────┼───────────────────────────────────────────────────────────────┼────────────────────────────────────────────────┤
│ secret                    │ A block that represents a secret value                        │ prefect block create secret                    │
├───────────────────────────┼───────────────────────────────────────────────────────────────┼────────────────────────────────────────────────┤
│ slack-webhook             │ Enables sending notifications via a provided Slack webhook    │ prefect block create slack-webhook             │
├───────────────────────────┼───────────────────────────────────────────────────────────────┼────────────────────────────────────────────────┤
│ string                    │ A block that represents a string                              │ prefect block create string                    │
└───────────────────────────┴───────────────────────────────────────────────────────────────┴────────────────────────────────────────────────┘
Copy code
$ prefect config set PREFECT_API_URL='<http://prefect.check.blacksmithtpm.int:4200/api>'
Set 'PREFECT_API_URL' to '<http://prefect.check.blacksmithtpm.int:4200/api>'.
Updated profile 'default'.
[check] prefect@check-prefectagent01:~$ prefect block type ls
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/anyio/_core/_sockets.py", line 186, in connect_tcp
    addr_obj = ip_address(remote_host)
  File "/usr/lib/python3.9/ipaddress.py", line 53, in ip_address
    raise ValueError('%r does not appear to be an IPv4 or IPv6 address' %
ValueError: '<http://prefect.check.blacksmithtpm.int|prefect.check.blacksmithtpm.int>' 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.9/dist-packages/httpcore/_exceptions.py", line 8, in map_exceptions
    yield
  File "/usr/local/lib/python3.9/dist-packages/httpcore/backends/asyncio.py", line 109, in connect_tcp
    stream: anyio.abc.ByteStream = await anyio.connect_tcp(
  File "/usr/local/lib/python3.9/dist-packages/anyio/_core/_sockets.py", line 189, in connect_tcp
    gai_res = await getaddrinfo(
  File "/usr/lib/python3.9/concurrent/futures/thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/lib/python3.9/socket.py", line 953, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/httpx/_transports/default.py", line 60, in map_httpcore_exceptions
    yield
  File "/usr/local/lib/python3.9/dist-packages/httpx/_transports/default.py", line 353, in handle_async_request
    resp = await self._pool.handle_async_request(req)
  File "/usr/local/lib/python3.9/dist-packages/httpcore/_async/connection_pool.py", line 253, in handle_async_request
    raise exc
  File "/usr/local/lib/python3.9/dist-packages/httpcore/_async/connection_pool.py", line 237, in handle_async_request
    response = await connection.handle_async_request(request)
  File "/usr/local/lib/python3.9/dist-packages/httpcore/_async/connection.py", line 86, in handle_async_request
    raise exc
  File "/usr/local/lib/python3.9/dist-packages/httpcore/_async/connection.py", line 63, in handle_async_request
    stream = await self._connect(request)
  File "/usr/local/lib/python3.9/dist-packages/httpcore/_async/connection.py", line 111, in _connect
    stream = await self._network_backend.connect_tcp(**kwargs)
  File "/usr/local/lib/python3.9/dist-packages/httpcore/backends/auto.py", line 29, in connect_tcp
    return await self._backend.connect_tcp(
  File "/usr/local/lib/python3.9/dist-packages/httpcore/backends/asyncio.py", line 109, in connect_tcp
    stream: anyio.abc.ByteStream = await anyio.connect_tcp(
  File "/usr/lib/python3.9/contextlib.py", line 135, in __exit__
    self.gen.throw(type, value, traceback)
  File "/usr/local/lib/python3.9/dist-packages/httpcore/_exceptions.py", line 12, in map_exceptions
    raise to_exc(exc)
httpcore.ConnectError: [Errno -2] Name or service not known

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

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/prefect/cli/_utilities.py", line 41, in wrapper
    return fn(*args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/prefect/utilities/asyncutils.py", line 212, in wrapper
    return run_async_in_new_loop(async_fn, *args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/prefect/utilities/asyncutils.py", line 141, in run_async_in_new_loop
    return anyio.run(partial(__fn, *args, **kwargs))
  File "/usr/local/lib/python3.9/dist-packages/anyio/_core/_eventloop.py", line 70, in run
    return asynclib.run(func, *args, **backend_options)
  File "/usr/local/lib/python3.9/dist-packages/anyio/_backends/_asyncio.py", line 292, in run
    return native_run(wrapper(), debug=debug)
  File "/usr/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/usr/local/lib/python3.9/dist-packages/anyio/_backends/_asyncio.py", line 287, in wrapper
    return await func(*args)
  File "/usr/local/lib/python3.9/dist-packages/prefect/cli/block.py", line 285, in list_types
    block_types = await client.read_block_types()
  File "/usr/local/lib/python3.9/dist-packages/prefect/client.py", line 1191, in read_block_types
    response = await <http://self._client.post|self._client.post>(f"/block_types/filter", json={})
  File "/usr/local/lib/python3.9/dist-packages/httpx/_client.py", line 1842, in post
    return await self.request(
  File "/usr/local/lib/python3.9/dist-packages/httpx/_client.py", line 1527, in request
    return await self.send(request, auth=auth, follow_redirects=follow_redirects)
  File "/usr/local/lib/python3.9/dist-packages/prefect/client.py", line 257, in send
    await super().send(*args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/httpx/_client.py", line 1614, in send
    response = await self._send_handling_auth(
  File "/usr/local/lib/python3.9/dist-packages/httpx/_client.py", line 1642, in _send_handling_auth
    response = await self._send_handling_redirects(
  File "/usr/local/lib/python3.9/dist-packages/httpx/_client.py", line 1679, in _send_handling_redirects
    response = await self._send_single_request(request)
  File "/usr/local/lib/python3.9/dist-packages/httpx/_client.py", line 1716, in _send_single_request
    response = await transport.handle_async_request(request)
  File "/usr/local/lib/python3.9/dist-packages/httpx/_transports/default.py", line 353, in handle_async_request
    resp = await self._pool.handle_async_request(req)
  File "/usr/lib/python3.9/contextlib.py", line 135, in __exit__
    self.gen.throw(type, value, traceback)
  File "/usr/local/lib/python3.9/dist-packages/httpx/_transports/default.py", line 77, in map_httpcore_exceptions
    raise mapped_exc(message) from exc
httpx.ConnectError: [Errno -2] Name or service not known
An exception occurred.
However...doing the same thing in a local docker container running the same debian11 image / python version works just fine
j
Hmm. There were a number of bug fixes released in 2.3.1 today. Does upgrading help?
a
Will try
Ugh, nope... will open another bug report Edit: I stand corrected, restarted that VM and transient networking issue cleared up...
🙌 1