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
Julio Venegas
09/30/2021, 5:56 PMJulio Venegas
09/30/2021, 5:57 PMKevin Kho
--expose
flag to open Prefect to outside connections.Kevin Kho
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
Julio Venegas
09/30/2021, 6:00 PMJulio Venegas
09/30/2021, 6:02 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'))
Julio Venegas
09/30/2021, 6:04 PMprefect server start --expose --external-postgres --no-upgrade
and 2) prefect-server database upgrade
Kevin Kho
Julio Venegas
09/30/2021, 6:04 PMKevin Kho
Julio Venegas
09/30/2021, 6:19 PMdocker ps
and the tmp_hasura_1 container says “Restarting” so I think not!Kevin Kho
Julio Venegas
09/30/2021, 6:20 PMJulio Venegas
09/30/2021, 6:21 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"}
Julio Venegas
09/30/2021, 6:23 PMprefect-server database upgrade
?Julio Venegas
09/30/2021, 6:24 PMZanie
--expose
flag may be necessary to allow connections to external services right nowZanie
Zanie
Julio Venegas
09/30/2021, 6:39 PMZanie
Julio Venegas
09/30/2021, 6:43 PMexport PREFECT_SERVER__DATABASE__CONNECTION_URL=CONNECTION_STRING
Zanie
_
Zanie
PREFECT__SERVER
Julio Venegas
09/30/2021, 6:44 PMZanie
PREFECT__SERVER
-- PREFECT_SERVER
targets the prefect server config directlyJulio Venegas
09/30/2021, 6:45 PMZanie
Julio Venegas
09/30/2021, 6:46 PMJulio Venegas
09/30/2021, 6:53 PMPREFECT_SERVER__DATABASE
otherwiser prefect-server does not get the right connection and tries to connect with local postgres (which does not exist)Zanie
prefect server config --expose --external-postgres
then just hardcode your connection url does it work?Zanie
Julio Venegas
09/30/2021, 7:05 PMJulio Venegas
09/30/2021, 7:09 PMprefect server config --expose --external-postgres
shows the right configuration, is this config prefect or prefect-server?Zanie
docker-compose.yml
that we'd run when you do prefect server start
Zanie
> docker-compose.yml
that to a file and then docker-compose up
Zanie
Julio Venegas
09/30/2021, 7:14 PMJulio Venegas
09/30/2021, 7:14 PMJulio Venegas
09/30/2021, 7:15 PMZanie
PREFECT_SERVER__DATABASE__CONNECTION_URL
you should be able to override any parsing (I think?)Zanie
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 correctlyJulio Venegas
09/30/2021, 7:23 PMprefect 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
Zanie
%40
instead of @
Julio Venegas
09/30/2021, 7:24 PMJulio Venegas
09/30/2021, 7:27 PMJulio Venegas
09/30/2021, 7:28 PMZanie
Julio Venegas
09/30/2021, 7:28 PMJulio Venegas
09/30/2021, 7:28 PM