Ddn run docker-start fails to authenticate postgres URI in local

I’m running into some issues when I try to run promptql locally. The project is running ddn 3.0 promptql with a postgresDB connection (not the promtql version) I can setup my postgres connection and introspect it using the postgres URI, and it runs successfully.

ddn connector introspect eevee_dev_db
5:55PM INF Using Subgraph config file "app/subgraph.yaml" found in context.
5:55PM INF Using localEnvFile ".env" found in context.
5:55PM INF Checking Postgres DB connectivity...
5:55PM INF Postgres DB connectivity check successful
5:56PM INF Connector data source introspected successfully
5:56PM INF Building Connector's docker image...
5:56PM INF Starting Connector's docker container to fetch schema for DataConnectorLink...
5:56PM INF Waiting for the Connector service to be healthy...
5:56PM INF Starting to stream connector logs.
Starting server on [::]:8080
5:56PM INF Connector service is healthy. Proceeding...
5:56PM INF Updating DataConnectorLink...
5:56PM INF DataConnectorLink schema already upto date
5:56PM INF DataConnectorLink updated successfully
5:56PM INF Tearing down docker container...
HINT Add all Models from the introspected schema: ddn model add eevee_dev_db "*"
HINT Add all Commands (includes Mutations) from the introspected schema: ddn command add eevee_dev_db "*"
HINT Add all Relationships from the introspected schema: ddn relationship add eevee_dev_db "*"

but when I run the project locally, the connection fails to authenticate. Here’s the error I get.

ddn run docker-start
.
.
.
otel-collector-1       | 2025-05-20T21:56:19.050Zle Watcinfo	[email protected]/service.go:219	Everything is ready. Begin running and processing data.
app_eevee_dev_db-1     | {"timestamp":"2025-05-20T21:56:19.259380Z","level":"ERROR","fields":{"message":"Initialization error","meta.signal_type":"log","event.domain":"ndc","event.name":"Initialization error","name":"Initialization error","body":"unable to initialize connection pool: error returned from database: password authentication failed for user \"quanto\"","error":true},"target":"ndc_postgres::connector"}
app_eevee_dev_db-1     | 500 Internal Server Error: unable to initialize connection pool: error returned from database: password authentication failed for user "quanto"
app_eevee_dev_db-1     | (details: null)   w Enable Watch
app_eevee_dev_db-1 exited with code 1

I can validate that my postgresURI is valid using a deno script and pgAdmin.
Also when I deploy the project to hasura cloud it has no trouble connecting to my postgresDB. Only when I try the connection locally it fails to connect.

Let me know if you need more info.

Can you share the connection string (with the credentials redacted), @ma2ran?

I have a hunch that you’re using localhost instead of local.hasura.dev. Or, there’s an issue with your .env’s value for the connection URI as it returns a password authentication error.

One thing I would recommend: since you initially created your project, we’ve released a new PostgreSQL connector with better support for PromptQL. I’d recommend—using version control—trying to initialize a new connector with hasura/postgres-promptql as the connector and using a JDBC URL.

This is my postgres URI: postgresql://quanto:**********@eevee-dev-db.cluster-c90u86m08ee9.ca-central-1.rds.amazonaws.com:5432/postgres?sslmode=prefer

This is what my .env looks like.

APP_EEVEE_DEV_DB_AUTHORIZATION_HEADER="Bearer  **********"
APP_EEVEE_DEV_DB_CONNECTION_URI="postgresql://quanto:**********@eevee-dev-db.cluster-c90u86m08ee9.ca-central-1.rds.amazonaws.com:5432/postgres?sslmode=prefer"
APP_EEVEE_DEV_DB_HASURA_CONNECTOR_PORT=4654
APP_EEVEE_DEV_DB_HASURA_SERVICE_TOKEN_SECRET="**********"
APP_EEVEE_DEV_DB_OTEL_EXPORTER_OTLP_ENDPOINT="http://local.hasura.dev:4317"
APP_EEVEE_DEV_DB_OTEL_SERVICE_NAME="app_eevee_dev_db"
APP_EEVEE_DEV_DB_READ_URL="http://local.hasura.dev:4654"
APP_EEVEE_DEV_DB_WRITE_URL="http://local.hasura.dev:4654"

I have tried using JDBC URL but I run into the same issue. Does the password need to be web encoded?

Do you have any special characters in the password? You need to use % escapes for your password since this is a URL as defined in HTML URL Encoding Reference

Do both JDBC and URI’s need to use HTML URL encoding?

Hello @ma2rn,

For the non promptql Postgresql connector, you have to use a “Postgres connection string”. From here - PostgreSQL: Documentation: 11: 34.1. Database Connection Control Functions

Percent-encoding may be used to include symbols with special meaning in any of the URI parts, e.g., replace = with %3D.

The host part may be either a host name or an IP address. To specify an IPv6 address, enclose it in square brackets:

postgresql://[2001:db8::1234]/database

The host part is interpreted as described for the parameter host. In particular, a Unix-domain socket connection is chosen if the host part is either empty or looks like an absolute path name, otherwise a TCP/IP connection is initiated. Note, however, that the slash is a reserved character in the hierarchical part of the URI. So, to specify a non-standard Unix-domain socket directory, either omit the host part of the URI and specify the host as a named parameter, or percent-encode the path in the host part of the URI:

postgresql:///dbname?host=/var/lib/postgresql
postgresql://%2Fvar%2Flib%2Fpostgresql/dbname

If you are using the promptql Postgresql connector, then you need to use a JDBC connection string. - Escaping values in the connection url