Skip to content

Troubleshooting provisioning errors

This page explains how to recover from errors in the secure provisioning process.

If your device shows an ERROR status, the provisioning process has been suspended. You can find the provisioning command that the device failed to execute using the APIs or the nRF Cloud portal. To resolve the error, you can either reset (restart) or skip the command. You can do this in either the nRF Cloud portal or using the APIs.

Using the nRF Cloud portal to find and resolve failed commands

To view your claimed device's information and identify the failed command:

  1. Log in to the nRF Cloud portal.
  2. Select Security Services in the left sidebar.

    A panel opens to the right.

  3. Select Claimed Devices.

    The Claimed Devices page opens.

  4. Click the ID of the device to open the Claimed Device page.

  5. Check for commands with status FAILED under the Provisioning Configuration card.

To reset or skip a failed command:

  1. Log in to the nRF Cloud portal.
  2. Select Security Services in the left sidebar.

    A panel opens to the right.

  3. Select Claimed Devices.

    The Claimed Devices page opens.

  4. Click the ID of the device to open the Claimed Device page.

  5. Check for commands with status FAILED under the Provisioning Configuration card.
  6. Reset or skip the failed command.

If the command is reset, it will run the next time the device connects to the Provisioning Service. If the command is skipped,

Using the APIs to find and resolve failed commands

This section explains how to use the APIs to find and resolve errors in the secure provisioning process.

Finding failed commands

Use the following request to find which command has failed:

curl -X GET $API_HOST/v1/claimed-devices/{device-uuid}/provisioning?status=FAILED -H "Authorization: Bearer $API_KEY"

You can fetch the details of the command to see the error message sent by the device:

curl -X GET $API_HOST/v1/claimed-devices/{device-uuid}/provisioning/{provisioning-id} -H "Authorization: Bearer $API_KEY"

Resolving errors

To resolve errors, either send the request to the device again, or skip the failed command:

  • Use the following request to reset the command and send it to the device again:

    curl -X POST $API_HOST/v1/claimed-devices/{device-uuid}/provisioning/{provisioning-id}/reset -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
    
  • Use the following request to skip a failed command:

    curl -X POST $API_HOST/v1/claimed-devices/{device-uuid}/provisioning/{provisioning-id}/skip -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
    

After either resetting or skipping the failed command, the device status returns to READY. If the command is reset and not deleted, it runs the next time the device connects to the Provisioning Service.

Handling device reset

If your device has been reset to its factory state, you may need to re-provision it with the same provisioning configuration. In this case, reset all commands in the provisioning configuration using the following request:

curl -X POST $API_HOST/v1/claimed-devices/{device-uuid}/provisioning/reset -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"

This sets all commands to PENDING. The commands run the next time the device connects to the Provisioning Service.