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-1808401: Issue while reading private key from azure functions configs #1060

Open
hemantkadam03 opened this issue Nov 15, 2024 · 1 comment
Assignees
Labels
question Issue is a usage/other question rather than a bug status-information_needed Additional information is required from the reporter status-triage Issue is under initial triage

Comments

@hemantkadam03
Copy link

hemantkadam03 commented Nov 15, 2024

I always get below exception when my azure serverless application reads private key and tries to connect to snowflake.

Error: Could not read private key with value passed in connection string. \n Error : incorrect private key value or private key format: use "\n" for newlines and double the equals sign. SqlState: , VendorCode: 270052, QueryId: : System.NullReferenceException: Object reference not set to an instance of an object.

I have tried adding "\n" and double equal signs in my privatekey but still not working. Strange thing is same connection string with private key works fine, if i run serverless application locally in visual studio on my windows laptop. below is sample snowflake connection string which i am coufiguring in cloud service.

account=accountName;ROLE=roleName;user=userName;AUTHENTICATOR=snowflake_jwt;PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\nASDASDASDjkhkjhASDASDkjhkjj\najhgsdjhasgdhjasdASDASDASDajshdjhsaasdas\njkashdkhjsk\n83798324jksdfhkjsdfv7jXxSXsY4xW\n-----END PRIVATE KEY-----\n";schema=schemaName;db=dbName;

Can you please suggest any solution to this. i did connect with snowflake team but they mention as request is not reaching to snowflake so it means the issue is with .net driver which is Snowflake.Data V2.2.0

Please answer these questions before submitting your issue.

In order to accurately debug the issue this information is required. Thanks!

  1. What version of .NET driver are you using?
    Snoeflake.Data V 2.2.0

  2. What operating system and processor architecture are you using?
    linux

  3. What version of .NET framework are you using?
    .net 8.0

  4. What did you do?

  5. What did you expect to see?

    it should accept the snowflake connection string with private key and then connect to snowflake

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

Error: Could not read private key with value passed in connection string. \n Error : incorrect private key value or private key format: use "\n" for newlines and double the equals sign. SqlState: , VendorCode: 270052, QueryId: : System.NullReferenceException: Object reference not set to an instance of an object.
https://community.snowflake.com/s/article/How-to-generate-log-file-on-Snowflake-connectors

There is an example in READMD.md file showing you how to enable logging.

Before sharing any information, please be sure to review the log and remove any sensitive
information.

@github-actions github-actions bot changed the title Issue while reading private key from azure functions configs SNOW-1808401: Issue while reading private key from azure functions configs Nov 15, 2024
@sfc-gh-dszmolka
Copy link
Contributor

hi, thanks for raising this issue. So Snowflake.Data 2.2.0 is very old and several bugfixes were introduced since it was released. Do you think it would be possible to try with the latest version?

Also can you please give me the case number you had with Snowflake Support where the advice was to raise the issue here ?

@sfc-gh-dszmolka sfc-gh-dszmolka self-assigned this Nov 18, 2024
@sfc-gh-dszmolka sfc-gh-dszmolka added question Issue is a usage/other question rather than a bug status-triage Issue is under initial triage status-information_needed Additional information is required from the reporter and removed bug labels Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Issue is a usage/other question rather than a bug status-information_needed Additional information is required from the reporter status-triage Issue is under initial triage
Projects
None yet
Development

No branches or pull requests

2 participants