-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
CrossPlatformLockError: Not able to acquire lock. Exceeded amount of retries set in options #7148
Comments
Thanks for filing the issue @maorleger. I can consistently repro this on my machine. Restarting my laptop did not help either. I had to change my code so that token persistence happens with a named file and I was able to work around this. |
cc @bgavrilMS and @Robbie-Microsoft to check this |
Hi @sameerag - this is a public client issue, as that caching mechanism was never designed for confidential clients (web apps don't use files etc.). @Robbie-Microsoft and I look after confidential client scenarios. Afaik, the way to self heal is to close the app and delete the lock file manually. Possibly delete the cache file too. The lock file should be always be deleted, even if the app crashes. There is special flag "DeleteOnClose" that should be used on file creation - see here - and also notice the special Windows flag used. Also, there seems to be a workaround. Wondering if this is somehow related to Azure SDKs' default config for this cache. |
This is interesting. @maorleger - where does Azure SDK default to create the file persistence if he app developer doesn't specify? |
👋 By default we will use .IdentityService under the platform specific local folder as the directory. The file name will be For example, on my wsl instance, it defaults to Hope that helps! |
We are having the same issue in our Electron application which is using |
Core Library
MSAL Node (@azure/msal-node)
Wrapper Library
MSAL Node Extensions (@azure/msal-node-extensions)
Public or Confidential Client?
Public
Documentation Location
https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/extensions/docs/faq.md
Description
Related to Azure/azure-sdk-for-js#29920
@pcdeadeasy has reached out to us with the above error. It seems like, from looking at the code, that this can happen if the
.lockfile
file is not properly cleaned up.Is there documentation about how a user can get themselves into a good state? If not, we think it should be documented or ideally self-healed (maybe by checking if the pid who owns the file is still running?)
Otherwise I can see a scenario where terminating processes at the wrong time may leave the system in a bad state.
Could we either document how to correct this issue as a user or self-heal within the code? We (@azure/identity-cache-persistence) can include that in our error message or troubleshooting guide.
@pcdeadeasy feel free to add any asks you have of the MSAL team.
Thanks in advance!
The text was updated successfully, but these errors were encountered: