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

Entry not found in cache #53

Open
chrmarti opened this issue Apr 12, 2018 · 17 comments
Open

Entry not found in cache #53

chrmarti opened this issue Apr 12, 2018 · 17 comments
Assignees

Comments

@chrmarti
Copy link
Contributor

From @jdneo in #45 (comment):

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:

report

@jdneo
Copy link
Member

jdneo commented Apr 13, 2018

Hi @chrmarti , Seems I found the root cause. It might be a bug in adal lib.

I create an issue: AzureAD/azure-activedirectory-library-for-nodejs#197

Correct me if I'm wrong. 😄

@chrmarti
Copy link
Contributor Author

chrmarti commented May 4, 2018

@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?

@jdneo
Copy link
Member

jdneo commented May 5, 2018

@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

@chrmarti
Copy link
Contributor Author

That reproduces it and the PR you linked seems to fix it. Now we just need that fix in adal-node.

@jdneo
Copy link
Member

jdneo commented May 14, 2018

@chrmarti Agree..

@derek1ee
Copy link

I was able to repro this, simply by leaving VS Code open for ~an hour without interacting with it.

@su-jie
Copy link

su-jie commented Feb 27, 2019

We are experiencing the same issue. Do you guys know if it has been fixed?

@chrmarti
Copy link
Contributor Author

No, AzureAD/azure-activedirectory-library-for-nodejs#197 should be reopened from what I see.

@fiveisprime
Copy link
Member

Any idea on the right person/team to contact about getting this fixed?

@chrmarti
Copy link
Contributor Author

chrmarti commented Apr 4, 2019

@navyasric closed the upstream issue (AzureAD/azure-activedirectory-library-for-nodejs#197), maybe we can reach out to her.

@scale-tone
Copy link

scale-tone commented Nov 14, 2021

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:
image

This makes _loadSingleEntryFromCache() method produce an error as shown on the screenshot, which is then converted into an Entry not found in cache failure:
image

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

@scale-tone
Copy link

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.

@wwlorey
Copy link
Contributor

wwlorey commented Nov 15, 2021

Unfortunately this has been an issue with ADAL for a while. We're onboarding support for Microsoft's new authentication library: MSAL (tracking in #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.

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

10 participants