I'm sorry to ask, its probably really dumb. I clo...
# prefect-community
d
I'm sorry to ask, its probably really dumb. I cloned the git repo, did pip --upgrade, ran "prefect backend server".. Copied the hello-world script, instead of flow.run(), I did flow.register(). I got this message back:
Copy code
Result Handler check: OK
/home/ec2-user/venv/prefect/lib64/python3.7/site-packages/prefect/core/task.py:258: UserWarning: DEPRECATED: all cache_* options on a Task will be deprecated in 0.11.0, and removed in 0.12.0; the options will be moved to a Task's prefect.engine.Result object.
  UserWarning,
Flow: <http://localhost:8080/flow/ef63906a-6e2b-4b7b-aba5-6e9303560e5f>
But I dont see anything changing in the UI, and dont see anything under the "Flows" link. I have this running on an ec2 machine so I dont use "localhost", but can reach the UI.. Just looks like it knows nothing about the flow. What have I missed?
s
you still need to trigger a run after you register it. So if you navigate to that link, and click "Quick Run" or "Run" and you have an Agent running.. then it'll start to do work
This helped me understand the process better:

https://www.youtube.com/watch?v=1qyDh6CH4Fo

d
Thanks. Im doing all those steps as well, just like the video. I run my python.etl script (in my case, hello.py) which ends in flow.register(), I get back the same DEPRECATED cache_* warning, and a Flow: url response. But when I pull up the UI and try to search for the flow, like in the video, I get no result, there is nothing there like what the video is showing. ("Flow!" created in the UI, before he starts the agent)
j
@David N are you serving the Prefect server API on
<http://localhost:4200>
? I believe that’s what the UI is currently set to look for. In the original message you mention that you don’t use “localhost” so I’m not sure what you’re serving on
Copy code
from prefect import config
print(config.server.endpoint)
d
its all running on an ec2 machine running amazon linux 2, so no, I access it via the local ip address, not localhost
but this is probably my issue
Copy code
from prefect import config
print(config.server.endpoint)
Output:
<http://localhost:4200>
j
Yeah when registering the flow it’s sending the metadata payload to that endpoint so I’m wondering why the UI isn’t able to access it. Just to confirm you’re running with
prefect server start
?
d
yep, and its still running. When I do flow.register(), i get back a "success" and flow url like expected
and when i use the CLI, I see the flow registered
Copy code
(prefect) [ec2-user@ip-10-118-33-125 dbt_workflow]$ prefect get flows
NAME        VERSION    AGE
hello-flow  3          22 minutes ago
j
Ah since it looks like the Upcoming Runs tile is loading I think it has something to do with the UI not being able to talk to that server endpoint. cc @nicholas Have you seen this before?
👀 1
n
@David N can you open up the browser console when you're on your UI? (⌘ + ⌥ + i on a Mac) and send a screnshot?
d
standby
n
You may need to refresh if it's not populated
d
Im sorry I didnt think of that
Copy code
index.js:111 POST <http://localhost:4200/graphql/> net::ERR_CONNECTION_REFUSED
(anonymous) @ index.js:111
e @ Observable.js:197
value @ Observable.js:279
(anonymous) @ bundle.esm.js:13
Promise.then (async)
(anonymous) @ bundle.esm.js:12
e @ Observable.js:197
....etc....
n
Yup so the UI endpoint that you're serving isn't proxied to your ec2 instance
d
Any easy advice? I dont really understand how a server cant refer to itself as localhost.. but I'm also not a networking / vpc expert either
n
I think the quickest solution would be to modify your local machine's
/etc/hosts
file to point
localhost:4200
to your server's endpoint
Ah as for the server, it's not the server that's referring to itself incorrectly, it's that you're using the UI on your local machine, which means that the UI, which only runs on the client (since it's a static build) and not on the server, is trying to communicate to the localhost of the machine on which it's running
d
i see, the ui, which is running in my browser, is making a call to "localhost" via javascript, and my laptop rejects it..
n
Exactly
i
ty nicholas, helped me out too!
🙌 1