Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Couldn't connect to Prefect Server at http://localhost:4200/graphql #107

Open
jackhawa opened this issue Jan 12, 2022 · 11 comments
Open

Couldn't connect to Prefect Server at http://localhost:4200/graphql #107

jackhawa opened this issue Jan 12, 2022 · 11 comments

Comments

@jackhawa
Copy link

jackhawa commented Jan 12, 2022

Screenshot from 2022-01-11 21-13-50

Hello, enjoying the MLOps ecosystem. Great work!

I am following the minikube set up and was able to operate mlflow and jupyter hub but could not connect to graphql endpoint from prefect with the error: "Couldn't connect to Prefect Server at http://localhost:4200/graphql"

I have made sure that I am using install_locally=True, aws=False and the graphql site at http:localhost:4200 is up and running.

Screenshot from 2022-01-11 21-40-44

I have also executed this command to forward the graphql 4200 port:

kubectl port-forward -n prefect svc/prefect-server-apollo 4200

But for some reason it is still not connecting.

Any tips to troublehsoot?

@jackhawa
Copy link
Author

Here is the list of kubernetes services in case it helps

Screenshot from 2022-01-11 21-42-02

@bernardolk
Copy link
Contributor

Hello there. Does the prefect server graphql pod contain any useful logs? Or even any other prefect pod, for that matter? There isn't much info here to work with yet but I would recommend that you try using the graphql endpoint from a python script using the prefect client just to make sure you can execute graphql queries against it (You can checkout prefect documentation on how to use the prefect client for graphql querying). If you can, then the problem may be with the prefect UI pod. It may be not configured correctly to reach the graphql service.

@jackhawa
Copy link
Author

It turns out there is an error in prefect-server-agent.

Screenshot from 2022-01-12 10-27-39

It is trying to connect to /graphql url without any hostname attached to it. I am assuming that is the error. If so I am not sure why it is dropping the hostname http://localhost:4200 since I have added install_locally to my terraform config file.

@jackhawa
Copy link
Author

Locally I am able to reach out and query graphql api from a python script.

Screenshot from 2022-01-12 10-57-49

@bernardolk
Copy link
Contributor

Can you check the env vars in the prefect server agent pod?

kubectl describe pod -n prefect prefect-server-agent-<somerandomid>

@bernardolk
Copy link
Contributor

Check if you have PREFECT__CLOUD__API set to something

@bernardolk
Copy link
Contributor

Also, do the same with the UI pod and check the PREFECT_SERVER__APOLLO_URL env var value

@jackhawa
Copy link
Author

jackhawa commented Jan 12, 2022

PREFECT_CLOUD_API is pointing to http://prefect-server-apollo.prefect:4200/graphql
PREFECT_SERVER__APOLLO_URL points to http://localhost:4200/graphql

@jackhawa
Copy link
Author

Would you have any idea where to go from here? Any tips is appreciate. Thank you in advance.

@bernardolk
Copy link
Contributor

Hmm, these look ok. Considering you can reach the graphql endpoint by port-forwarding, it really should be working. I would recommend you open an issue with prefect, I am out of ideas since the variables look ok :(

@jackhawa
Copy link
Author

Ok thanks for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants