microsoft/artifacts-keyring

Intermittent failure to authenticate on WSL

janheindejong opened this issue · 3 comments

I sometimes get the following error, when using artifacts-keyring on WSL.

Unhandled exception. System.PlatformNotSupportedException: Wait operations on multiple wait handles including a named synchronization primitive are not supported on this platform.
   at System.Threading.WaitHandle.WaitMultipleIgnoringSyncContext(IntPtr* waitHandles, Int32 numHandles, Boolean waitAll, Int32 millisecondsTimeout)
   at System.Threading.WaitHandle.WaitMultiple(ReadOnlySpan`1 waitHandles, Boolean waitAll, Int32 millisecondsTimeout)
   at System.Threading.WaitHandle.WaitMultiple(WaitHandle[] waitHandles, Boolean waitAll, Int32 millisecondsTimeout)
   at System.Threading.WaitHandle.WaitAny(WaitHandle[] waitHandles, Int32 millisecondsTimeout)
   at NuGetCredentialProvider.Util.SessionTokenCache.get_Cache()
   at NuGetCredentialProvider.Util.SessionTokenCache.TryGetValue(Uri key, String& value)
   at NuGetCredentialProvider.RequestHandlers.GetAuthenticationCredentialsRequestHandler.TryCache(GetAuthenticationCredentialsRequest request, String& cachedToken)
   at NuGetCredentialProvider.RequestHandlers.GetAuthenticationCredentialsRequestHandler.HandleRequestAsync(GetAuthenticationCredentialsRequest request)

Retrying usually helps, so no biggy, but feels like a difficult bug.

Steps to reproduce:

  1. Run Ubuntu on WSL on Windows
  2. Install Poetry
  3. Add artifacts keyring (poetry self add artifacts-keyring)
  4. Try running poetry install on project that has Azure Artifacts as default source

I'm using Poetry, but I wonder if that is the problem?

Setting poetry config installer.parallel false helps. It seems that if two installations are fired at the same time, it fails.

Thanks for reporting this, opened an issue on the artifacts credential provider microsoft/artifacts-credprovider#416

This issue should be fixed with 0.3.5 please let me know if the issue persists on this new version