Skip to content

[Connection to a database]. ODD platform could not connect to the database that enforces SSL connection  #1702

@RamanDamayeu

Description

@RamanDamayeu

When database (for instance RDS Postgres with parameter rds.force_ssl = 1) enforces to use SSL connection the migration scripts work fine but ODD Platform could not reach the database with error:

2024-09-01T16:49:43.490Z ERROR 1 --- [tor-tcp-epoll-1] o.o.o.c.exception.ControllerAdvice : Internal server error

org.springframework.dao.DataAccessResourceFailureException: Failed to obtain R2DBC Connection

at org.springframework.r2dbc.connection.ConnectionFactoryUtils.lambda$getConnection$0(ConnectionFactoryUtils.java:90) ~[spring-r2dbc-6.0.9.jar:6.0.9]

Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:

Error has been observed at the following site(s):

*__checkpoint ⇢ Handler org.opendatadiscovery.oddplatform.controller.IngestionController#createDataSource(Mono, ServerWebExchange) [DispatcherHandler]

Original Stack Trace:

at org.springframework.r2dbc.connection.ConnectionFactoryUtils.lambda$getConnection$0(ConnectionFactoryUtils.java:90) ~[spring-r2dbc-6.0.9.jar:6.0.9]
...
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-common-4.1.92.Final.jar:4.1.92.Final]

at java.base/java.lang.Thread.run(Thread.java:833) ~[na:na]

Caused by: io.r2dbc.postgresql.ExceptionFactory$PostgresqlAuthenticationFailure: no pg_hba.conf entry for host "{redacted}", user "{redacted}", database "{redacted}", no encryption

at io.r2dbc.postgresql.ExceptionFactory.createException(ExceptionFactory.java:86) ~[r2dbc-postgresql-1.0.1.RELEASE.jar:1.0.1.RELEASE]

at io.r2dbc.postgresql.ExceptionFactory.createException(ExceptionFactory.java:65) ~[r2dbc-postgresql-1.0.1.RELEASE.jar:1.0.1.RELEASE]

at io.r2dbc.postgresql.ExceptionFactory.handleErrorResponse(ExceptionFactory.java:132) ~[r2dbc-postgresql-1.0.1.RELEASE.jar:1.0.1.RELEASE]
...

Workaround to set rds.force_ssl = 0 in case of RDS.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions