Add missing postgres driver in getting-started#1441
Add missing postgres driver in getting-started#1441pingtimeout wants to merge 1 commit intoapache:mainfrom
Conversation
When Polaris is built using the provided command, the docker-compose deployment cannot start given that the postgresql driver is not bundled in the Docker image. The following error can be seen during the bootstrap operation. ``` polaris-bootstrap-1 | Caused by: java.sql.SQLException: No suitable driver found for jdbc:postgresql://postgres:5432/POLARIS polaris-bootstrap-1 | at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:708) polaris-bootstrap-1 | at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:191) polaris-bootstrap-1 | at org.eclipse.persistence.sessions.DefaultConnector.connect(DefaultConnector.java:102) polaris-bootstrap-1 | ... 40 more polaris-bootstrap-1 | Bootstrap encountered errors during operation. polaris-bootstrap-1 | 2025-04-24 08:29:53,602 INFO [io.quarkus] (main) Apache Polaris Admin Tool (incubating) stopped in 0.003s ``` The `-PeclipseLinkDeps=org.postgresql:postgresql:42.7.4` must be used at build time so that the postgres driver is included in the docker image. This commit addresses that.
| :polaris-quarkus-server:quarkusAppPartsBuild --rerun \ | ||
| :polaris-quarkus-admin:assemble \ | ||
| :polaris-quarkus-admin:quarkusAppPartsBuild --rerun \ | ||
| -PeclipseLinkDeps=org.postgresql:postgresql:42.7.5 \ |
There was a problem hiding this comment.
I agree with @flyrain : PostgreSQL JDBC driver is now embedded by default. So, no need to add it.
There was a problem hiding this comment.
I think the problem would be gradle doesn't package the runtimeonly dependencies. We may add a task like this.
tasks.register('copyRuntimeLibs', Copy) {
from configurations.runtimeClasspath
into "$buildDir/libs/runtime"
}
There was a problem hiding this comment.
There was a problem hiding this comment.
Yup, good catch. It's enough for the "distributions" (I checked on the 0.10.0-beta-incubating release, and PostgreSQL driver is included in the distribution). But probably need extra for "started guide" packages.
There was a problem hiding this comment.
Oooooh that's a nasty one. @jbonofre I can confirm that the polaris image is fine and has the postgres driver. However the polaris-admin-tool does not.
$ docker run --rm --entrypoint /bin/bash apache/polaris:postgres-latest -c "find /deployments/ -name '*.jar' | grep postgres"
/deployments/lib/main/org.postgresql.postgresql-42.7.5.jar
$ docker run --rm --entrypoint /bin/bash apache/polaris-admin-tool:postgres-latest -c "find /deployments/ -name '*.jar' | grep postgres"
$
$
There was a problem hiding this comment.
I have opened #1447 to fix the build. Closing this PR as it is not the right solution.
When Polaris is built using the provided command, the docker-compose deployment cannot start given that the postgresql driver is not bundled in the Docker image. The following error can be seen during the bootstrap operation.
The
-PeclipseLinkDeps=org.postgresql:postgresql:42.7.4must be used at build time so that the postgres driver is included in the docker image. This commit addresses that.