Skip to content

Conversation

@pingtimeout
Copy link
Contributor

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.

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 \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was removed by #1411. After #1411, the driver should be pulled by the default build. Do we need to add it here? cc @jbonofre

Copy link
Member

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.

Copy link
Contributor

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"
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

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.

Copy link
Contributor Author

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"
$
$

Copy link
Contributor Author

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.

@github-project-automation github-project-automation bot moved this from PRs In Progress to Done in Basic Kanban Board Apr 24, 2025
@pingtimeout pingtimeout deleted the patch-1 branch April 29, 2025 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants