question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Javascript SDK DefaultAzureCredentials stops working under high load

See original GitHub issue
  • Package Name: @azure/identity"
  • Package Version: 1.1.0
  • Operating system: Linux
  • nodejs
    • version: 12.13.0
  • browser
    • name/version:
  • typescript
    • version:
  • Is the bug related to documentation in

Describe the bug

We have a cluster with many pods running NodeJS. We use managed identity to access Azure resources, and for this we use DefaultAzureCredentials from the javascript SDK. What we observed is that under heavy load after some point some pods cannot get a token anymore, basically they end up in a zombie state and cannot access any Azure resource.

To Reproduce Many pods using managed identity.

Additional context Add any other context about the problem here.

We believe that the issue is that ManagedIdentityCredentials class caches the negative results, if a call timeouts then getting the token will not attempted anymore: https://github.com/Azure/azure-sdk-for-js/blob/dcae3ace0872180e0a542a00ca8c8c0b427def42/sdk/identity/identity/src/credentials/managedIdentityCredential.ts


 	      // the latter indicating that we don't yet know whether
	      // the endpoint is available and need to check for it.
	      if (this.isEndpointUnavailable !== true) {
	        result = await this.authenticateManagedIdentity(
	          scopes,
	          this.isEndpointUnavailable === null,
	          this.clientId,
	          newOptions
	        );
	
	        // If authenticateManagedIdentity returns null, it means no MSI
	        // endpoints are available.  In this case, don't try them in future
	        // requests.
	        this.isEndpointUnavailable = result === null;
	      } else {
	        const error = new CredentialUnavailable(
	          "The managed identity endpoint is not currently available"
	        );
	        logger.getToken.info(formatError(error));
	        throw error;
	      }

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
sadasantcommented, Oct 6, 2020

@balazsmolnar To help us narrow this issue down, we’ll be asking you to test our latest Identity beta version once we release it, most likely today. I’ll follow up with instructions as soon as I’m able to. Thank you for your time!

1reaction
balazsmolnarcommented, Oct 15, 2020

@sadasant We tested the fix yesterday, and I’m happy to report that we did not experience any managed identiy related issue. Thnk you for the fix!

Read more comments on GitHub >

github_iconTop Results From Across the Web

node.js - Azure Identity Authentication DefaultAzureCredential ...
The reason you are running into AuthorizationFailed error is because it looks like you have not assigned any permissions (RBAC role) to your ......
Read more >
Troubleshooting SDK load failure for JavaScript web apps
The SDK load failure exception is created and reported by the JavaScript snippet (v3 or later) when it detects that the SDK script...
Read more >
Firebase JavaScript SDK Release Notes - Google
This allows the SDK to work with the upcoming framework-aware Firebase tools ... Fixed a bug where error.email and other fields were not...
Read more >
Azure Identity 201 - DefaultAzureCredential Options
The Default Credential Chain. When you use DefaultAzureCredential , what you are actually doing is telling the Azure SDK to try a bunch...
Read more >
azure sdk for net
NET pagination functionality to work efficiently and productively with large data sets. Azure Identity client library for. There are 1213 watchers for this ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found