Error TimeoutOverflowWarning: xxxxx does not fit into a 32-bit signed integer when using ManagedIdentityCredential for ServiceBusClient
See original GitHub issue- Package Name: @azure/service-bus
- Package Version: 7.7.3
- Operating system: Azure Function Windows
- nodejs
- version: ~16
- browser
- name/version: -
- typescript
- version: -
- Is the bug related to documentation in
- README.md
- source code documentation
- SDK API docs on https://docs.microsoft.com
Describe the bug Using ManagedIdentityCredential to create ServiceBusClient, when receiving messages, keep getting:
(node:21960) TimeoutOverflowWarning: 1669616210777 does not fit into a 32-bit signed integer.
Timeout duration was set to 1.
Possible cause:
The expiry time of Managed Identity token is 24h by default. It is used in calculation at source code:
this._tokenTimeout = tokenObject.expiresOnTimestamp - Date.now() - 2 * 60 * 1000;
Then I’m not pretty sure where but it is probably used to ‘setTimeout’ for refreshing token and issue comes.
To Reproduce Steps to reproduce the behavior:
- create node js code
const credential = new ManagedIdentityCredential('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx');
const sbClient = new ServiceBusClient('xxxxx.servicebus.windows.net', credential);
const receiver = sbClient.createReceiver(TOPIC_NAME, SUBSCRIPTION_NAME);
const messages = await receiver.receiveMessages(5);
- deploy to azure function so that managed identity credential can work
Expected behavior Should be working fine without errors/warnings.
Screenshots
Additional context please consider to handle the case that token expiry time is longer than 24h
Issue Analytics
- State:
- Created 10 months ago
- Comments:14 (9 by maintainers)
Top Results From Across the Web
does not fit into a 32-bit signed integer" - General
Hello, My syslog is being filled with variations of the following error messages (this is just a short excerpt): (node:1215) TimeoutOverflowWarning: ...
Read more >Azure Service Bus managed identity in Visual Studio ...
At the moment I'm just trying this locally. When I debug my code I get the following error. System.UnauthorizedAccessException: Put token failed ...
Read more >azure-sdk-for-js
Error TimeoutOverflowWarning : xxxxx does not fit into a 32-bit signed integer when using ManagedIdentityCredential for ServiceBusClient. jrpedrianes.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi, thanks for the fix! tried with @azure/identity 3.1.2 and issue seems gone.
Thanks! Testing with 3.1.2 and the warnings seem to be gone and the CPU seems to no longer be spinning. 😃