pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #16641: Postgresql driver 42.2.15 and 42.2.16 has problems connecting to AWS RDS Postgresql database
3+ messages / 3 participants
[nested] [flat]

* BUG #16641: Postgresql driver 42.2.15 and 42.2.16 has problems connecting to AWS RDS Postgresql database
@ 2020-09-29 09:57 PG Bug reporting form <noreply@postgresql.org>
  2020-10-01 23:04 ` Re: BUG #16641: Postgresql driver 42.2.15 and 42.2.16 has problems connecting to AWS RDS Postgresql database Dave Cramer <davecramer@postgres.rocks>
  0 siblings, 1 reply; 3+ messages in thread

From: PG Bug reporting form @ 2020-09-29 09:57 UTC (permalink / raw)
  To: pgsql-bugs@lists.postgresql.org; +Cc: frjtrifork@gmail.com

The following bug has been logged on the website:

Bug reference:      16641
Logged by:          Flemming Jønsson
Email address:      frjtrifork@gmail.com
PostgreSQL version: 10.7
Operating system:   AWS RDS Serverless
Description:        

I have a Spring Boot application in production in AWS Elastic Container
Service.

With Spring Boot 2.3.3 the postgresql driver 42.2.14 is used and the
application connects without issues to the AWS RDS serverless postgresql
10.7 engine.
I know you support 10.14 currently, but 10.7 is the latest postgresql
version that can be configured in RDS serverless - so I'm hoping it is ok to
file this issue.

After upgrading to Spring Boot 2.3.4 the postgresql driver 42.2.16 was
included and our application could no longer connect to RDS.
We consistently get this stacktrace on startup with 42.2.16 (for the record
42.2.15 seem to produce the same stacktrace):

Caused by: org.flywaydb.core.internal.exception.FlywaySqlException:
--
  | Unable to obtain connection from database: The connection attempt
failed.
  |
-------------------------------------------------------------------------
  | SQL State : 08001
  | Error Code : 0
  | Message : The connection attempt failed.
  | at
org.flywaydb.core.internal.jdbc.JdbcUtils.openConnection(JdbcUtils.java:65)
~[flyway-core-6.4.4.jar:na]
  | at
org.flywaydb.core.internal.jdbc.JdbcConnectionFactory.<init>(JdbcConnectionFactory.java:80)
~[flyway-core-6.4.4.jar:na]
  | at org.flywaydb.core.Flyway.execute(Flyway.java:456)
~[flyway-core-6.4.4.jar:na]
  | at org.flywaydb.core.Flyway.migrate(Flyway.java:159)
~[flyway-core-6.4.4.jar:na]
  | at
org.springframework.boot.autoconfigure.flyway.FlywayMigrationInitializer.afterPropertiesSet(FlywayMigrationInitializer.java:65)
~[spring-boot-autoconfigure-2.3.4.RELEASE.jar:2.3.4.RELEASE]
  | at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1853)
~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
  | at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1790)
~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
  | ... 27 common frames omitted
  | Caused by: org.postgresql.util.PSQLException: The connection attempt
failed.
  | at
org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:315)
~[postgresql-42.2.16.jar:42.2.16]
  | at
org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:51)
~[postgresql-42.2.16.jar:42.2.16]
  | at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:225)
~[postgresql-42.2.16.jar:42.2.16]
  | at org.postgresql.Driver.makeConnection(Driver.java:465)
~[postgresql-42.2.16.jar:42.2.16]
  | at org.postgresql.Driver.connect(Driver.java:264)
~[postgresql-42.2.16.jar:42.2.16]
  | at
com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:138)
~[HikariCP-3.4.5.jar:na]
  | at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:358)
~[HikariCP-3.4.5.jar:na]
  | at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:206)
~[HikariCP-3.4.5.jar:na]
  | at
com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:477)
~[HikariCP-3.4.5.jar:na]
  | at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:560)
~[HikariCP-3.4.5.jar:na]
  | at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:115)
~[HikariCP-3.4.5.jar:na]
  | at
com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112)
~[HikariCP-3.4.5.jar:na]
  | at
org.flywaydb.core.internal.jdbc.JdbcUtils.openConnection(JdbcUtils.java:56)
~[flyway-core-6.4.4.jar:na]
  | ... 33 common frames omitted
  | Caused by: java.io.EOFException: null
  | at org.postgresql.core.PGStream.receiveChar(PGStream.java:443)
~[postgresql-42.2.16.jar:42.2.16]
  | at
org.postgresql.core.v3.ConnectionFactoryImpl.enableGSSEncrypted(ConnectionFactoryImpl.java:436)
~[postgresql-42.2.16.jar:42.2.16]
  | at
org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:144)
~[postgresql-42.2.16.jar:42.2.16]
  | at
org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:213)
~[postgresql-42.2.16.jar:42.2.16]
  | ... 45 common frames omitted


If I upgrade to Spring Boot 2.3.4 and force the postgresql driver to stay at
42.2.14 our application works nicely in AWS ECS and connects to the
serverless RDS Postgresql database without problems.
I filed a workaround for Spring Boot maven in the Spring Boot issue tracker
here https://github.com/spring-projects/spring-boot/issues/23523 

Is this above stack trace a known feature when using the latest driver
against RDS serverless that is 'stuck' at 10.7 engine - or is it something
that can be fixed?

/Flemming



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: BUG #16641: Postgresql driver 42.2.15 and 42.2.16 has problems connecting to AWS RDS Postgresql database
  2020-09-29 09:57 BUG #16641: Postgresql driver 42.2.15 and 42.2.16 has problems connecting to AWS RDS Postgresql database PG Bug reporting form <noreply@postgresql.org>
@ 2020-10-01 23:04 ` Dave Cramer <davecramer@postgres.rocks>
  2020-10-02 05:22   ` Re: BUG #16641: Postgresql driver 42.2.15 and 42.2.16 has problems connecting to AWS RDS Postgresql database Flemming Rene Jønsson <frj@trifork.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Dave Cramer @ 2020-10-01 23:04 UTC (permalink / raw)
  To: frjtrifork@gmail.com; pgsql-bugs@lists.postgresql.org

On Tue, 29 Sep 2020 at 06:16, PG Bug reporting form <noreply@postgresql.org>
wrote:

> The following bug has been logged on the website:
>
> Bug reference:      16641
> Logged by:          Flemming Jønsson
> Email address:      frjtrifork@gmail.com
> PostgreSQL version: 10.7
> Operating system:   AWS RDS Serverless
> Description:
>
> I have a Spring Boot application in production in AWS Elastic Container
> Service.
>
> With Spring Boot 2.3.3 the postgresql driver 42.2.14 is used and the
> application connects without issues to the AWS RDS serverless postgresql
> 10.7 engine.
> I know you support 10.14 currently, but 10.7 is the latest postgresql
> version that can be configured in RDS serverless - so I'm hoping it is ok
> to
> file this issue.
>
> After upgrading to Spring Boot 2.3.4 the postgresql driver 42.2.16 was
> included and our application could no longer connect to RDS.
> We consistently get this stacktrace on startup with 42.2.16 (for the record
> 42.2.15 seem to produce the same stacktrace):
>
> Caused by: org.flywaydb.core.internal.exception.FlywaySqlException:
> --
>   | Unable to obtain connection from database: The connection attempt
> failed.
>   |
> -------------------------------------------------------------------------
>   | SQL State : 08001
>   | Error Code : 0
>   | Message : The connection attempt failed.
>   | at
> org.flywaydb.core.internal.jdbc.JdbcUtils.openConnection(JdbcUtils.java:65)
> ~[flyway-core-6.4.4.jar:na]
>   | at
>
> org.flywaydb.core.internal.jdbc.JdbcConnectionFactory.<init>(JdbcConnectionFactory.java:80)
> ~[flyway-core-6.4.4.jar:na]
>   | at org.flywaydb.core.Flyway.execute(Flyway.java:456)
> ~[flyway-core-6.4.4.jar:na]
>   | at org.flywaydb.core.Flyway.migrate(Flyway.java:159)
> ~[flyway-core-6.4.4.jar:na]
>   | at
>
> org.springframework.boot.autoconfigure.flyway.FlywayMigrationInitializer.afterPropertiesSet(FlywayMigrationInitializer.java:65)
> ~[spring-boot-autoconfigure-2.3.4.RELEASE.jar:2.3.4.RELEASE]
>   | at
>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1853)
> ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
>   | at
>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1790)
> ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
>   | ... 27 common frames omitted
>   | Caused by: org.postgresql.util.PSQLException: The connection attempt
> failed.
>   | at
>
> org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:315)
> ~[postgresql-42.2.16.jar:42.2.16]
>   | at
>
> org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:51)
> ~[postgresql-42.2.16.jar:42.2.16]
>   | at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:225)
> ~[postgresql-42.2.16.jar:42.2.16]
>   | at org.postgresql.Driver.makeConnection(Driver.java:465)
> ~[postgresql-42.2.16.jar:42.2.16]
>   | at org.postgresql.Driver.connect(Driver.java:264)
> ~[postgresql-42.2.16.jar:42.2.16]
>   | at
>
> com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:138)
> ~[HikariCP-3.4.5.jar:na]
>   | at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:358)
> ~[HikariCP-3.4.5.jar:na]
>   | at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:206)
> ~[HikariCP-3.4.5.jar:na]
>   | at
> com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:477)
> ~[HikariCP-3.4.5.jar:na]
>   | at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:560)
> ~[HikariCP-3.4.5.jar:na]
>   | at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:115)
> ~[HikariCP-3.4.5.jar:na]
>   | at
> com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112)
> ~[HikariCP-3.4.5.jar:na]
>   | at
> org.flywaydb.core.internal.jdbc.JdbcUtils.openConnection(JdbcUtils.java:56)
> ~[flyway-core-6.4.4.jar:na]
>   | ... 33 common frames omitted
>   | Caused by: java.io.EOFException: null
>   | at org.postgresql.core.PGStream.receiveChar(PGStream.java:443)
> ~[postgresql-42.2.16.jar:42.2.16]
>   | at
>
> org.postgresql.core.v3.ConnectionFactoryImpl.enableGSSEncrypted(ConnectionFactoryImpl.java:436)
> ~[postgresql-42.2.16.jar:42.2.16]
>   | at
>
> org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:144)
> ~[postgresql-42.2.16.jar:42.2.16]
>   | at
>
> org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:213)
> ~[postgresql-42.2.16.jar:42.2.16]
>   | ... 45 common frames omitted
>
>
> If I upgrade to Spring Boot 2.3.4 and force the postgresql driver to stay
> at
> 42.2.14 our application works nicely in AWS ECS and connects to the
> serverless RDS Postgresql database without problems.
> I filed a workaround for Spring Boot maven in the Spring Boot issue tracker
> here https://github.com/spring-projects/spring-boot/issues/23523
>
> Is this above stack trace a known feature when gssEncMode=disabl the
> latest driver
> against RDS serverless that is 'stuck' at 10.7 engine - or is it something
> that can be fixed?
>
> /Flemming
>
>
Well the problem is that the driver attempts to make a GSS encrypted
connection and AWS doesn't adhere to the PostgreSQL protocol.

You can add gssEncMode=disable to the connection and the driver will not
attempt the encrypted connection.
We will be releasing shortly a version which does not default to attempting
the gssEncMode.
You really should be filing this but with Amazon as their product does not
adhere to the PostgreSQL protocol


Dave

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: BUG #16641: Postgresql driver 42.2.15 and 42.2.16 has problems connecting to AWS RDS Postgresql database
  2020-09-29 09:57 BUG #16641: Postgresql driver 42.2.15 and 42.2.16 has problems connecting to AWS RDS Postgresql database PG Bug reporting form <noreply@postgresql.org>
  2020-10-01 23:04 ` Re: BUG #16641: Postgresql driver 42.2.15 and 42.2.16 has problems connecting to AWS RDS Postgresql database Dave Cramer <davecramer@postgres.rocks>
@ 2020-10-02 05:22   ` Flemming Rene Jønsson <frj@trifork.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Flemming Rene Jønsson @ 2020-10-02 05:22 UTC (permalink / raw)
  To: Dave Cramer <davecramer@postgres.rocks>; +Cc: frjtrifork@gmail.com <frjtrifork@gmail.com>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>

Hi Dave
Thank you for the feedback, that sounds very plausible.
I will file the bug with the AWS RDS team today. Good to know the default setting will change in the next release.

Flemming

Den 2. okt. 2020 kl. 01.05 skrev Dave Cramer <davecramer@postgres.rocks>:




On Tue, 29 Sep 2020 at 06:16, PG Bug reporting form <noreply@postgresql.org<mailto:noreply@postgresql.org>> wrote:
The following bug has been logged on the website:

Bug reference:      16641
Logged by:          Flemming Jønsson
Email address:      frjtrifork@gmail.com<mailto:frjtrifork@gmail.com>
PostgreSQL version: 10.7
Operating system:   AWS RDS Serverless
Description:

I have a Spring Boot application in production in AWS Elastic Container
Service.

With Spring Boot 2.3.3 the postgresql driver 42.2.14 is used and the
application connects without issues to the AWS RDS serverless postgresql
10.7 engine.
I know you support 10.14 currently, but 10.7 is the latest postgresql
version that can be configured in RDS serverless - so I'm hoping it is ok to
file this issue.

After upgrading to Spring Boot 2.3.4 the postgresql driver 42.2.16 was
included and our application could no longer connect to RDS.
We consistently get this stacktrace on startup with 42.2.16 (for the record
42.2.15 seem to produce the same stacktrace):

Caused by: org.flywaydb.core.internal.exception.FlywaySqlException:
--
  | Unable to obtain connection from database: The connection attempt
failed.
  |
-------------------------------------------------------------------------
  | SQL State : 08001
  | Error Code : 0
  | Message : The connection attempt failed.
  | at
org.flywaydb.core.internal.jdbc.JdbcUtils.openConnection(JdbcUtils.java:65)
~[flyway-core-6.4.4.jar:na]
  | at
org.flywaydb.core.internal.jdbc.JdbcConnectionFactory.<init>(JdbcConnectionFactory.java:80)
~[flyway-core-6.4.4.jar:na]
  | at org.flywaydb.core.Flyway.execute(Flyway.java:456)
~[flyway-core-6.4.4.jar:na]
  | at org.flywaydb.core.Flyway.migrate(Flyway.java:159)
~[flyway-core-6.4.4.jar:na]
  | at
org.springframework.boot.autoconfigure.flyway.FlywayMigrationInitializer.afterPropertiesSet(FlywayMigrationInitializer.java:65)
~[spring-boot-autoconfigure-2.3.4.RELEASE.jar:2.3.4.RELEASE]
  | at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1853)
~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
  | at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1790)
~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
  | ... 27 common frames omitted
  | Caused by: org.postgresql.util.PSQLException: The connection attempt
failed.
  | at
org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:315)
~[postgresql-42.2.16.jar:42.2.16]
  | at
org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:51)
~[postgresql-42.2.16.jar:42.2.16]
  | at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:225)
~[postgresql-42.2.16.jar:42.2.16]
  | at org.postgresql.Driver.makeConnection(Driver.java:465)
~[postgresql-42.2.16.jar:42.2.16]
  | at org.postgresql.Driver.connect(Driver.java:264)
~[postgresql-42.2.16.jar:42.2.16]
  | at
com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:138)
~[HikariCP-3.4.5.jar:na]
  | at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:358)
~[HikariCP-3.4.5.jar:na]
  | at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:206)
~[HikariCP-3.4.5.jar:na]
  | at
com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:477)
~[HikariCP-3.4.5.jar:na]
  | at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:560)
~[HikariCP-3.4.5.jar:na]
  | at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:115)
~[HikariCP-3.4.5.jar:na]
  | at
com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112)
~[HikariCP-3.4.5.jar:na]
  | at
org.flywaydb.core.internal.jdbc.JdbcUtils.openConnection(JdbcUtils.java:56)
~[flyway-core-6.4.4.jar:na]
  | ... 33 common frames omitted
  | Caused by: java.io.EOFException: null
  | at org.postgresql.core.PGStream.receiveChar(PGStream.java:443)
~[postgresql-42.2.16.jar:42.2.16]
  | at
org.postgresql.core.v3.ConnectionFactoryImpl.enableGSSEncrypted(ConnectionFactoryImpl.java:436)
~[postgresql-42.2.16.jar:42.2.16]
  | at
org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:144)
~[postgresql-42.2.16.jar:42.2.16]
  | at
org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:213)
~[postgresql-42.2.16.jar:42.2.16]
  | ... 45 common frames omitted


If I upgrade to Spring Boot 2.3.4 and force the postgresql driver to stay at
42.2.14 our application works nicely in AWS ECS and connects to the
serverless RDS Postgresql database without problems.
I filed a workaround for Spring Boot maven in the Spring Boot issue tracker
here https://github.com/spring-projects/spring-boot/issues/23523

Is this above stack trace a known feature when gssEncMode=disabl the latest driver
against RDS serverless that is 'stuck' at 10.7 engine - or is it something
that can be fixed?

/Flemming


Well the problem is that the driver attempts to make a GSS encrypted connection and AWS doesn't adhere to the PostgreSQL protocol.

You can add gssEncMode=disable to the connection and the driver will not attempt the encrypted connection.
We will be releasing shortly a version which does not default to attempting the gssEncMode.
You really should be filing this but with Amazon as their product does not adhere to the PostgreSQL protocol


Dave


^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2020-10-02 05:22 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-09-29 09:57 BUG #16641: Postgresql driver 42.2.15 and 42.2.16 has problems connecting to AWS RDS Postgresql database PG Bug reporting form <noreply@postgresql.org>
2020-10-01 23:04 ` Dave Cramer <davecramer@postgres.rocks>
2020-10-02 05:22   ` Flemming Rene Jønsson <frj@trifork.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox