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

[Bug] Add retries on 500/429 errors while fetching for auth token #563

Closed
3 tasks
devaradhanm opened this issue Mar 5, 2020 · 1 comment · Fixed by #617
Closed
3 tasks

[Bug] Add retries on 500/429 errors while fetching for auth token #563

devaradhanm opened this issue Mar 5, 2020 · 1 comment · Fixed by #617

Comments

@devaradhanm
Copy link
Contributor

devaradhanm commented Mar 5, 2020

The sdk doesnt seem to have retry on failure response(https://github.com/Azure/ms-rest-nodeauth/blob/adea8415de97a8076006fbd9948123d09dfdd78d/lib/credentials/msiAppServiceTokenCredentials.ts#L94). So we may need to add retry & caching, make class singleton for results returned by CredentialsProvider.

Refer https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/how-to-use-vm-token#error-handling

Currently, in Azure function sometimes, we have received the below error in production:
Result: Failure

Exception: Error: MSI: Failed to retrieve a token from "http://127.0.0.1:41709/MSI/token/?resource=https%3A%2F%2Fvault.azure.net&api-version=2017-09-01" with an error: {"ExceptionMessage":"","ErrorCode":"service_unavailable","ServiceErrorCodes":null,"StatusCode":503,"Message":null,"CorrelationId":"8b0bb15d-11f7-4a3b-8fbb-3a55ca98a884"}
Stack: Error: MSI: Failed to retrieve a token from "http://127.0.0.1:41709/MSI/token/?resource=https%3A%2F%2Fvault.azure.net&api-version=2017-09-01" with an error: {"ExceptionMessage":"","ErrorCode":"service_unavailable","ServiceErrorCodes":null,"StatusCode":503,"Message":null,"CorrelationId":"8b0bb15d-11f7-4a3b-8fbb-3a55ca98a884"}
    at MSIAppServiceTokenCredentials.<anonymous> (D:\home\site\wwwroot\get-report-func\index.js:56446:23)
    at Generator.next (<anonymous>)
    at fulfilled (D:\home\site\wwwroot\get-report-func\index.js:56384:58)
    at process._tickCallback (internal/process/next_tick.js:68:7)

Area

  • Install script
  • Update script
  • Service

To Reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

Log files

Screenshots

Additional context

@devaradhanm devaradhanm added the bug label Mar 5, 2020
@ghost ghost added the status: new label Mar 5, 2020
@ghost ghost assigned pownkel Mar 5, 2020
@devaradhanm devaradhanm changed the title [Bug] Add retries on 500/429 errors on getToken [Bug] Add retries on 500/429 errors while fetching for auth token Mar 5, 2020
@ghost
Copy link

ghost commented Mar 6, 2020

This issue has been marked as ready for team triage; we will triage it in our weekly review and update the issue. Thank you for contributing to Accessibility Insights!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants