Skip to content
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

SNOW-1903631: Unclear error message when no password set in DataSource #2055

Open
fabiencelier opened this issue Jan 30, 2025 · 5 comments
Open
Assignees
Labels
enhancement The issue is a request for improvement or a new feature status-fixed_awaiting_release The issue has been fixed, its PR merged, and now awaiting the next release cycle of the connector. status-triage_done Initial triage done, will be further handled by the driver team

Comments

@fabiencelier
Copy link
Contributor

Please answer these questions before submitting your issue.
In order to accurately debug the issue this information is required. Thanks!

  1. What version of JDBC driver are you using?

3.19.0

  1. What operating system and processor architecture are you using?

Linux - Ubuntu 24.10

  1. What version of Java are you using?

Java 21

  1. What did you do?

Create a DataSource where the password is not set.
When calling SnowflakeBasicDataSource.getConnection() the method throws as there is no password. Throwing is expected but the message is not clear as it a NullPointerException while inserting into a ConcurrentHashMap:

java.lang.NullPointerException
	at java.base/java.util.concurrent.ConcurrentHashMap.putVal(ConcurrentHashMap.java:1011)
	at java.base/java.util.concurrent.ConcurrentHashMap.put(ConcurrentHashMap.java:1006)
	at java.base/java.util.Properties.put(Properties.java:1346)
	at net.snowflake.client.jdbc.SnowflakeBasicDataSource.getConnection(SnowflakeBasicDataSource.java:103)
	at net.snowflake.client.jdbc.SnowflakeBasicDataSource.getConnection(SnowflakeBasicDataSource.java:90)
  1. What did you expect to see?

I expect a clearer error message such as

Missing password in Snowflake DataSource properties.

  1. Can you set logging to DEBUG and collect the logs?

https://community.snowflake.com/s/article/How-to-generate-log-file-on-Snowflake-connectors

@github-actions github-actions bot changed the title Unclear error message when no password set in DataSource SNOW-1903631: Unclear error message when no password set in DataSource Jan 30, 2025
@sfc-gh-dszmolka sfc-gh-dszmolka self-assigned this Jan 30, 2025
@sfc-gh-dszmolka sfc-gh-dszmolka added status-triage Issue is under initial triage status-information_needed Additional information is required from the reporter labels Jan 30, 2025
@sfc-gh-dszmolka
Copy link
Contributor

sfc-gh-dszmolka commented Jan 30, 2025

hi and thank you for raising this with us, also for your contribution in the PR #2056 ! speaking of which, since it looks like you're checking for password existence in keypair auth, which is absolutely not required .. may I ask you to please provide your connection string here, which triggers the NPE you saw ?

of course please anonymize it or replace account etc. with dummy data, but I'm curious what authentication method you're using and how exactly to get into this situation. thank you !

@sfc-gh-dszmolka
Copy link
Contributor

ah, nevermind, i missed the negation :) the team will review your PR.

@sfc-gh-dszmolka sfc-gh-dszmolka added enhancement The issue is a request for improvement or a new feature status-triage_done Initial triage done, will be further handled by the driver team and removed status-triage Issue is under initial triage status-information_needed Additional information is required from the reporter labels Jan 30, 2025
@sfc-gh-dprzybysz
Copy link
Collaborator

Hi @fabiencelier
could you provide tests in your PR?

@sfc-gh-dprzybysz sfc-gh-dprzybysz added the status-information_needed Additional information is required from the reporter label Feb 3, 2025
@sfc-gh-dszmolka sfc-gh-dszmolka removed the status-information_needed Additional information is required from the reporter label Feb 3, 2025
@sfc-gh-dprzybysz sfc-gh-dprzybysz added the status-fixed_awaiting_release The issue has been fixed, its PR merged, and now awaiting the next release cycle of the connector. label Feb 7, 2025
@sfc-gh-dprzybysz
Copy link
Collaborator

The PR is merged and will be part of the next release
thank you @fabiencelier for the contribution

@sfc-gh-dprzybysz
Copy link
Collaborator

We keep the issue open until release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement The issue is a request for improvement or a new feature status-fixed_awaiting_release The issue has been fixed, its PR merged, and now awaiting the next release cycle of the connector. status-triage_done Initial triage done, will be further handled by the driver team
Projects
None yet
Development

No branches or pull requests

4 participants