Skip to content

The SAS token refreshes every hour, but the CBS link authentication response is not received, preventing messages from being sent. #1802

@QuipTest

Description

@QuipTest
  • SDK version used: 2.5.0

Description of the issue

I have an application that authenticates with IoT Hub and sends a message every minute.
The device was kept running for an extended period (2–3 days).
After this duration, the application attempted to renew the SAS token and re-authenticate, but no callback or response was received.
From that point onward, the application continued trying to renew the SAS token every hour, yet it still did not receive any response or callback.

At the time the issue occurred, the device was in Doze mode.
However, upon unlocking the phone and attempting to send a message, the DeviceClient indicated that the connection was still active.
Despite this, when publishing a message, I encountered a message expired error.
The connection with IoT Hub was not re-established until I restarted the application.

Console log of the issue

Working fine till this
Send authentication message
Line 2177: Mar 23, 2025 @ 05:30:59.343 DEBUG com.microsoft.azure.sdk.iot.device.transport.amqps.AmqpsSasTokenRenewalHandler-sendAuthenticationMessage[70] Sending authentication message for device[ID]
Line 2181: Mar 23, 2025 @ 05:30:59.360 TRACE com.microsoft.azure.sdk.iot.device.transport.amqps.AmqpsSasTokenRenewalHandler-scheduleRenewal[121] Scheduling proactive sas token renewal for device [ID] in 3060000 milliseconds

Got authentication succeeded
Line 2185: Mar 23, 2025 @ 05:30:59.658 DEBUG com.microsoft.azure.sdk.iot.device.transport.amqps.AmqpsSasTokenRenewalHandler-handleAuthenticationResponseMessage[95] CBS message authentication succeeded for device [ID]

Issue start from here
Line 2208: Mar 23, 2025 @ 06:22:05.566 TRACE com.microsoft.azure.sdk.iot.device.transport.amqps.AmqpsSasTokenRenewalHandler-onTimerTask[50] onTimerTask fired for sas token renewal handler for device [ID]
Line 2209: Mar 23, 2025 @ 06:22:05.574 DEBUG com.microsoft.azure.sdk.iot.device.transport.amqps.AmqpsSasTokenRenewalHandler-sendAuthenticationMessage[70] Sending authentication message for device [ID]
Line 2213: Mar 23, 2025 @ 06:22:05.587 TRACE com.microsoft.azure.sdk.iot.device.transport.amqps.AmqpsSasTokenRenewalHandler-scheduleRenewal[121] Scheduling proactive sas token renewal for device [ID] in 3060000 milliseconds
Line 2230: Mar 23, 2025 @ 07:13:05.557 TRACE com.microsoft.azure.sdk.iot.device.transport.amqps.AmqpsSasTokenRenewalHandler-onTimerTask[50] onTimerTask fired for sas token renewal handler for device [ID]
Line 2231: Mar 23, 2025 @ 07:13:05.562 DEBUG com.microsoft.azure.sdk.iot.device.transport.amqps.AmqpsSasTokenRenewalHandler-sendAuthenticationMessage[70] Sending authentication message for device [ID]
Line 2235: Mar 23, 2025 @ 07:13:05.587 TRACE com.microsoft.azure.sdk.iot.device.transport.amqps.AmqpsSasTokenRenewalHandler-scheduleRenewal[121] Scheduling proactive sas token renewal for device [ID] in 3060000 milliseconds
Line 2245: Mar 23, 2025 @ 08:08:49.509 TRACE com.microsoft.azure.sdk.iot.device.transport.amqps.AmqpsSasTokenRenewalHandler-onTimerTask[50] onTimerTask fired for sas token renewal handler for device [ID]

The SAS token refreshes every hour, but the CBS link authentication response is not received, preventing message delivery.
DeviceClient shows the connection as active, and the SAS token is not expired, yet telemetry messages are not being sent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions