Hello all! I am trying to start the prefect server...
# prefect-server
j
Hello all! I am trying to start the prefect server in my local using the backend as server and running prefect server start. I never had a problem using it but currently I buy other laptop and I am getting an error from hasura service (which a connection refuse to the postgres database) the traceback error is inside the thread. The prefect version is 0.15.13 and the OS version is ubuntu 22.04
k
Hey Javier, so you installed 0.15.13 and then just did a fresh
prefect server start
and ran into this? When you get a chance, could you move the traceback to the thread to keep the main channel cleaner?
j
The error is:
Copy code
{"type":"pg-client","timestamp":"2022-05-27T11:44:45.827+0000","level":"warn","detail":{"message":"postgres connection failed, retrying(0)."}}
{"type":"pg-client","timestamp":"2022-05-27T11:44:45.827+0000","level":"warn","detail":{"message":"postgres connection failed, retrying(1)."}}
{"type":"startup","timestamp":"2022-05-27T11:44:45.827+0000","level":"error","detail":{"kind":"catalog_migrate","info":{"internal":"could not connect to server: Connection refused\n\tIs the server running on host \"postgres\" (172.23.0.2) and accepting\n\tTCP/IP connections on port 5432?\n","path":"$","error":"connection error","code":"postgres-error"}}}
{"internal":"could not connect to server: Connection refused\n\tIs the server running on host \"postgres\" (172.23.0.2) and accepting\n\tTCP/IP connections on port 5432?\n","path":"$","error":"connection error","code":"postgres-error"}
{"type":"startup","timestamp":"2022-05-27T11:44:46.878+0000","level":"error","detail":{"kind":"catalog_migrate","info":{"internal":{"statement":"CREATE EXTENSION IF NOT EXISTS pgcrypto SCHEMA public","prepared":false,"error":{"exec_status":"FatalError","hint":null,"message":"duplicate key value violates unique constraint \"pg_extension_name_index\"","status_code":"23505","description":"Key (extname)=(pgcrypto) already exists."},"arguments":[]},"path":"$","error":"pgcrypto extension is required, but it could not be created; encountered unknown postgres error","code":"postgres-error"}}}
{"internal":{"statement":"CREATE EXTENSION IF NOT EXISTS pgcrypto SCHEMA public","prepared":false,"error":{"exec_status":"FatalError","hint":null,"message":"duplicate key value violates unique constraint \"pg_extension_name_index\"","status_code":"23505","description":"Key (extname)=(pgcrypto) already exists."},"arguments":[]},"path":"$","error":"pgcrypto extension is required, but it could not be created; encountered unknown postgres error","code":"postgres-error"}
{"type":"unstructured","timestamp":"2022-05-27T11:44:47.849+0000","level":"warn","detail":"The following environment variables are deprecated: HASURA_GRAPHQL_QUERY_PLAN_CACHE_SIZE"}
k
Thanks!
j
I did a fresh install and ran into this error yep. I was looking for the error and try several things but I still continue with the error
k
Can you check hasura version?
j
Sure
hasura v2.1.1
k
Oh that actually looks right
Did you have an existing database you connected to? Or started a new one?
j
started new one (included in the prefect docker compose)
k
Honestly I think something weird just happened and I would try to start it again? Specifically the uniqueness constraint looks weird
j
I restarted my computer and restart many times the prefect server and keeps happening
k
Ok i’ll ask the team for more ideas
j
thank you!
a
Javier, could you install a higher Prefect version? On your Ubuntu version you have Python version that should automatically install Prefect 1.2 rather than a lower than that version
j
I can but my agents in production are in this version that is why I want to have this version. Anyways I need to update the version so I will try to update it
🙌 1
@Anna Geller still dropping the same error. When I start all the services with prefect server start:
Copy code
{"type":"pg-client","timestamp":"2022-05-30T10:20:21.565+0000","level":"warn","detail":{"message":"postgres connection failed, retrying(0)."}}
{"type":"pg-client","timestamp":"2022-05-30T10:20:21.565+0000","level":"warn","detail":{"message":"postgres connection failed, retrying(1)."}}
{"type":"startup","timestamp":"2022-05-30T10:20:21.565+0000","level":"error","detail":{"kind":"catalog_migrate","info":{"internal":"could not connect to server: Connection refused\n\tIs the server running on host \"postgres\" (172.19.0.2) and accepting\n\tTCP/IP connections on port 5432?\n","path":"$","error":"connection error","code":"postgres-error"}}}
{"internal":"could not connect to server: Connection refused\n\tIs the server running on host \"postgres\" (172.19.0.2) and accepting\n\tTCP/IP connections on port 5432?\n","path":"$","error":"connection error","code":"postgres-error"}
{"type":"unstructured","timestamp":"2022-05-30T10:20:22.792+0000","level":"warn","detail":"The following environment variables are deprecated: HASURA_GRAPHQL_QUERY_PLAN_CACHE_SIZE"}
a
What did you do differently than before? Can you perhaps write down all steps you have taken so far in a README, publish as a GitHub gist and share it with us?
j
I did the same than before but in other new laptop and the steps are few so I think I can write here: 1. Create a virtualenv with python 3.10.4 (python3 -m venv venv) 2. Then install the python requirements using pip (one of then is prefect prefect[aws,viz]==1.2.2") 3. prefect backend server 4. prefect server start
a
this looks fine when running only locally - if you run on a remote VM, you would need the --expose flag:
Copy code
prefect server start --expose
also, are you just getting started with Prefect? if that's the case I would recommend Prefect 2.0
j
I am not starting with prefect, I started using it 2 years ago and I can't change currently all the flows to orion 😞 (time/priority). Also, I am not in a VM but I notice that the postgres service is refusing the connections so I will try to deploy in my local one and use this.
a
sure, keep us posted, thanks for the update
j
Exists any kind of argument to start prefect in network host mode?
a
all components run by default on the same host - is your question about a Docker agent running on the same network as other Docker containers used by your Prefect Server? if so, this is how you can do it:
Copy code
prefect agent docker start --network prefect-server
this thread explains it more
234 Views