Hi everyone. I'm evaluating Prefect for my team t...
# prefect-server
a
Hi everyone. I'm evaluating Prefect for my team today and running into an issue. I am able to get prefect server to run and can access to UI just fine. However, I am unable to get a flow to register on the UI. When I run flow.register() in my python script, I get:
Copy code
Result Handler check: OK
Flow: <http://localhost:8080/flow/724c4570-3a00-4362-9df5-27ea72975538>
However, the flow doesn't appear on the UI I already have up. If I follow the link, it takes me to a UI but I don't see the flow. I think the issue is that I am using a linux machine that I am SSH'd into. Does anyone have any tips? I have tried changing some of my user config settings in .prefect/backend.toml. I suspect I need to change some of the 'localhost' to '0.0.0.0' but I'm not sure which ones and when I try doing them all the server throws errors when I start the server. Any ideas?
a
Do you have an agent running?
j
Hmmm, that is odd. Is there a chance you have two instances of server running, and you're registering with the wrong one?
a
How can I check if i have an agent running? I don't think i do?
What is the best way to check all running servers? docker-compose ps?
j
That or
docker ps
.
We suspect you may have multiple backends running, so its registering with one, but not visible to the other.
a
docker ps
shows no other running servers
j
Hmmm, that is odd. Can you try restarting server and re-registering the flow? Wonder if there was a hiccup with the db or something.
Also cc @Zachary Hughes for more knowledge of server than I have.
a
I've restarted server multiple times with same result.
Maybe this won't surprise people with more knowledge of networking than me, but it is strange that i am able to go to
Copy code
<http://localhost:8080/flow/724c4570-3a00-4362-9df5-27ea72975538>
from my desktop (not the machine i am running the server or python process on)
z
Honestly, it's surprising to me as well and is part of the reason we suspected multiple backends. I wouldn't think you'd be able to visit the UI without a local instance of it running.
Give me just a sec-- I think we can put together a test to run and try and get a bit closer to the issue here.
a
Just realized that the api status in the UI is "couldn't connect"
z
Ah, that would definitely do it. If you want to connect to the API while it's hosted on a remote machine, you'll likely need to update the
server.ui
host
field to match the host where your API is.
a
I've brute force tried about 20 different configs with no luck. I've changed
server.ui
host
to
<http://0.0.0.0>
0.0.0.0
http://[HOSTNAME]
http://[HOSTNAME].[DOMAINNAME].com
and I have also tried changing
[server.ui]
graphql_url
in a similar fashion, as well as combinations of all of these.
Maybe i should just use cloud.
upvote 1
z
I'd expect something along the lines of
graphql_url = "<http://YOUR_IP_HERE:4200/graphql>"
to work. When you say "no luck," do you mean that you're seeing errors when you attempt to spin it up, or is it that you're still unable to connect to the API? That aside, Prefect Cloud is also great. It does a lot of this for you, so it works "out of the box." We have a free developer tier if you'd like to give that a shot!
a
Did you run
prefect agent start
?
a
@Zachary Hughes It spins up but shows in the UI that it is unable to connect to the API. Just tried changing the config to only change
graphql_url = "http://[hostname]:4200/graphql"
. Its all within the same network so I expect hostname to be ok instead of ip. Still nothing. I'll try again with fresh eyes tomorrow and then try cloud if I still can't get it to work.
@alex Do i need to do that for the UI to show it is connected to the API?
a
I'm new to prefect as well but I recall needing to run the agent otherwise my flows wouldn't show up in my ui. Might be getting confused with something else though.
z
Having an agent running shouldn't have any bearing on whether you're able to see flows in your UI, but you'll need one eventually in order to pick up and run flow runs from Server/Cloud.
👍 1
a
Hi @Austin Sharp I think I've figured it out. Try this if you haven't
Copy code
backend = "server"

graphql_url = "<http://HOST:4200/graphql>"


[server]
  [server.ui]
  graphql_url = "<http://HOST:4200/graphql>"
a
Trying now. I haven't figured it out yet.
@alex does graphql_url go outsize the server.ui part? In the default config its in it.
Tried both ways, no dice.
I noticed that it just gives a slash in the API status indicator.
I feel like i've seen other screenshots where that list the full URL of the address its trying to connect to.
@alex @Zachary Hughes @Jim Crist-Harif grasping for straws, I decided to try making a new conda environment and updating prefect. That did the trick. Went from to 0.10.2 to 0.12.3. Sorry for the wild goose chase lol. Thanks for y'alls help. My company (Fortune 500 company) is struggling with ETL management and i'm hoping prefect can help solve some our challenges.
z
If you learned something new, definitely not a wild goose chase! Glad you got things working, and don't hesitate to let us know if there's anything we can do to help now that you're up and running.
👍 1