question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error connecting Postgres cluster on AWS

See original GitHub issue

Describe the bug After upgrading to 1.8.0.Final the Postgres DataSource fails to connect. It works against a local DB, but fails with the AWS Aurora Postgres instance. The same AWS Postgres connection from DBeaver is working fine. With Quarkus 1.5.2.Final it works.

Expected behavior We expected that the connection is successful

Actual behavior Cannot connect to the AWS Postgres instance

To Reproduce

  1. Define a datasource with the AWS Postgres instance
  2. Execute quarkus
  3. Make a connection -> Exception

Configuration

quarkus.datasource.jdbc.url=jdbc:postgresql://<aws instance>/<db name>
quarkus.datasource.db-kind=postgresql
quarkus.datasource.username=postgres
quarkus.datasource.password=postgres

Environment (please complete the following information):

  • Output of uname -a or ver: Windows 10
  • Output of java -version: 11
  • GraalVM version (if different from Java):
  • Quarkus version or git rev: 1.8.0.Final
  • Build tool (ie. output of mvnw --version or gradlew --version): mvn 3.6.3

Additional context

2020-09-09 10:23:48,977 ERROR [io.qua.application] (main) Failed to start application (with profile prod): 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)
at org.flywaydb.core.internal.jdbc.JdbcConnectionFactory.<init>(JdbcConnectionFactory.java:80)
at org.flywaydb.core.Flyway.execute(Flyway.java:453)
at org.flywaydb.core.Flyway.migrate(Flyway.java:158)
at io.quarkus.flyway.runtime.FlywayRecorder.doStartActions(FlywayRecorder.java:54)
at io.quarkus.deployment.steps.FlywayProcessor$createBeansAndStartActions-1520831253.deploy_0(FlywayProcessor$createBeansAndStartActions-1520831253.zig:80)
at io.quarkus.deployment.steps.FlywayProcessor$createBeansAndStartActions-1520831253.deploy(FlywayProcessor$createBeansAndStartActions-1520831253.zig:40)
at io.quarkus.runner.ApplicationImpl.doStart(ApplicationImpl.zig:543)
at io.quarkus.runtime.Application.start(Application.java:90)
at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:92)
at io.quarkus.runtime.Quarkus.run(Quarkus.java:61)
at io.quarkus.runtime.Quarkus.run(Quarkus.java:38)
at io.quarkus.runtime.Quarkus.run(Quarkus.java:106)
at io.quarkus.runner.GeneratedMain.main(GeneratedMain.zig:29)
Caused by: org.postgresql.util.PSQLException: The connection attempt failed.
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:315)
at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:51)
at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:225)
at org.postgresql.Driver.makeConnection(Driver.java:465)
at org.postgresql.Driver.connect(Driver.java:264)
at io.agroal.pool.ConnectionFactory.createConnection(ConnectionFactory.java:200)
at io.agroal.pool.ConnectionPool$CreateConnectionTask.call(ConnectionPool.java:419)
at io.agroal.pool.ConnectionPool$CreateConnectionTask.call(ConnectionPool.java:401)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at io.agroal.pool.util.PriorityScheduledExecutor.beforeExecute(PriorityScheduledExecutor.java:65)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1126)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.io.EOFException
at org.postgresql.core.PGStream.receiveChar(PGStream.java:443)
at org.postgresql.core.v3.ConnectionFactoryImpl.enableGSSEncrypted(ConnectionFactoryImpl.java:436)
at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:144)
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:213)
... 12 more

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
OleKsimovcommented, Sep 28, 2020

Our team has faced the same problem. We have Java 11, Postgres 11, Azure cluster, and flyway for migrations. Everything works fine for Quarkus 1.7.0 or 1.7.1, but Flyway fails to connect to datasource when the version is 1.8.0 or 1.8.1. We’ve tried to connect to remote DB and to localhost container with Postgres, it works. Something wrong happens during connection to Azure.

0reactions
wswobodacommented, Nov 11, 2020

The problem should be fixed with driver version 42.2.18. Please bump the version in one of the next releases. https://github.com/pgjdbc/pgjdbc/issues/1868

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I troubleshoot problems connecting to Amazon Aurora?
Here are common causes for issues connecting to an Amazon Aurora DB cluster or instance: The Aurora DB cluster or instance is still...
Read more >
AWS RDS - Postgres connection - Can't open instance locally
If you receive connection time-out, check your RDS subnet groups configuration to see if it includes Public subnets or mixed between Public and ......
Read more >
Creating a DB cluster and connecting to a database on an ...
Create and connect to a DB Cluster on Aurora PostgreSQL. ... each resource that you want to access it, such as the security...
Read more >
Configure production-ready PostgreSQL on AWS RDS - Prisma
If you have not yet signed up for AWS, you can do so now by following their ... This configures a PostgreSQL cluster...
Read more >
Amazon Web Services (AWS) JDBC Driver for PostgreSQL
With this knowledge, the AWS JDBC Driver for PostgreSQL can more closely monitor the database cluster status so that a connection to the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found