{"record":{"id":"cc1c138573ea1e0d","repo":"apache/seatunnel","slug":"couldn-t-initialize-type-registry","errorCode":null,"errorMessage":"Couldn't initialize type registry","messagePattern":"Couldn't initialize type registry","errorType":"exception","errorClass":"DebeziumException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-cdc/connector-cdc-postgres/src/main/java/io/debezium/connector/postgresql/TypeRegistry.java","lineNumber":145,"sourceCode":"    private int geographyOid = Integer.MIN_VALUE;\n    private int citextOid = Integer.MIN_VALUE;\n    private int hstoreOid = Integer.MIN_VALUE;\n    private int ltreeOid = Integer.MIN_VALUE;\n\n    private int hstoreArrayOid = Integer.MIN_VALUE;\n    private int geometryArrayOid = Integer.MIN_VALUE;\n    private int geographyArrayOid = Integer.MIN_VALUE;\n    private int citextArrayOid = Integer.MIN_VALUE;\n    private int ltreeArrayOid = Integer.MIN_VALUE;\n\n    public TypeRegistry(PostgresConnection connection) {\n        try {\n            this.connection = connection;\n            sqlTypeMapper = new SqlTypeMapper(this.connection);\n\n            prime();\n        } catch (SQLException e) {\n            throw new DebeziumException(\"Couldn't initialize type registry\", e);\n        }\n    }\n\n    private void addType(PostgresType type) {\n        oidToType.put(type.getOid(), type);\n        nameToType.put(type.getName(), type);\n\n        if (TYPE_NAME_GEOMETRY.equals(type.getName())) {\n            geometryOid = type.getOid();\n        } else if (TYPE_NAME_GEOGRAPHY.equals(type.getName())) {\n            geographyOid = type.getOid();\n        } else if (TYPE_NAME_CITEXT.equals(type.getName())) {\n            citextOid = type.getOid();\n        } else if (TYPE_NAME_HSTORE.equals(type.getName())) {\n            hstoreOid = type.getOid();\n        } else if (TYPE_NAME_LTREE.equals(type.getName())) {\n            ltreeOid = type.getOid();\n        } else if (TYPE_NAME_HSTORE_ARRAY.equals(type.getName())) {","sourceCodeStart":127,"sourceCodeEnd":163,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-cdc/connector-cdc-postgres/src/main/java/io/debezium/connector/postgresql/TypeRegistry.java#L127-L163","documentation":"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.","triggerScenarios":"Constructor call at connection setup: new TypeRegistry(connection) where prime()/SqlTypeMapper queries throw SQLException.","commonSituations":"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.","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."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"psql \"postgres://user@host:5432/mydb\" -c 'SELECT count(*) FROM pg_type;'","typeGuard":null,"tryCatchPattern":"try {\n  startCdcSource(cfg);\n} catch (DebeziumException e) {\n  if (e.getMessage().startsWith(\"Couldn't initialize type registry\")) {\n    // check connection health and catalog permissions via e.getCause()\n  }\n}","preventionTips":["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."],"tags":["postgres","cdc","type-registry","initialization"],"backgroundTag":"module-init-failed","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}