https://prefect.io logo
Title
h

Hygor Knust

04/07/2021, 6:51 PM
Hi everyone, I'm using the Prefect Helm Chart to deploy a Prefect Server in my self-hosted Kubernetes Cluster. The setup works fine, the tenant and agent are being set by Helm. I have also created a L7 Ingress pointing to Apollo. The UI is working, but when I try to register a simple Flow, I receive this error:
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: http://{endpoint}:80/graphql/alpha
where endpoint is the L7 ingress endpoint. Is there a way to debug what's going wrong?
1
k

Kevin Kho

04/07/2021, 6:55 PM
Hi @Hygor Knust, I will forward this to the team
h

Hygor Knust

04/07/2021, 6:59 PM
Thanks! To add more information, I can access the GraphQL web client using this endpoint and there are no errors in the logs
k

Kevin Kho

04/07/2021, 7:00 PM
Oh so the error is only when using the UI?
h

Hygor Knust

04/07/2021, 7:01 PM
No, everything seems to be working, the error occurs when I run this python script
import random
from prefect import task, Flow


@task
def random_number():
    return random.randint(0, 100)


@task
def plus_one(x):
    return x + 1


with Flow('My Functional Flow') as flow:
    r = random_number()
    y = plus_one(x=r)


flow.register(project_name="Sample Project")
z

Zanie

04/07/2021, 7:03 PM
Hey @Hygor Knust -- what did you set the
ui.apolloApiUrl
to when you installed the Helm chart?
Also it looks like you're hitting port
80
instead of
4200
, did you change the apollo service port?
h

Hygor Knust

04/07/2021, 7:27 PM
Hi @Zanie, I created an Ingress forwarding
http://{endpoint}
to
http://{apollo-ip}:4200
so I don't have to change any configuration if the Apollo IP changes. I thought that this ingress could be the problem, but I set it as the URL in the UI and it connected successfully. and I am also able to connect to it using my browser.
z

Zanie

04/07/2021, 8:07 PM
What does
prefect diagnostics
output?
h

Hygor Knust

04/07/2021, 9:06 PM
I get the same error if I try passing the Apollo SVC ip
{
  "config_overrides": {
    "server": {
      "endpoint": true
    }
  },
  "env_vars": [],
  "system_information": {
    "platform": "Windows-10-10.0.18362-SP0",
    "prefect_version": "0.11.2",
    "python_version": "3.8.2"
  }
}
z

Zanie

04/08/2021, 3:22 PM
Can you try running
prefect backend server
?
h

Hygor Knust

04/08/2021, 3:23 PM
Oh, I found it. There was a mismatch between the Prefect Server and my local prefect package
z

Zanie

04/08/2021, 3:23 PM
Wonderful 🙂
h

Hygor Knust

04/08/2021, 3:24 PM
Thanks for your support!