apache/seatunnel · error · ConnectException
Database processing error
Error message
Database processing error
What it means
PostgresOffsetContext.initialContext queries the database (e.g. current LSN / txid) to build the starting offset for the CDC stream. Any SQLException during these queries is rethrown as a generic ConnectException('Database processing error'). It indicates the offset-initialization SQL failed against the database.
Source
Thrown at seatunnel-connectors-v2/connector-cdc/connector-cdc-postgres/src/main/java/io/debezium/connector/postgresql/PostgresOffsetContext.java:332
Lsn lastCompletelyProcessedLsn) {
try {
LOGGER.info("Creating initial offset context");
final Lsn lsn = Lsn.valueOf(jdbcConnection.currentXLogLocation());
final Long txId = jdbcConnection.currentTransactionId();
LOGGER.info("Read xlogStart at '{}' from transaction '{}'", lsn, txId);
return new PostgresOffsetContext(
connectorConfig,
lsn,
lastCompletelyProcessedLsn,
lastCommitLsn,
txId,
clock.currentTimeAsInstant(),
false,
false,
new TransactionContext(),
new SignalBasedIncrementalSnapshotContext<>(false));
} catch (SQLException e) {
throw new ConnectException("Database processing error", e);
}
}
public OffsetState asOffsetState() {
return new OffsetState(
sourceInfo.lsn(),
sourceInfo.txId(),
sourceInfo.xmin(),
sourceInfo.timestamp(),
sourceInfo.isSnapshot());
}
@Override
public void markLastSnapshotRecord() {
sourceInfo.setSnapshot(SnapshotRecord.LAST);
}
@OverrideView on GitHub (pinned to cf67b549a7)
Solutions
- Verify the database is reachable and credentials are valid at startup time.
- Grant the user permission to read pg_current_wal_lsn() and related catalog tables.
- Retry the job; transient network issues during startup commonly surface here.
- Check the wrapped SQLException (cause) for the exact SQL error code.
Defensive patterns
Strategy: retry
Validate before calling
psql "postgres://user@host:5432/mydb" -c 'SELECT pg_current_wal_lsn();'
Try / catch
try {
startCdcSource(cfg);
} catch (ConnectException e) {
if ("Database processing error".equals(e.getMessage())) {
// inspect e.getCause() (SQLException) and retry with backoff
}
} Prevention
- Health-check the database before submitting the job.
- Grant catalog/function read access to the CDC user.
- Set generous connect timeouts for startup queries.
When it happens
Trigger: Thrown from initialContext when the initial offset query (SELECT on pg catalog / current LSN) throws SQLException, typically at source startup.
Common situations: Database unreachable or restarted; insufficient permissions to read replication/catalog functions; connection pool timeouts; wrong database name in the connector config.
Understand the failure class
Background: Database query failed: Internal Server Error 500s wrapping SQL, Prisma, and connection failures — what to check first — this error's family across 16 libraries.
Related errors
- Database connection failed during resolving unknown type
- Error to discover tables: ${e.getMessage()}
- Error to check tables: ${e.getMessage()}
- Read split %s error due to %s.
- Interrupted while waiting for valid replication slot info
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/eb913b9fa7cc9e81.
Report an issue: GitHub.