seatunnel icon indicating copy to clipboard operation
seatunnel copied to clipboard

Postgres-CDC causing Factory Initilize Failed Error

Open soukathit opened this issue 1 year ago • 3 comments

Hi Team,

We have deployed the SeaTunnel in the Openshift Kubernetes Cluster as per the below doc https://seatunnel.apache.org/docs/2.3.12/start-v2/kubernetes/helm

we are getting the below error when configuring the Postgres-CDC connection

ErrorCode:[API-06], ErrorDescription:[Factory initialize failed] - Unable to create a source for identifier 'Postgres-CDC'.

Any help. I checked the connectors exists in the pod

Image

The postgres is Managed Azure Postgresql Flexible server

below JSON format for submitting the job

{
  "env": {
    "execution.parallelism": 1,
    "job.mode": "STREAMING",
    "checkpoint.interval": 5000,
    "read_limit.bytes_per_second": 7000000,
    "read_limit.rows_per_second": 400
  },
  "source": {
    "Postgres-CDC": {
      "plugin_output": "test_repl_tbl1_Postgres_cdc",
      "username": "seatunnel_user",
      "password": "xxxxxxx",
      "database-names": [
        "test_replica_db"
      ],
      "schema-names": [
        "public"
      ],
      "table-names": [
        "test_replica_db.public.test_repl_tbl1"
      ],
      "url": "jdbc:postgresql://localhost:5432/test_replica_db?loggerLevel=OFF&sslmode=require"
    }
  },
  "transform": {},
  "sink": {
    "jdbc": {
      "plugin_input": "test_repl_tbl1_Postgres_cdc",
      "url": "jdbc:postgresql://localhost:5433/test_replica_db?loggerLevel=OFF&sslmode=require",
      "driver": "org.postgresql.Driver",
      "username": "replica_user_write",
      "password": "xxxxxxx",
      "generate_sink_sql": true,
      "database": "test_replica_db",
      "schema": "public",
      "tablePrefix": "sink_",
      "primary_keys": [
        "id"
      ]
    }
  }
}

soukathit avatar Oct 18 '25 15:10 soukathit

getting the below error on changing the format to json payload

{ "status": "fail", "message": "java.util.LinkedHashMap cannot be cast to java.util.ArrayList" }

soukathit avatar Oct 18 '25 16:10 soukathit

Now i am getting

Failed connecting to jdbc:postgresql://ab794cb29138:5432/test_replica_db?sslmode=require via JDBC. at org.apache.seatunnel.connectors.seatunnel.jdbc.catalog.AbstractJdbcCatalog.getConnection(AbstractJdbcCatalog.java:155) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.catalog.AbstractJdbcCatalog.open(AbstractJdbcCatalog.java:172) ~[?:?] at org.apache.seatunnel.api.table.catalog.CatalogTableUtil.lambda$getCatalogTables$0(CatalogTableUtil.java:122) ~[seatunnel-starter.jar:2.3.12] at java.util.Optional.map(Optional.java:215) ~[?:1.8.0_342]

Does Seatunnel work with Azure Postgresql?

soukathit avatar Oct 18 '25 17:10 soukathit

Issues fixed by copying the required postgresql jar files to the plugins/jdbc/lib folder

COPY postgresql-42.7.8.jar /opt/seatunnel/plugins/jdbc/lib/

soukathit avatar Oct 19 '25 14:10 soukathit