Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Ybam
Helper I
Helper I

KeyPair authentication Snowflake error

Hello ! 

In December, I added the Snowflake SSH connection to my reports. However, since yesterday, I have been getting an error: "Expression.Error: ADBC: [Snowflake] 390144 (08004): JWT token is invalid. "
This error only occurs on my desktop; my colleagues have no connection issues and refreshes work fine online.
My version of PBI is 2.149.1429.0
I have uninstalled and reinstalled PBI, cleared all caches, and updated my entire PC, but nothing has changed.

If you can help me, that would be great because it's holding me back in my work.

Have a nice day !

1 ACCEPTED SOLUTION
burakkaragoz
Community Champion
Community Champion

Hi @Ybam ,

Since this issue is specific to your Desktop environment (while colleagues and the Service are working fine), this confirms the issue is local configuration, not the Snowflake account or the Key Pair itself.

The error JWT token is invalid coupled with "only on my machine" strongly points to a Time Synchronization issue or a Key Formatting issue handled by the local driver.

Here is the comprehensive troubleshooting guide, ordered from most likely to least likely.

1. The "Hidden" Culprit: System Time Skew

This is the cause 90% of the time for local JWT failures. Snowflake Key Pair authentication generates a JWT (JSON Web Token) with a very short lifespan (typically 60 seconds). If your laptop's clock is even 1 minute behind or ahead of the Snowflake server time, the token generated by Power BI will be rejected immediately as "expired" or "not yet valid."

  • Step 1: Right-click your Windows Taskbar clock > Adjust date/time.

  • Step 2: Click the Sync now button under "Synchronize your clock".

  • Step 3: Ensure "Set time automatically" and "Set time zone automatically" are ON.

  • Step 4: Restart Power BI and try again.

2. Private Key Formatting (Whitespace & Headers)

The ADBC driver (used in newer Power BI versions) is strict about how the Private Key is pasted or read. If you are copying the Private Key text directly into the Power BI connection dialog:

  • Header/Footer: Ensure the key includes the full headers: -----BEGIN ENCRYPTED PRIVATE KEY----- and -----END ENCRYPTED PRIVATE KEY-----

  • Whitespace: Sometimes copying from a text editor adds a trailing space or newline at the very end. Remove any empty lines after the footer.

  • Line Breaks: Power BI prefers the key to be a single line (without carriage returns) in the input field, OR perfectly formatted with standard PEM line breaks. Try removing line breaks to make it a one-liner string if the standard block format fails.

3. Clear "Windows Credential Manager"

Sometimes Data Source Settings > Clear Permissions inside Power BI is not enough because the OS caches the underlying artifact.

  • Close Power BI.

  • Open the Control Panel > Credential Manager.

  • Select Windows Credentials.

  • Look for any entries related to Snowflake or PowerBI. Remove them.

  • Re-open Power BI and re-enter the credentials.

4. Verify the Private Key File (If using a file path)

If your Power Query refers to a file path for the key, ensure that:

  1. The file is not locked by OneDrive syncing or Antivirus scanning.

  2. The path does not contain special characters that the ADBC driver might misinterpret.

  3. Test: Try moving the .p8 file to a simple local path like C:\Keys\rsa_key.p8 to rule out path parsing errors.

5. Fallback: Force the Legacy Connector (Diagnostic)

If the new ADBC driver (indicated by your error message) is failing due to a bug in the specific Power BI version (2.149...), you can try to force the legacy ODBC driver if you have the Snowflake ODBC driver installed on your machine.

  • In Power Query, instead of Snowflake.Databases(...), try checking if you can specify the option: Snowflake.Databases("server", "warehouse", [Implementation="ODBC"]) (Note: This might not support KeyPair natively in the UI, but helps isolate if the issue is the ADBC driver).

Summary: Start with Time Sync. It is the most common reason why a valid setup suddenly stops working on one machine while working everywhere else.


If my response resolved your query, kindly mark it as the Accepted Solution to assist others. Additionally, I would be grateful for a 'Kudos' if you found my response helpful.
This response was assisted by AI for translation and formatting purposes.

View solution in original post

4 REPLIES 4
burakkaragoz
Community Champion
Community Champion

Hi @Ybam ,

Since this issue is specific to your Desktop environment (while colleagues and the Service are working fine), this confirms the issue is local configuration, not the Snowflake account or the Key Pair itself.

The error JWT token is invalid coupled with "only on my machine" strongly points to a Time Synchronization issue or a Key Formatting issue handled by the local driver.

Here is the comprehensive troubleshooting guide, ordered from most likely to least likely.

1. The "Hidden" Culprit: System Time Skew

This is the cause 90% of the time for local JWT failures. Snowflake Key Pair authentication generates a JWT (JSON Web Token) with a very short lifespan (typically 60 seconds). If your laptop's clock is even 1 minute behind or ahead of the Snowflake server time, the token generated by Power BI will be rejected immediately as "expired" or "not yet valid."

  • Step 1: Right-click your Windows Taskbar clock > Adjust date/time.

  • Step 2: Click the Sync now button under "Synchronize your clock".

  • Step 3: Ensure "Set time automatically" and "Set time zone automatically" are ON.

  • Step 4: Restart Power BI and try again.

2. Private Key Formatting (Whitespace & Headers)

The ADBC driver (used in newer Power BI versions) is strict about how the Private Key is pasted or read. If you are copying the Private Key text directly into the Power BI connection dialog:

  • Header/Footer: Ensure the key includes the full headers: -----BEGIN ENCRYPTED PRIVATE KEY----- and -----END ENCRYPTED PRIVATE KEY-----

  • Whitespace: Sometimes copying from a text editor adds a trailing space or newline at the very end. Remove any empty lines after the footer.

  • Line Breaks: Power BI prefers the key to be a single line (without carriage returns) in the input field, OR perfectly formatted with standard PEM line breaks. Try removing line breaks to make it a one-liner string if the standard block format fails.

3. Clear "Windows Credential Manager"

Sometimes Data Source Settings > Clear Permissions inside Power BI is not enough because the OS caches the underlying artifact.

  • Close Power BI.

  • Open the Control Panel > Credential Manager.

  • Select Windows Credentials.

  • Look for any entries related to Snowflake or PowerBI. Remove them.

  • Re-open Power BI and re-enter the credentials.

4. Verify the Private Key File (If using a file path)

If your Power Query refers to a file path for the key, ensure that:

  1. The file is not locked by OneDrive syncing or Antivirus scanning.

  2. The path does not contain special characters that the ADBC driver might misinterpret.

  3. Test: Try moving the .p8 file to a simple local path like C:\Keys\rsa_key.p8 to rule out path parsing errors.

5. Fallback: Force the Legacy Connector (Diagnostic)

If the new ADBC driver (indicated by your error message) is failing due to a bug in the specific Power BI version (2.149...), you can try to force the legacy ODBC driver if you have the Snowflake ODBC driver installed on your machine.

  • In Power Query, instead of Snowflake.Databases(...), try checking if you can specify the option: Snowflake.Databases("server", "warehouse", [Implementation="ODBC"]) (Note: This might not support KeyPair natively in the UI, but helps isolate if the issue is the ADBC driver).

Summary: Start with Time Sync. It is the most common reason why a valid setup suddenly stops working on one machine while working everywhere else.


If my response resolved your query, kindly mark it as the Accepted Solution to assist others. Additionally, I would be grateful for a 'Kudos' if you found my response helpful.
This response was assisted by AI for translation and formatting purposes.

@burakkaragoz Thank you very much! Indeed, it was due to the clock synchronization!

amitchandak
Super User
Super User

@Ybam , I am assuming the issue happens on Power BI Desktop. 
And hope you have already tried -> Home -> Transform Data ->  Data Source Settings -> and clear permission, and after that provide credentials again 

On Service make sure you have access to connection. Setting -> Manager connections and Gateways -> and make sure connection is assigned to you 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak Yes, I have done this process several times. I still get the same error.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.