Intermittent PartialChain when connecting to IoT Hub

MikeFinch87 0 Reputation points
2023-09-15T19:05:48.5433333+00:00

I'm using the C# SDK to connect to Azure IoTHub in testing. I'm using the C#SDK symmetric keys and DPS. I've modified DeviceReconnectionSample to work with SymmetricKeySample/ProvisioningDeviceClientSample. Sometimes it works, and sometimes I get this. Note that the connection to DPS works the first time, so I have the correct certificate, and then fails on retry.

09/15/2023 18:51:05> Information - Using Mqtt_WebSocket_Only transport.

09/15/2023 18:51:05> Debug - Attempting to initialize the client instance, current status=Disconnected

09/15/2023 18:51:05> Information - Initialized for registration Id

Azure IoT SDK
Azure IoT SDK
An Azure software development kit that facilitates building applications that connect to Azure IoT services.
208 questions
{count} votes

1 answer

Sort by: Most helpful
  1. LeelaRajeshSayana-MSFT 13,471 Reputation points
    2023-09-16T16:14:27.39+00:00

    Hi @MikeFinch87 Greetings! Welcome to Microsoft Q&A forum. Thank you for posting this question here.

    Based on the error message it looks like the error message is originating from the retry logic. You may refer to the code sample from CustomRetryPolicy which uses an approach of using the retry policy fully, rather than wrap another retry policy around method calls.

    I appreciate it if you can share the modifications made you have made to the DeviceReconnectSample class to help us better understand the potential cause of this issue.

    Also, it looks like you are trying to use certificates through the sample. I would like to check with you and see if you have reviewed the article Provision an X.509 certificate simulated device. This provides the steps needed to provision a device using certificates. Kindly review this and see if this addresses your testing needs without having to modify the code.

    Please let us know if you have any additional questions or need further assistance.


    If the response helped, please do click Accept Answer and Yes for the answer provided. Doing so would help other community members with similar issue identify the solution. I highly appreciate your contribution to the community.

    0 comments No comments