shlok
08/28/2025, 4:38 PMMarvin
08/28/2025, 4:38 PMMarvin
08/28/2025, 4:41 PMPREFECT_API_URL
points at the root (e.g., http://127.0.0.1:4200) the server returns HTML, and prefect deploy
tries to parse it as JSON and fails with “Expecting value: line 1 column 1”.
For a self‑hosted Prefect 3 server, your API URL must include the /api suffix. For your local instance, set it to:
- http://127.0.0.1:4200/api
How to create a new profile and set its URL
1) Create and activate a profile:
prefect profile create local
prefect profile use local
2) Set the API URL for that profile:
prefect config set PREFECT_API_URL=<http://127.0.0.1:4200/api>
3) Validate / inspect:
prefect config view
prefect config validate
4) Retry:
prefect deploy
If you also have a remote self‑hosted instance, make a second profile:
prefect profile create remote
prefect profile use remote
prefect config set PREFECT_API_URL=http://<your-remote-host>:<port>/api
Quick health check
- Hitting the root (/) returns HTML (the UI) — wrong for clients
- The API should respond at /api; for example:
curl <http://127.0.0.1:4200/api/health>
This should return a small JSON/OK response. If you see HTML, your URL or reverse proxy routing is off.
A couple of helpful commands
- List/switch profiles:
prefect profile ls
prefect profile use <name>
If you share the current value of PREFECT_API_URL
(prefect config view | grep PREFECT_API_URL
) and your Prefect version (prefect version
), I can double‑check compatibility and confirm you’re pointed at the right endpoint.
Docs for reference:
- Settings and profiles: Settings and profiles
- Manage settings via CLI/env: Manage settings
- Self-hosted server overview: Prefect Server
- Deployments (prefect.yaml projects): Deployments with prefect.yaml