Contributing to OpenFn/Lighting Environment Setup

Database setup

If your having this error

[error] Postgrex.Protocol (#PID<0.637.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (${POSTGRES_HOST}:5432): non-existing domain - :nxdomain

Make sure in your .env the DATABASE_URL is does not contain environment variables
Change this
DATABASE_URL="postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT:-5433}/${POSTGRES_DB}"
To this
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/lightning_dev"
If your database settings are like this

POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
POSTGRES_HOST=localhost
POSTGRES_PORT=5432
POSTGRES_DB="lightning_dev"
1 Like