PrabhatGupta
11/14/2023, 9:13 AMMarvin
11/14/2023, 9:13 AMPREFECT_API_URL
environment variable.
Here is an example of how you might set this up in a Docker compose script:
yaml
version: '3.7'
services:
prefect-agent:
image: prefecthq/prefect:latest
command: prefect agent start -p [work pool name]
environment:
- PREFECT_API_URL=<http://host.docker.internal:4200/api>
network_mode: "host"
In the above script, replace [work pool name]
with the name of your work pool. The PREFECT_API_URL
is set to <http://host.docker.internal:4200/api>
which is the default location for the Prefect API when running on Docker for Windows or Mac. If you're running on Linux, you'll need to set PREFECT_API_URL
to <http://localhost:4200/api>
instead.
Please note that the network_mode: "host"
option is used to ensure that the container can communicate with the host machine. This is necessary if you're running on Linux.
For more detailed information, you can refer to the Prefect documentation on agents and Docker.PrabhatGupta
11/14/2023, 9:20 AMMarvin
11/14/2023, 9:21 AMhttpx.LocalProtocolError
. This error appeared after they upgraded Prefect from version 2.4.0 to 2.6.5.
4. Issue #9052 reported that network issues caused the worker to stop running flows, resulting in flows getting stuck in the "pending" state.
5. Pull request #9125 added httpx.ConnectTimeout
to the list of retry exceptions in the base client to handle occasional network connectivity issues.
It's hard to say exactly what's causing your issue without more information, but these reported issues might give you some clues. You might want to check the version of Prefect you're using and consider upgrading if you're not on the latest version. If the problem persists, you could consider opening an issue on the Prefect GitHub repository.