Julio Venegas
09/30/2021, 5:53 PMprefect server start --postgres-url postgres://<username>:<password>@hostname:<port>/<dbname>
because the @ in the username makes the parsing process think that AZURE_INSTANCE_NAME is the host. Escaping the @ in the username has not worked. In the past the quick fix someone from the Prefect team recommended to me that actually solved the issue, was to install https://github.com/PrefectHQ/server, pass the postgres connection string to the prefect-server config with export PREFECT_SERVER__DATABASE__CONNECTION_URL=CONNECTION_STRING and then run prefect-server database upgrade
. I’m currently doing 1) prefect server start --external-postgres --no-upgrade
to start the Docker containers, followed by prefect-server database upgrade
and the current error I’m getting from the last command is Error: HTTPConnectionPool(host='localhost', port=3000): Max retries exceeded with url: /v1/query (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f6aaf865730>: Failed to establish a new connection: [Errno 111] Connection refused'))
which based on the port=3000 is related to Hasura. Any advice highly appreciated!!Kevin Kho
09/30/2021, 5:56 PMJulio Venegas
09/30/2021, 5:56 PMKevin Kho
09/30/2021, 5:58 PM--expose
flag to open Prefect to outside connections.Julio Venegas
09/30/2021, 5:59 PMprefect server start --expose --external-postgres --np-upgrade
followed by the prefect-server command and also got an errorKevin Kho
09/30/2021, 6:00 PMJulio Venegas
09/30/2021, 6:00 PMError: HTTPConnectionPool(host='localhost', port=3000): Max retries exceeded with url: /v1/query (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f5ae52d8730>: Failed to establish a new connection: [Errno 111] Connection refused'))
prefect server start --expose --external-postgres --no-upgrade
and 2) prefect-server database upgrade
Kevin Kho
09/30/2021, 6:04 PMJulio Venegas
09/30/2021, 6:04 PMKevin Kho
09/30/2021, 6:11 PMJulio Venegas
09/30/2021, 6:19 PMdocker ps
and the tmp_hasura_1 container says “Restarting” so I think not!Kevin Kho
09/30/2021, 6:20 PMJulio Venegas
09/30/2021, 6:20 PM{"type":"pg-client","timestamp":"2021-09-30T18:01:30.790+0000","level":"warn","detail":{"message":"postgres connection failed, retrying(0)."}}
{"type":"pg-client","timestamp":"2021-09-30T18:01:30.790+0000","level":"warn","detail":{"message":"postgres connection failed, retrying(1)."}}
{"type":"startup","timestamp":"2021-09-30T18:01:30.790+0000","level":"error","detail":{"kind":"catalog_migrate","info":{"internal":"could not connect to server: Connection refused\n\tIs the server running on host \"localhost\" (127.0.0.1) 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 \"localhost\" (127.0.0.1) and accepting\n\tTCP/IP connections on port 5432?\n","path":"$","error":"connection error","code":"postgres-error"}
prefect-server database upgrade
?Zanie
09/30/2021, 6:36 PM--expose
flag may be necessary to allow connections to external services right nowJulio Venegas
09/30/2021, 6:39 PMZanie
09/30/2021, 6:39 PMJulio Venegas
09/30/2021, 6:43 PMexport PREFECT_SERVER__DATABASE__CONNECTION_URL=CONNECTION_STRING
Zanie
09/30/2021, 6:44 PM_
PREFECT__SERVER
Julio Venegas
09/30/2021, 6:44 PMZanie
09/30/2021, 6:45 PMPREFECT__SERVER
-- PREFECT_SERVER
targets the prefect server config directlyJulio Venegas
09/30/2021, 6:45 PMZanie
09/30/2021, 6:45 PMJulio Venegas
09/30/2021, 6:46 PMPREFECT_SERVER__DATABASE
otherwiser prefect-server does not get the right connection and tries to connect with local postgres (which does not exist)Zanie
09/30/2021, 6:56 PMprefect server config --expose --external-postgres
then just hardcode your connection url does it work?Julio Venegas
09/30/2021, 7:05 PMprefect server config --expose --external-postgres
shows the right configuration, is this config prefect or prefect-server?Zanie
09/30/2021, 7:10 PMdocker-compose.yml
that we'd run when you do prefect server start
> docker-compose.yml
that to a file and then docker-compose up
Julio Venegas
09/30/2021, 7:14 PMZanie
09/30/2021, 7:15 PMPREFECT_SERVER__DATABASE__CONNECTION_URL
you should be able to override any parsing (I think?)Julio Venegas
09/30/2021, 7:21 PMprefect-server database upgrade
after exporting the connection string to PREFECT_SERVER__DATABASE__CONNECTION_URL is throwing this error Error: HTTPConnectionPool(host='localhost', port=3000): Max retries exceeded with url: /v1/query (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f6aaf865730>: Failed to establish a new connection: [Errno 111] Connection refused'))
because Hasura is not running correctlyprefect server start --external-postgres --no-upgrade
Hasura container fails to start because it’s looking for local postgres
2. export PREFECT_SERVER__DATABASE__CONNECTION_URL=CONNECTION_STRING
3. prefect-server database upgrade
fails to connect to HasuraZanie
09/30/2021, 7:23 PM%40
instead of @
Julio Venegas
09/30/2021, 7:24 PMZanie
09/30/2021, 7:28 PMJulio Venegas
09/30/2021, 7:28 PM