Skip to content

Produce a more actionable error on wrong JDBC URL#20052

Merged
wendigo merged 1 commit intotrinodb:masterfrom
nineinchnick:jdbc-wrong-url-error
Dec 7, 2023
Merged

Produce a more actionable error on wrong JDBC URL#20052
wendigo merged 1 commit intotrinodb:masterfrom
nineinchnick:jdbc-wrong-url-error

Conversation

@nineinchnick
Copy link
Copy Markdown
Member

Description

Currently, when using a JDBC URL with an invalid schema, a vague error like this is produced:

io.trino.spi.TrinoException: Error listing schemas for catalog xxx: com.google.common.util.concurrent.UncheckedExecutionException: java.lang.NullPointerException: Cannot invoke "java.sql.Connection.getMetaData()" because "this.delegate" is null

After #18735, the connection is wrapped in io.opentelemetry.instrumentation.jdbc.internal.OpenTelemetryConnection so it's not null when checking in https://github.com/trinodb/trino/blob/master/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/DriverConnectionFactory.java#L79, but the delegate inside this wrapper is null. The underlying JdbcDataSource should never return a null connection, since it's always used with a specific JDBC driver.

Additional context and related issues

Release notes

(x) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text:

@wendigo wendigo merged commit dc880e9 into trinodb:master Dec 7, 2023
@github-actions github-actions bot added this to the 435 milestone Dec 7, 2023
@nineinchnick nineinchnick deleted the jdbc-wrong-url-error branch May 27, 2024 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants