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

Unidentified error with azure authentication #16655

Closed
garyamorris opened this issue Aug 10, 2021 · 12 comments
Closed

Unidentified error with azure authentication #16655

garyamorris opened this issue Aug 10, 2021 · 12 comments

Comments

@garyamorris
Copy link

garyamorris commented Aug 10, 2021

  • Azure Data Studio Version: 1.31.1
  • OS Version: Windows_NT x64 10.0.18363

Steps to Reproduce:

  1. Sign in to Azure.....
  2. Follow on screen instructions
  3. Get the error

Does this issue occur when all extensions are disabled?: Yes

[2021-08-10 10:08:47.876] [renderer1] [debug] Read accounts from memento [] [2021-08-10 10:08:47.878] [renderer1] [error] Cannot read property 'accountType' of undefined: TypeError: Cannot read property 'accountType' of undefined at Ho.renderElement (file:///C:/Program Files/Azure Data Studio/resources/app/out/vs/workbench/workbench.desktop.main.js:925:61474) at Ho.renderElement (file:///C:/Program Files/Azure Data Studio/resources/app/out/vs/workbench/workbench.desktop.main.js:925:62128) at Q.renderElement (file:///C:/Program Files/Azure Data Studio/resources/app/out/vs/workbench/workbench.desktop.main.js:329:1630) at v.insertItemInDOM (file:///C:/Program Files/Azure Data Studio/resources/app/out/vs/workbench/workbench.desktop.main.js:311:17605) at v._splice (file:///C:/Program Files/Azure Data Studio/resources/app/out/vs/workbench/workbench.desktop.main.js:311:13500) at v.splice (file:///C:/Program Files/Azure Data Studio/resources/app/out/vs/workbench/workbench.desktop.main.js:311:11770) at file:///C:/Program Files/Azure Data Studio/resources/app/out/vs/workbench/workbench.desktop.main.js:68:13422 at Array.forEach (<anonymous>) at t.splice (file:///C:/Program Files/Azure Data Studio/resources/app/out/vs/workbench/workbench.desktop.main.js:68:13409) at file:///C:/Program Files/Azure Data Studio/resources/app/out/vs/workbench/workbench.desktop.main.js:329:7892 at g.bufferEvents (file:///C:/Program Files/Azure Data Studio/resources/app/out/vs/workbench/workbench.desktop.main.js:129:3699) at H.splice (file:///C:/Program Files/Azure Data Studio/resources/app/out/vs/workbench/workbench.desktop.main.js:329:7859) at V.updateAccounts (file:///C:/Program Files/Azure Data Studio/resources/app/out/vs/workbench/workbench.desktop.main.js:3595:82464) at B.updateProviderAccounts (file:///C:/Program Files/Azure Data Studio/resources/app/out/vs/workbench/workbench.desktop.main.js:3595:87570) at file:///C:/Program Files/Azure Data Studio/resources/app/out/vs/workbench/workbench.desktop.main.js:3595:83795 at n.fire (file:///C:/Program Files/Azure Data Studio/resources/app/out/vs/workbench/workbench.desktop.main.js:129:1835) at file:///C:/Program Files/Azure Data Studio/resources/app/out/vs/workbench/workbench.desktop.main.js:923:32823 at n.fire (file:///C:/Program Files/Azure Data Studio/resources/app/out/vs/workbench/workbench.desktop.main.js:129:1835) at _c.fireAccountListUpdate (file:///C:/Program Files/Azure Data Studio/resources/app/out/vs/workbench/workbench.desktop.main.js:3595:96107) at file:///C:/Program Files/Azure Data Studio/resources/app/out/vs/workbench/workbench.desktop.main.js:3595:92164 at processTicksAndRejections (internal/process/task_queues.js:93:5) at async xr.run (file:///C:/Program Files/Azure Data Studio/resources/app/out/vs/workbench/workbench.desktop.main.js:925:17386) [2021-08-10 10:08:47.887] [renderer1] [debug] Read accounts from memento [{"canceled":false}] [2021-08-10 10:08:47.887] [renderer1] [debug] Read accounts from memento [] [2021-08-10 10:08:47.888] [renderer1] [debug] Read accounts from memento [] [2021-08-10 10:08:47.888] [renderer1] [debug] Read accounts from memento [] [2021-08-10 10:08:53.632] [renderer1] [error] An unknown error occurred. Please consult the log for more details. [2021-08-10 10:09:15.478] [renderer1] [debug] User data changed [2021-08-10 10:09:20.375] [renderer1] [debug] User data changed

@garyamorris
Copy link
Author

Any update on this? I've had to stop using Azure Data studio and gone back to SQL Management studio, where this isn't a problem.

@kburtram
Copy link
Member

@garyamorris I haven't seen this error before in other issues yet. Have you tried removing and readding the account? You could also try to remove the C:\Users[USERNAME]\AppData\Roaming\azuredatastudio folder to clear any cached state. If those don't work it's likely there is something specific to your AAD identify that is trigger an bug in our account management code that we'd need to root cause to fix. I'll take a look at the code path from the error in the description to see if there is any obvious problems.

@cssuh do you have any suggestions on how to investigate/resolve this issue?

@cssuh
Copy link
Member

cssuh commented Aug 16, 2021

Hi @garyamorris have you been able to sign in using AAD previously, or did this occur during your first attempt?

@garyamorris
Copy link
Author

garyamorris commented Aug 20, 2021

Tried deleting the following folders with a complete uninstall. Still get "Unidentified error with azure authentication". I've also tried with version 1.32.

C:\Users[USERNAME].azure
C:\Users[USERNAME].azuredatastudio
C:\Users[USERNAME]\AppData\Roaming\azuredatastudio

I have used this somewhat successfully with Azure data studio and my AAD. Although every 11 days, I would have to completely remove and re-add the account. I raised a ticket on this as well.

The only thing that changed before it stopped working was I recently signed in using Azure CLI and it never worked again after that.

@kburtram
Copy link
Member

@garyamorris have you tried using Device Code auth? This can be enabled by the Device Code user setting. Sometimes this alternate auth mechanism avoids bugs that can be impacting particular AAD configurations.

@garyamorris
Copy link
Author

Update: I raised this with my organization. Other people don't have this problem and they're using the same ad authentication as myself. It appears to be my machine, which is imaged the same as theirs. This broke after I started using azure cli. Could it be some configuration ?

@mesbahkhan
Copy link

Hi, getting the same issue, tried the device code method as well and getting this error
"TypeError: Cannot read properties of undefined (reading 'authLibrary')"

any idea what the fix is?

@cheenamalhotra
Copy link
Member

cheenamalhotra commented Feb 9, 2023

Update: I raised this with my organization. Other people don't have this problem and they're using the same ad authentication as myself. It appears to be my machine, which is imaged the same as theirs. This broke after I started using azure cli. Could it be some configuration ?

We don't consume Azure CLI while authenticating with Azure, so that seems unlikely. Are you able to gather and upload Azure logs for investigation?

Hi, getting the same issue, tried the device code method as well and getting this error
"TypeError: Cannot read properties of undefined (reading 'authLibrary')"

There might be a failure during MSAL authentication, that's causing some issues. Would request you to gather and upload Azure logs so we can take a closer look.

Please ensure you're testing with latest ADS release v1.41.1. Thanks!

@github-actions
Copy link

github-actions bot commented Feb 9, 2023

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.

@mesbahkhan
Copy link

I get this when trying the Autho Code Grant method:

[Error]: Error fetching tenants :TypeError: Cannot read properties of undefined (reading 'map') - []
[Error]: Login failed: Error: Error retrieving tenant information - []
[Error]: Error: Error retrieving tenant information - []

And this with the device code method

[Verbose]: [Thu, 09 Feb 2023 12:23:23 GMT] : @azure/[email protected] : Trace - Setting cache key value store - []
[Verbose]: [Thu, 09 Feb 2023 12:23:23 GMT] : [XXXXXXXXXXXXXXXXXXXXXXXXXXXXX] : @azure/[email protected] : Verbose - Persistence enabled, calling afterCacheAccess - []
[Verbose]: [Thu, 09 Feb 2023 12:23:23 GMT] : @azure/[email protected] : Trace - Serializing in-memory cache - []
[Verbose]: [Thu, 09 Feb 2023 12:23:23 GMT] : @azure/[email protected] : Trace - Getting in-memory cache - []
[Verbose]: [Thu, 09 Feb 2023 12:23:23 GMT] : @azure/[email protected] : Trace - Getting cache key-value store - []
[Verbose]: [Thu, 09 Feb 2023 12:23:23 GMT] : @azure/[email protected] : Trace - Reading cache snapshot from disk - []
[Verbose]: [Thu, 09 Feb 2023 12:23:23 GMT] : @azure/[email protected] : Trace - Merging in-memory cache with cache snapshot - []
[Verbose]: [Thu, 09 Feb 2023 12:23:23 GMT] : @azure/[email protected] : Trace - Remove updated entries in cache - []
[Verbose]: MsalCachePlugin: Token written to cache successfully. - []
[Verbose]: Fetching tenants with uri {0} - [https://management.azure.com/tenants?api-version=2019-11-01]
[Error]: Error fetching tenants :TypeError: Cannot read properties of undefined (reading 'map') - []
[Error]: Login failed: Error: Error retrieving tenant information - []
[Error]: Error: Error retrieving tenant information - []

@cheenamalhotra
Copy link
Member

Hi @mesbahkhan

I'm investigating why tenant list could be coming as empty for this account. Also can you provide more info what type of account it is? Work/School/Microsoft/any other?

In the meantime, could you try to change back the authentication library to 'ADAL' in settings and test again?

image

@cheenamalhotra
Copy link
Member

We've fixed these issues in latest releases, closing as resolved.

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

No branches or pull requests

7 participants