-
Notifications
You must be signed in to change notification settings - Fork 329
Add missing postgres driver in getting-started #1441
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The postgres was added as a runtimeOnly dep: https://github.com/polaris-catalog/polaris/blob/1c684d2378e923ba410f38c1c79f12130db33f94/quarkus/server/build.gradle.kts#L52-L52
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.