Hey prefect, I am trying to run `prefect server st...
# prefect-community
a
Hey prefect, I am trying to run
prefect server start
for the first time and running into some errors with the postgres step. Can you help troubleshoot?
z
Sure thing, @Adam Roderick! What's up?
a
I'm looking for the first error
The first hard error looks like alembic
Copy code
apollo_1     | 2020-04-13T14:09:46.782Z Error fetching GraphQL health: FetchError: request to <http://graphql:4201/health> failed, reason: connect ECONNREFUSED 172.25.0.4:4201
There is an earlier warning with hasura_1
Copy code
hasura_1     | {"internal":"could not connect to server: Connection refused\n\tIs the server running on host \"postgres\" (172.25.0.2) and accepting\n\tTCP/IP connections on port 5432?\n","path":"$","error":"connection error","code":"postgres-error"}
z
Okay, interesting. So far, definitely looking like the chain of failures I'd expect to see from an error with Postgres.
a
The first time I attempted, there was a port conflict with a locally installed instance of postgres
So I shut down the local instance and retried
any way to do a "wipe" and clean slate retry?
z
Sure is! With your Prefect Server inf still up, I'd recommend running
prefect-server database reset
with the optional
-y
step to skip the confirmation step.
That'll rerun the alembic migrations and reapply the Hasura metadata. If there was a fluke getting that up and started the first time, should do the trick for you.
a
I'm getting
prefect-server
is not a command
I have 10.1 installed
z
Oh, duh. Sorry-- I'm used to typing
prefect-cloud
for local dev. 😅
a
Sorry if I'm dense here--what should the command be?
z
Not dense at all-- wanted to make sure I gave you the proper command this time! Sorry it's a little more complex, here's what I'd recommend: • cd into the
server
directory •
pip install -e .
• then run
prefect-server database reset -y
There's probably room for us to improve the CLI experience there, thanks for bringing it to our attention!
a
No problem, and thanks for the help. What do you mean by server directory?
I looked in the directory where I installed prefect, and I looked in the virtual env's prefect directory. I installed prefect from pyPI
z
Yep, I apologize again Adam-- this was a remnant from my local development on
prefect-server
. If you `pip install`ed prefect, you won't have that directory.
Your best bet might be to cancel your original spin-up of infrastructure and then run
prefect server start
.
If you're still running into errors there, happy to walk you through them. But if it was a transient issue with a port conflict, that should do the trick.
j
@Adam Roderick you mentioned an alembic error - do you mind sharing that?
a
I don't mind. Give me a moment and I'll update and share the errors
👍 2
Untitled
On my first run, I had errors due to a port conflict between the postgres container and a local install of postgres. After deleting all the containers, shutting off my local postgres, and trying again, the above is pretty consistent output
At current state, I can run the UI in the browser, and I can register a flow. It shows up in the UI. But when I try to run, it just hangs and eventually shows up in the Late Runs list
j
Ok! This log looks good and that makes sense that Postgres was unable to start before. The current issue just sounds like there isn’t a local agent running.
Your Cloud agents won’t work with the open-source server. Try
prefect backend server
and `prefect agent start`to spin up a local one
a
That must be what I am missing. I'll give that a try
That was it
The errors in the docker output are still there and confused me. But I was able to register a flow locally with the UI and execute it from the UI
Thanks for your help!
LMK if you want any other info from my machine
j
ok! I think we’re good then - those docker errors are most likely a consequence of our services being somewhat order dependent and docker not being a great place to have order dependent services 🙂 (For example, hasura depends on postgres being available; graphql depends on hasura being available; apollo depends on graphql being available…) Therefore there can be some noise as they jockey for position, however we are going to look into it because we don’t want it to be alarming.
⬆️ 1
a
All good from my end. Thanks again