apache/seatunnel · error · DebeziumException
Couldn't initialize type registry
Error message
Couldn't initialize type registry
What it means
The TypeRegistry constructor primes the PostgreSQL type catalog by running catalog queries through SqlTypeMapper. A SQLException during priming is wrapped as DebeziumException('Couldn't initialize type registry'), failing connector initialization because decoding cannot proceed without the type map.
Source
Thrown at seatunnel-connectors-v2/connector-cdc/connector-cdc-postgres/src/main/java/io/debezium/connector/postgresql/TypeRegistry.java:145
private int geographyOid = Integer.MIN_VALUE;
private int citextOid = Integer.MIN_VALUE;
private int hstoreOid = Integer.MIN_VALUE;
private int ltreeOid = Integer.MIN_VALUE;
private int hstoreArrayOid = Integer.MIN_VALUE;
private int geometryArrayOid = Integer.MIN_VALUE;
private int geographyArrayOid = Integer.MIN_VALUE;
private int citextArrayOid = Integer.MIN_VALUE;
private int ltreeArrayOid = Integer.MIN_VALUE;
public TypeRegistry(PostgresConnection connection) {
try {
this.connection = connection;
sqlTypeMapper = new SqlTypeMapper(this.connection);
prime();
} catch (SQLException e) {
throw new DebeziumException("Couldn't initialize type registry", e);
}
}
private void addType(PostgresType type) {
oidToType.put(type.getOid(), type);
nameToType.put(type.getName(), type);
if (TYPE_NAME_GEOMETRY.equals(type.getName())) {
geometryOid = type.getOid();
} else if (TYPE_NAME_GEOGRAPHY.equals(type.getName())) {
geographyOid = type.getOid();
} else if (TYPE_NAME_CITEXT.equals(type.getName())) {
citextOid = type.getOid();
} else if (TYPE_NAME_HSTORE.equals(type.getName())) {
hstoreOid = type.getOid();
} else if (TYPE_NAME_LTREE.equals(type.getName())) {
ltreeOid = type.getOid();
} else if (TYPE_NAME_HSTORE_ARRAY.equals(type.getName())) {View on GitHub (pinned to cf67b549a7)
Solutions
- Check the underlying SQLException for the exact catalog query failure.
- Ensure the user can read pg_type, pg_namespace and pg_attribute.
- Verify network stability; re-run the job if the connection was transiently lost.
- Confirm the Postgres server version is supported by the bundled Debezium TypeRegistry.
Defensive patterns
Strategy: try-catch
Validate before calling
psql "postgres://user@host:5432/mydb" -c 'SELECT count(*) FROM pg_type;'
Try / catch
try {
startCdcSource(cfg);
} catch (DebeziumException e) {
if (e.getMessage().startsWith("Couldn't initialize type registry")) {
// check connection health and catalog permissions via e.getCause()
}
} Prevention
- Ensure a stable connection for the whole setup phase.
- Grant SELECT on pg_type/pg_namespace/pg_attribute to the CDC user.
- Pin a supported Postgres server version.
When it happens
Trigger: Constructor call at connection setup: new TypeRegistry(connection) where prime()/SqlTypeMapper queries throw SQLException.
Common situations: Connection dropped between JDBC connect and type-registry load; user lacks SELECT permission on pg_type/pg_namespace; unsupported Postgres version with unexpected catalog layout.
Related errors
- DataTypeChanger not reset
- Multiple DebeziumAdapters matched connector class " + connec
- Interrupted while waiting for valid replication slot info
- Unable to obtain valid replication slot. Make sure there are
- Neither confirmed_flush_lsn nor restart_lsn could be found
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/cc1c138573ea1e0d.
Report an issue: GitHub.