cloudcaptainsh / cloudcaptain

Issue Tracker for CloudCaptain
13 stars 3 forks source link

JHipster 5.5.0 cannot be deployed to aws with boxfuse. #220

Open bonsmik opened 5 years ago

bonsmik commented 5 years ago

I updated my application to JHipster 5.5.0 and now the deploy fails. I tried to generate a new application with 5.5.0 and its failing as well with the same problem:

-01a513ac41c54ce4b => 2018-10-20 06:51:51.959 2018-10-20 06:51:51.951  INFO 1021 --- [           main] com.mycompany.myapp.TesmiApp             : Starting TesmiApp on i-01a513ac41c54ce4b with PID 1021 (/app/tesmi-0.0.1-SNAPSHOT.war started by root in /app)
i-01a513ac41c54ce4b => 2018-10-20 06:51:51.969 2018-10-20 06:51:51.968  INFO 1021 --- [           main] com.mycompany.myapp.TesmiApp             : The following profiles are active: prod
i-01a513ac41c54ce4b => 2018-10-20 06:52:04.492 2018-10-20 06:52:04.489 ERROR 1021 --- [           main] com.zaxxer.hikari.pool.HikariPool        : HikariPool-1 - Exception during pool initialization.
i-01a513ac41c54ce4b => 2018-10-20 06:52:04.492
i-01a513ac41c54ce4b => 2018-10-20 06:52:04.492 org.postgresql.util.PSQLException: Could not open SSL root certificate file //.postgresql/root.crt.
i-01a513ac41c54ce4b => 2018-10-20 06:52:04.492  at org.postgresql.ssl.LibPQFactory.<init>(LibPQFactory.java:120)
i-01a513ac41c54ce4b => 2018-10-20 06:52:04.492  at org.postgresql.core.SocketFactoryFactory.getSslSocketFactory(SocketFactoryFactory.java:61)
i-01a513ac41c54ce4b => 2018-10-20 06:52:04.492  at org.postgresql.ssl.MakeSSL.convert(MakeSSL.java:33)
i-01a513ac41c54ce4b => 2018-10-20 06:52:04.492  at org.postgresql.core.v3.ConnectionFactoryImpl.enableSSL(ConnectionFactoryImpl.java:435)
...

This seems to be the error:

org.postgresql.util.PSQLException: Could not open SSL root certificate file //.postgresql/root.crt.

The commands I ran: jhipster 5.5.0 monolith app with postgresql ./gradlew -Pprod bootWar -x test boxfuse run tesmi -env=test

axelfontaine commented 5 years ago

This is due to this unfortunate change in pgjdbc: https://github.com/pgjdbc/pgjdbc/issues/1307

Adding sslfactory=org.postgresql.ssl.DefaultJavaSSLFactory to the JDBC URL should do the trick.

bonsmik commented 5 years ago

Thanks for the reply. Can I somehow adjust the parameters for jdbc url? There is a environment variable for the url, but amazon rds url ain't static so not sure how to adjust the url.

s-kin commented 5 years ago

I set JDBC Driver version like this.

        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <version>42.2.2</version>
        </dependency>

It works for me.