From: driedelreply (@driedelreply) <noreply+driedelreply@github.com>
To: aws/aws-advanced-jdbc-wrapper <noreply+aws-aws-advanced-jdbc-wrapper@github.com>
Subject: [aws/aws-advanced-jdbc-wrapper] issue #2240: 4.6.0: connections through RDS Proxy are refused after the first ("RDS Proxy currently doesn't support command-line options")
Date: Sun, 15 Nov 2026 20:54:03 +0000
Message-ID: <gh-aws-aws-advanced-jdbc-wrapper-2240@github.com> (raw)
### Describe the bug
Since 4.6.0, `AuroraPgDialect.prepareConnectProperties` appends
`-c aurora.connection_str=_d:aws_jdbc_wrapper,_v:<version>,_p:<plugin codes>` to the `options` connection property
(PR #1432, CHANGELOG 4.6.0: "Added the wrapper version and effective plugin codes to Aurora PostgreSQL connection
metadata"). RDS Proxy refuses a PostgreSQL startup packet that carries command-line options, so behind an RDS Proxy
endpoint every connection made with the Aurora PostgreSQL dialect fails. There is no property to turn the option off.
The first connection of a JVM still succeeds, which hides the problem from a quick connectivity check:
`DialectManager` starts an RDS Proxy host name on `RDS_PG`, whose `prepareConnectProperties` does nothing; it then
identifies Aurora on that connection and caches `AURORA_PG` for the URL in `knownEndpointDialects`. From then on,
every new connection goes through `AuroraPgDialect.prepareConnectProperties` and is refused.
### Expected Behavior
Connections through RDS Proxy keep working as they did in 4.5.0.
### What plugins are used? What other connection properties were set?
wrapperPlugins=iam, sslmode=verify-full, sslrootcert; no wrapperDialect (detected). HikariCP pool.
### Current Behavior
The first connection succeeds. Every later connection from the same JVM fails:
```
FATAL: Feature not supported: RDS Proxy currently doesn't support command-line options.
```
### Reproduction Steps
Through RDS Proxy:
1. Aurora PostgreSQL (16.13) behind an RDS Proxy, with IAM authentication.
2. URL `jdbc:aws-wrapper:postgresql://<proxy-name>.proxy-<id>.<region>.rds.amazonaws.com:5432/<db>?wrapperPlugins=iam&sslmode=verify-full`, with no `wrapperDialect`.
3. Open and close one connection: it succeeds. Open a second one in the same JVM: it is refused with the error above.
With 4.5.0, both succeed.
Without AWS, plain PostgreSQL shows the option arriving. PostgreSQL accepts a dotted custom setting where RDS Proxy refuses it:
```java
String url = "jdbc:aws-wrapper:postgresql://localhost:5432/postgres?wrapperPlugins=&wrapperDialect=aurora-pg";
try (Connection c = DriverManager.getConnection(url, "postgres", "postgres");
ResultSet rs = c.createStatement().executeQuery("select current_setting('aurora.connection_str', true)")) {
rs.next();
System.out.println(rs.getString(1)); // 4.6.0: _d:aws_jdbc_wrapper,_v:4.6.0,_p: 4.5.0: null
}
```
### Possible Solution
Either of these would fix it:
- Do not add the option when the host is an RDS Proxy endpoint. `RdsUtils.isRdsProxyDns` already recognises those host names.
- Add a connection property that turns the connection metadata off. This also covers a proxy reached under a custom DNS name.
### Additional Information/Context
Workaround: we stay on 4.5.0. `main` still has the same code in `AuroraPgDialect`.
### The AWS Advanced JDBC Wrapper version used
4.6.0
### JDK version used
21 (AWS Lambda java21 runtime)
### Operating System and version
Amazon Linux 2023 (AWS Lambda)