Troubleshooting
Connection Issuesβ
Cannot connect to ScramDBβ
psql: error: connection to server on "localhost" (127.0.0.1), port 5432 failed: Connection refused
Solutions:
- Check that the container is running:
docker ps | grep scramdb - Check the logs:
docker logs scramdb - Verify the port mapping:
docker port scramdb - If port 5432 is already in use (for example by PostgreSQL), map ScramDB to a different port:
-p 5433:5432 - Check whether the process is actually up without needing a PostgreSQL client:
curl http://127.0.0.1:9090/healthreturnsokonce the server is accepting connections. This also works as a KuberneteshttpGetliveness or readiness probe.
Connection reset during a long queryβ
If a client drops long-running queries, the timeout is almost always on the client side, not in ScramDB. Raise your driver's statement or socket timeout (for example statement_timeout in psql, or the equivalent option in your connection library) and retry.
Startup Issuesβ
ScramDB won't start: cluster mode requires an Enterprise licenseβ
cluster mode requires an Enterprise license (multi-node clustering is an Enterprise-only
capability); this node's license resolved to Community - ...
Multi-node clustering is an Enterprise (or Trial) capability. A node checks its license before it binds any port whenever its config has a [cluster] section, and a Community node refuses to start rather than boot in a degraded or single-node mode. Fix it one of two ways:
- Set
SCRAMDB_LICENSE_KEY(orlicense_keyunder[general]) to a valid Enterprise or Trial key on every node in the cluster. - Remove
[cluster]from the config entirely if you only need a single node; single-node ScramDB has no license gate.
See Clustering.
ScramDB won't start: unknown configuration keyβ
An unrecognized top-level key in the TOML file is a hard parse error, not a silently ignored typo. ScramDB stops at startup rather than run with a config it can't fully account for. The startup log names the offending key; the usual cause is a typo, or a key that has moved under a section (for example a flat key that now belongs under [general]). See Configuration for the current section layout.
Docker cluster mode fails to start: "NODE_NAME set but ADVERTISE_ADDR unset" (or similar)β
The container's entrypoint script looks at NODE_NAME, ADVERTISE_ADDR, and SEEDS together: all three unset starts single-node mode, all three set starts cluster mode, and any partial combination is a hard failure with a message naming exactly which variables are set and which are missing. It is not a fallback to single-node. Set all three, or none.
Data Issuesβ
Writes fail with SQLSTATE 25006 ("read_only_sql_transaction")β
ERROR: data size exceeds Community edition limit (64 GiB); node is read-only; reads and export remain available
HINT: Reads and COPY TO/export remain available; free space or upgrade to Enterprise to restore write access.
The Community edition caps stored data at 64 GiB. A background check samples total data size roughly once a second; the moment stored data exceeds the cap, the node flips read-only for INSERT, UPDATE, DELETE, MERGE, TRUNCATE, and COPY FROM. SELECT, other reads, and COPY TO / export are never affected, so the node stays fully readable while over the cap.
This is the same SQLSTATE (25006) PostgreSQL itself returns from a hot-standby replica that rejects a write, so most drivers and pools already have retry or error-classification logic that recognizes it.
Recovery is automatic: if stored data drops back under the cap (drop data, TRUNCATE, let retention or compaction reclaim space), the next sample flips the node back to writable, no restart or manual unlock needed. To stay above the cap and keep writing, an Enterprise or Trial license removes the ceiling entirely (SCRAMDB_LICENSE_KEY or license_key; see Configuration).
Data not persisted after a container restartβ
Mount a volume so your data survives the container:
docker run -v scramdb-data:/var/lib/scramdb scramdb/scramdb:latest
Recovery after a crashβ
ScramDB uses a write-ahead log for crash recovery. After an unclean shutdown it automatically replays the log on startup to restore a consistent state, then continues serving. If recovery cannot complete, ScramDB stops with the reason in its logs rather than starting in a partial state.
To recover to a specific point in time instead of just the latest consistent state, use the scramdb restore CLI. The shipped Docker image archives its write-ahead log by default ([storage.wal.archive] enabled = true), so a backup taken with scramdb backup plus the archived WAL is enough to restore to any point after the backup. See Backup and restore (PITR).
Performance Issuesβ
Queries are slowβ
-
The first run of a query shape is slower. ScramDB compiles each new query shape to native machine code the first time it runs, then reuses that code. Run the same shape again and it takes the compiled path.
-
Give queries enough memory. If the buffer pool is too small, hot pages get evicted and re-read from disk. Raise
buffer_pool_size_bytes(orbuffer_pool_percent) in the[storage]section of your config file, and the per-operator budgets in[storage.memory]. See Configuration. -
Check the worker count. By default ScramDB uses every available core. If you have capped it, make sure
workersin the[execution]section matches the cores you want queries to use. -
Look at the plan. Run
EXPLAIN ANALYZE <query>to see where the time actually goes, then add an index on the columns you filter or join on.
High memory usageβ
ScramDB uses memory mainly for:
- The buffer pool: cached data pages, sized by
buffer_pool_size_bytesorbuffer_pool_percent. - Query execution: hash tables and sort buffers built while a query runs, bounded by the budgets in
[storage.memory].
To use less memory, lower the buffer pool size and the [storage.memory] budgets in your config file. In a container, --memory also bounds these automatically when you use the percent-based keys, since sizing reads the cgroup limit. See Configuration.