Soda Core data source connection failed in CI
Soda tried to open the data source connection defined in configuration.yml and failed before any check ran. The warehouse host is unreachable, the port is wrong, or the credentials are missing in CI.
What this error means
A soda scan step ends with a connection or operational error naming the data source, with 0 checks evaluated because the scan never reached the warehouse.
[ERROR] Error occurred while executing scan.
could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?Common causes
The warehouse service is not running in CI
The database container or service was not started, so the connection is refused.
Connection details or credentials are wrong
Host, port, database, or username/password in configuration.yml do not match the CI environment, or secrets were not injected.
How to fix it
Start the warehouse and wait for it
- Add the database as a service container with a health check.
- Wait until it is ready before running the scan.
- Point the data source at the service host and port.
services:
postgres:
image: postgres:16
env: { POSTGRES_PASSWORD: postgres }
ports: ['5432:5432']
options: >-
--health-cmd "pg_isready -U postgres" --health-interval 5s
--health-timeout 5s --health-retries 10Source connection details from secrets
Interpolate host and credentials from env vars set from CI secrets so the scan connects to the right warehouse.
data_source warehouse:
type: postgres
host: ${DB_HOST}
username: ${DB_USER}
password: ${DB_PASSWORD}How to prevent it
- Gate the scan behind a warehouse readiness check.
- Keep credentials in CI secrets and interpolate them.
- Match host/port to the CI service, not localhost defaults.