vscode-azure-account
vscode-azure-account copied to clipboard
Entry not found in cache
From @jdneo in https://github.com/Microsoft/vscode-azure-account/issues/45#issuecomment-380321789:
Hi @chrmarti I found out a way to reproduce Entry not found in cache
error. Just trigger the Azure: Open bash in clould shell
twice.
More details can be found in the gif below:
Hi @chrmarti , Seems I found the root cause. It might be a bug in adal lib.
I create an issue: https://github.com/AzureAD/azure-activedirectory-library-for-nodejs/issues/197
Correct me if I'm wrong. 😄
@jdneo I cannot reproduce this myself currently. Is it still a problem and would it be fixed by the PR AzureAD/azure-activedirectory-library-for-nodejs#188?
@chrmarti
I can still repro this on my side, the steps are:
- Make sure the Azure Account is signed out at first
- Trigger
Open bash in Cloud Shell
- Sign in
- Wait for the Cloud Shell connected
- Dispose the Cloud Shell terminal
- Trigger
Open bash in Cloud Shell
again
That reproduces it and the PR you linked seems to fix it. Now we just need that fix in adal-node.
@chrmarti Agree..
I was able to repro this, simply by leaving VS Code open for ~an hour without interacting with it.
We are experiencing the same issue. Do you guys know if it has been fixed?
No, https://github.com/AzureAD/azure-activedirectory-library-for-nodejs/issues/197 should be reopened from what I see.
Any idea on the right person/team to contact about getting this fixed?
@navyasric closed the upstream issue (AzureAD/azure-activedirectory-library-for-nodejs#197), maybe we can reach out to her.
Still encountering this issue...
any one can help for this issue ?
Upstream is unresponsive. We could look into shipping a patched version, but we also want to look into moving to MSAL (replacing ADAL that shows the problem).
If anyone is still encountering this issue, I found that deleting the slsTokenCache worked for me:
rm ~/.azure/slsTokenCache.json
https://github.com/serverless/serverless-azure-functions/issues/412#issuecomment-591511201
What an ever-green issue. ~100 mentions! Let me contribute to it as well.
I'm occasionally seeing this error when for some reason the token cache (maintained by adal-node library) contains two valid tokens with the same resource value:
This makes _loadSingleEntryFromCache()
method produce an error as shown on the screenshot, which is then converted into an Entry not found in cache
failure:
I don't know which chain of events leads to a token being duplicated in the cache. I also don't know why adal-node treats this condition as a failure.
Restarting vscode seems to help.
adal-node v0.2.3 ms-vscode.azure-account-0.9.11
I don't know which chain of events leads to a token being duplicated in the cache
No, wait, I know! It's a concurrency issue. Token cache (or some code that uses it) doesn't tolerate parallel async calls, that use the same kind of token. In my case the solution was to always make all network calls sequentially. But there're always chances for unrelated calls to interfere with each other like that, so this is definitely a bug on the token cache side.
Unfortunately this has been an issue with ADAL for a while. We're onboarding support for Microsoft's new authentication library: MSAL (tracking in https://github.com/microsoft/vscode-azure-account/issues/203) which will likely fix this issue. And if not - at least MSAL is actively maintained and we can request changes from the MSAL team.