Learn how to identify and resolve common issues with Prefect Cloud.
httpx
Python library.
httpx
respects accepted proxy environment variables, so the Prefect client can communicate through proxies.
To enable communication through proxies, set the HTTPS_PROXY
and SSL_CERT_FILE
environment
variables in your execution environment.
See the Using Prefect Cloud with proxies
GitHub Discussion for more information.
You should whitelist the URLs for the UI, API, Authentication,
and the current OCSP server for outbound-communication in a secure environment:
prefect config view
CLI command to make sure your execution environment is correctly configured
to access Prefect Cloud:
PREFECT_API_URL
is configured to use https://api.prefect.cloud/api/...
.
Make sure PREFECT_API_KEY
is configured to use a valid API key.
You can use the prefect cloud workspace ls
CLI command to view or set the active workspace.
PREFECT_API_URL
match those shown in the URL for your Prefect Cloud workspace.
INFO
level
to the DEBUG
level. Settings such as the logging level are propagated
from the worker environment to the flow run environment. Set them with environment variables or the prefect config set
CLI:
DEBUG
logging level produces a high volume of logs, so consider setting it back to INFO
once any issues are resolved.
Invalid authentication credentials
.
Use the following command to check your authentication, replacing $PREFECT_API_KEY
with your API key:
pnu_
and service account API keys start with pnb_
.| python -m json.tool
python flow.py
. Remote execution generally means that a worker runs your flow
through a deployment (optionally on different infrastructure).
With remote execution, the creation of your flow run happens separately from its execution.
Flow runs are assigned to a work pool and a work queue. For flow runs to execute, a worker must be subscribed
to the work pool and work queue, or the flow runs will go from Scheduled
to Late
.
Ensure that your work pool and work queue have a subscribed worker.
Local and remote execution can also differ in their treatment of relative imports.
If switching from local to remote execution results in local import errors, try replicating the
behavior by executing the flow locally with the -m
flag (For example, python -m flow
instead of python flow.py
).
Read more about -m
in this Stack Overflow post.
/
in the request URL.
If you write a test that does not include a trailing /
when making a request to a specific endpoint:
/
:
0.22.0
.
pytest.PytestUnraisableExceptionWarning
or ResourceWarning
FlowRunner
implementations, you may get an
error like this:
prefect
library code) opened a
connection to something (like a Docker daemon or a Kubernetes cluster) and didn’t close
it.
It may help to re-run the specific test with PYTHONTRACEMALLOC=25 pytest ...
so that
Python can display more of the stack trace where the connection was opened.