Unable to get cli tools to connect to api (even though UI is working)

Hello,

I’m self-hosting an installation of Prefect (all components, including the UI and everything) on my kubernetes installation.

I’ve installed this all of this with the helm chart provided here. (Side note - it looks like the documentation is slightly outdated here, under this section - it’s asking me to set things in profile.toml but that appears to be for prefect 1.0?)

I should add that when standing up the UI, I’ve configured it with the API URL for apollo, and I’m able to view the dashboard with no issues, as well as see my 1 agent connected that helm set up for me (agent.enabled: true in values.yaml)

Here’s where the issue begins - no matter what I do, I can’t seem to get my flows to run on my installation, or another agent started locally that hooks up to my hosted apollo server, or anything.

For example, prefect agent start never seems to respect the --api switch: e.g. if I pass prefect agent start --api "abdfaklsdjf" -q t it just advertises that it successfully connected to a nonsensical API endpoint, even though there’s obviously nothing there.

My other attempt was setting PREFECT_API_URL via prefect config set, but I always get a HTTP 400 error. I’ve confirmed that I can actually access the apollo installation via curl (and the HTTP UI works fine configured with its equivalent /graphql endpoint)

When attempting to submit a flow run with the above, I always get the following error

RuntimeError: Cannot create flow run. Failed to reach API at https://<snip>/graphql/. (I’ve tried with both /graphql and /api just to see)

Any time I try to curl this URL, I get back GET query missing.

I’ve been struggling with this step for 3 days now, and I’m at my wits end here since some of the documentation points to v1 (there are links to outdated v1 documentation things on the UI!) which is no longer applicable.

Any pointers in the right direction would be greatly appreciated :slight_smile:

1 Like

You could open an issue on the prefect-helm repo if something from those docs is not up to date or doesn’t work. You can try Prefect Cloud app.prefect.cloud - there is a generous always free tier you can use for your PoC to get started, and if you struggle with a production setup, we have paid support you could reach via cs@prefect.io