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

Latest version still have bug: user account not found in MSAL cache please add linked account or refresh account credentials #23351

Closed
hhminh opened this issue Jun 8, 2023 · 9 comments

Comments

@hhminh
Copy link

hhminh commented Jun 8, 2023

I still have this bug after updating to latest version eventhough I have already follow the popup to login to Azure everytime "user account not found in MSAL cache please add linked account or refresh account credentials"

My version info is Version: 1.44.1 (system setup)
Commit: 8f53a31
Date: 2023-06-01T02:12:48.765Z
VS Code: 1.70.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

@cheenamalhotra
Copy link
Member

Hi @hhminh

Please follow steps from #23286 (comment) to resolve the error. We've fixed the issue in the insiders build, to be released in July release.

@davidwinter
Copy link

I encounted this issue on macOS also, when first trying to use Azure Data Studio (v1.44.1) - I had not previously connected to anything.

To resolve, I deleted the entire directory located at ~/Library/Application Support/azuredatastudio. I then re-authenticated with Azure, and was then able to connect.

@bard83
Copy link

bard83 commented Jun 26, 2023

Same problem on Ubuntu 22.04. Do you have also a solution for it? The one provided does not solve.
This folder ~/Library/Application Support/azuredatastudio does not exist.

@cheenamalhotra
Copy link
Member

On Linux, the home location is: /home/<username>/.config/azuredatastudio/ or ~/.config/azuredatastudio

You can also try running command: Azure Accounts: Clear Azure account token cache to clear cached tokens if needed.

@bard83
Copy link

bard83 commented Jul 6, 2023

On Linux, the home location is: /home//.config/azuredatastudio/ or ~/.config/azuredatastudio

You can also try running command: Azure Accounts: Clear Azure account token cache to clear cached tokens if needed.

Did all what you suggested, but unfortunately still the same issue.

Microsoft.Data.SqlClient.SqlException (0x80131904): User account 'sxxxx@xxxxxx.com' not found in MSAL cache, please add linked account or refresh account credentials.
 ---> System.Exception: User account 'sxxxx@xxxxxx.com' not found in MSAL cache, please add linked account or refresh account credentials.
   at Microsoft.SqlTools.Authentication.Authenticator.GetTokenAsync(AuthenticationParams params, CancellationToken cancellationToken) in /_/src/Microsoft.SqlTools.Authentication/Authenticator.cs:line 129
   at Microsoft.SqlTools.Authentication.Sql.AuthenticationProvider.AcquireTokenAsync(SqlAuthenticationParameters parameters) in /_/src/Microsoft.SqlTools.Authentication/Sql/AuthenticationProvider.cs:line 90
   at Microsoft.Data.SqlClient.SqlInternalConnectionTds.<>c__DisplayClass147_1.<<GetFedAuthToken>b__1>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.Data.SqlClient.SqlInternalConnectionTds.GetFedAuthToken(SqlFedAuthInfo fedAuthInfo)
   at Microsoft.Data.SqlClient.SqlInternalConnectionTds.GetFedAuthToken(SqlFedAuthInfo fedAuthInfo)
   at Microsoft.Data.SqlClient.SqlInternalConnectionTds.OnFedAuthInfo(SqlFedAuthInfo fedAuthInfo)
   at Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at Microsoft.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at Microsoft.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK)
   at Microsoft.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover)
   at Microsoft.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout)
   at Microsoft.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance)
   at Microsoft.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, Boolean applyTransientFaultHandling, String accessToken, DbConnectionPool pool)
   at Microsoft.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
   at Microsoft.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup, DbConnectionOptions userOptions)
   at Microsoft.Data.ProviderBase.DbConnectionFactory.<>c__DisplayClass48_0.<CreateReplaceConnectionContinuation>b__0(Task`1 _)
   at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location ---
   at Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection.ReliableSqlConnection.<>c__DisplayClass30_0.<<OpenAsync>b__0>d.MoveNext() in /_/src/Microsoft.SqlTools.ManagedBatchParser/ReliableConnection/ReliableSqlConnection.cs:line 313
--- End of stack trace from previous location ---
   at Microsoft.SqlTools.ServiceLayer.Connection.ConnectionService.TryOpenConnection(ConnectionInfo connectionInfo, ConnectParams connectionParams) in /_/src/Microsoft.SqlTools.ServiceLayer/Connection/ConnectionService.cs:line 692
ClientConnectionId:27000908-9aba-440c-b0da-f83189360ea4

@cheenamalhotra
Copy link
Member

Closing this one as duplicate of #23688 (tracked for same issue)
Please try with the latest insiders build and upload logs for investigation if issue continues to occur.

@cheenamalhotra cheenamalhotra closed this as not planned Won't fix, can't repro, duplicate, stale Jul 12, 2023
@veboddu
Copy link

veboddu commented Sep 4, 2023

Same here. Deleting the entire contents of "C:\Users---\AppData\Roaming\azuredatastudio" worked.

@gruffmeister
Copy link

Why can't you sort this out Microsoft? It's a fresh install, it should just work without jiggery pokery with file structures.

@matthew-mackarill-alc
Copy link

Can this be re opened its still and issue

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

No branches or pull requests

7 participants