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

Connection Error: Failed to get token #21874

Closed
Marjay-Pulumbarit-Weir opened this issue Feb 8, 2023 · 8 comments · Fixed by #22140
Closed

Connection Error: Failed to get token #21874

Marjay-Pulumbarit-Weir opened this issue Feb 8, 2023 · 8 comments · Fixed by #22140

Comments

@Marjay-Pulumbarit-Weir
Copy link

Issue Type: Bug

Connection Error: Failed to get token

The error above randomly pops up, I am unable to reproduce it.

I noticed that re-authenticating to Azure solves the issue, although I didn't get the notification to re-authenticate, just a vague message that failed to get token.

Azure Data Studio version: azuredatastudio 1.33.1 (0b9ef71, 2021-11-04T17:45:15.872Z)
OS version: Windows_NT x64 10.0.19044
Restricted Mode: No

@cheenamalhotra
Copy link
Member

cheenamalhotra commented Feb 8, 2023

Hi @Marjay-Pulumbarit-Weir

We would recommend you to please update ADS to latest v1.41.1 as many improvements have been made in this area.
Let us know if you do experience the issue with latest version.

@hifni
Copy link

hifni commented Feb 14, 2023

I am too getting this error. I was happily connecting myself a few days back before I applied the update. My current ADS spec reads as:

Version: 1.41.2 (system setup)
Commit: 0f0960d
Date: 2023-02-08T20:16:49.071Z
VS Code: 1.67.0
Electron: 19.1.8
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
OS: Windows_NT x64 10.0.19045

I am able to connect with Azure AD credentials on MS Sql Server Management Studio 18 but not ADS.

@cheenamalhotra
Copy link
Member

@hifni

Can you quickly check if changing back the below setting "Azure: Authentication Library" to ADAL makes a difference?

Also please gather Azure logs and upload here to be able to identify error that occurred.

@github-actions
Copy link

We need more info to debug your Azure Active Directory issue. If you could attach your logs to the issue (ensure no private data is in them), it would help us fix the issue much faster.

  • In the settings menu, find the setting titled Azure: Logging Level and select the Verbose option
  • Run the process that produces your error
  • Open command palette (Click View -> Command Palette)
  • Run the command: Developer: Open Logs Folder
  • Follow this path to find the Azure Accounts log file: [default log folder]/exthost1/output_logging_[earliest timestamp]/#-Azure Acounts.log
  • Please attach the Azure-Accounts.log file to the issue.

@martinleo
Copy link

Switching to ADAL works in my case.
Do you guys even test before releasing? Last time you broke the "Select top 1000" option and took two months to fix it.
I normally try to not lash out at devs, and apologies for doing it now, but this seems like a hobby project at this point rather than a Microsoft product.

@gregchak
Copy link

I was having the same issue also. Changing Azure Authentication Library to ADAL fixed my issue as well. If you need logs with the setting set to MSAL please let me know and I can provide. The original post mentioned they were unable to reproduce. For me, any connection using MFA generated this error and I can readily reproduce it.

@cheenamalhotra
Copy link
Member

Azure Account Logs would help us understand the root cause. Please gather using information above and attach the same.

@gregchak
Copy link

I was able to readily reproduce, but since switching from MSAL to ADAL and then back to MSAL to send you the logs I'm no longer able to reproduce the error. I will keep on MSAL authentication and see if this pops up again. If, and hopefully when, it does I will post logs here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants