Search before asking
What happened
The official Docker image apache/seatunnel:latest (2.3.13) ships opengauss-jdbc-5.1.0.jar in /opt/seatunnel/lib/. This jar contains its own copy of the org.postgresql.Driver class (openGauss's JDBC driver is a fork of pgJDBC that keeps the original package names). Because both jars sit on the global classpath, the openGauss copy can hijack the class resolution for the real PostgreSQL driver (postgresql-42.4.3.jar, also in lib/).
Result: every PostgreSQL connection through the Jdbc connector fails against a standard PostgreSQL 14 server using scram-sha-256 auth:
Caused by: org.postgresql.util.PSQLException: Protocol error. Session setup failed.
Evidence that this is a jar conflict, not a network/credentials issue
All executed inside the same apache/seatunnel:latest container against the same PG 14 server (postgres:14-alpine, scram-sha-256):
- TCP reachable:
bash -c "echo > /dev/tcp/postgres/5432" — OK
- Plain JDBC with only the bundled pgJDBC on the classpath — OK:
java -cp /tmp:/opt/seatunnel/lib/postgresql-42.4.3.jar T → rows=3
- Same connection through
seatunnel.sh -m local (full lib/ classpath) — fails with "Protocol error. Session setup failed."
- Shadowing the openGauss jar with an empty file fixes it:
docker run -v /tmp/empty.jar:/opt/seatunnel/lib/opengauss-jdbc-5.1.0.jar:ro ... → job FINISHED
Jar scan confirms three jars on the image contain org/postgresql/core/v3/ConnectionFactoryImpl:
/opt/seatunnel/lib/postgresql-42.4.3.jar (real driver)
/opt/seatunnel/lib/opengauss-jdbc-5.1.0.jar (conflicting fork)
/opt/seatunnel/connectors/connector-cdc-opengauss-2.3.13.jar
What you expected to happen
PostgreSQL connections work out of the box with the official image.
Suggested fixes (either):
- move
opengauss-jdbc out of the global lib/ and load it only with the openGauss connector's classloader, or
- shade/relocate the
org.postgresql packages inside the openGauss jar.
How to reproduce
docker network create t
docker run -d --name pg --network t -e POSTGRES_USER=u -e POSTGRES_PASSWORD=p -e POSTGRES_DB=d postgres:14-alpine
# minimal config: Jdbc source url jdbc:postgresql://pg:5432/d, user u, password p, query "SELECT 1", Console sink
docker run --rm --network t -v /path/to/job.conf:/j.conf apache/seatunnel:latest \
/opt/seatunnel/bin/seatunnel.sh --config /j.conf -m local
# -> Protocol error. Session setup failed.
SeaTunnel Version
2.3.13 (apache/seatunnel:latest, digest sha256:2b1d327df210...)
SeaTunnel Config
env { parallelism = 1
job.mode = "BATCH" }
source { Jdbc {
url = "jdbc:postgresql://postgres:5432/analytics"
driver = "org.postgresql.Driver"
user = "bench"
password = "..."
query = "SELECT * FROM customers"
plugin_output = "j" } }
sink { Console { plugin_input = "j" } }
Running Command
/opt/seatunnel/bin/seatunnel.sh --config /j.conf -m local
Error Exception
Caused by: org.apache.seatunnel.api.table.factory.FactoryException: ErrorCode:[API-06], ErrorDescription:[Factory initialize failed]
Caused by: org.apache.seatunnel.api.table.catalog.exception.CatalogException: ErrorCode:[API-03], ErrorDescription:[Catalog initialize failed]
Caused by: org.postgresql.util.PSQLException: Protocol error. Session setup failed.
Zeta or Flink or Spark Version
Zeta (local mode)
Java or Scala Version
openjdk 1.8.0_342 (bundled in image)
Screenshots
No response
Are you willing to submit PR?
Code of Conduct
Search before asking
What happened
The official Docker image
apache/seatunnel:latest(2.3.13) shipsopengauss-jdbc-5.1.0.jarin/opt/seatunnel/lib/. This jar contains its own copy of theorg.postgresql.Driverclass (openGauss's JDBC driver is a fork of pgJDBC that keeps the original package names). Because both jars sit on the global classpath, the openGauss copy can hijack the class resolution for the real PostgreSQL driver (postgresql-42.4.3.jar, also inlib/).Result: every PostgreSQL connection through the Jdbc connector fails against a standard PostgreSQL 14 server using scram-sha-256 auth:
Evidence that this is a jar conflict, not a network/credentials issue
All executed inside the same
apache/seatunnel:latestcontainer against the same PG 14 server (postgres:14-alpine, scram-sha-256):bash -c "echo > /dev/tcp/postgres/5432"— OKjava -cp /tmp:/opt/seatunnel/lib/postgresql-42.4.3.jar T→rows=3seatunnel.sh -m local(fulllib/classpath) — fails with "Protocol error. Session setup failed."docker run -v /tmp/empty.jar:/opt/seatunnel/lib/opengauss-jdbc-5.1.0.jar:ro ...→ job FINISHEDJar scan confirms three jars on the image contain
org/postgresql/core/v3/ConnectionFactoryImpl:/opt/seatunnel/lib/postgresql-42.4.3.jar(real driver)/opt/seatunnel/lib/opengauss-jdbc-5.1.0.jar(conflicting fork)/opt/seatunnel/connectors/connector-cdc-opengauss-2.3.13.jarWhat you expected to happen
PostgreSQL connections work out of the box with the official image.
Suggested fixes (either):
opengauss-jdbcout of the globallib/and load it only with the openGauss connector's classloader, ororg.postgresqlpackages inside the openGauss jar.How to reproduce
SeaTunnel Version
2.3.13 (apache/seatunnel:latest, digest sha256:2b1d327df210...)
SeaTunnel Config
Running Command
Error Exception
Zeta or Flink or Spark Version
Zeta (local mode)
Java or Scala Version
openjdk 1.8.0_342 (bundled in image)
Screenshots
No response
Are you willing to submit PR?
Code of Conduct