iotedge: Could not get identity $edgeAgent

We noticed yesterday that our IoT devices could not download their modules anymore. It all started with the message: Unable to process module xxxxxx add or update as the module identity could not be obtained.

What we already did:

  • removed the device from the IoT Hub and had it provision again -> DPS provisioning seems to work fine, the device is recognized and gets added to the IoT Hub.
  • removed all modules (docker image prune -f -a) so that the edgeAgent would start downloading again -> This fails because now even the edgeAgent will not start anymore. The logs show: HTTP request failed: [401 Unauthorized] errorCode:401002, but how can this be happening while the device gets registered correctly?

IoT Edge version on the device is: 1.0.10 and 1.1.15, because we cannot upgrade remote to 1.4 or 1.5.

iotedged logs

Okt 09 09:45:50 S360N12011023C82HU iotedged[12003]: 2024-10-09T07:45:50Z [INFO] - Configuring certificates...
Okt 09 09:45:50 S360N12011023C82HU iotedged[12003]: 2024-10-09T07:45:50Z [INFO] - Transparent gateway certificates not found, operating in quick start mode...
Okt 09 09:45:50 S360N12011023C82HU iotedged[12003]: 2024-10-09T07:45:50Z [INFO] - Finished configuring provisioning environment variables and certificates.
Okt 09 09:45:50 S360N12011023C82HU iotedged[12003]: 2024-10-09T07:45:50Z [INFO] - Initializing hsm...
Okt 09 09:45:50 S360N12011023C82HU iotedged[12003]: 2024-10-09T07:45:50Z [INFO] - Finished initializing hsm.
Okt 09 09:45:50 S360N12011023C82HU iotedged[12003]: 2024-10-09T07:45:50Z [INFO] - Initializing hsm X509 interface...
Okt 09 09:45:50 S360N12011023C82HU iotedged[12003]: 2024-10-09T07:45:50Z [INFO] - Finished initializing hsm X509 interface...
Okt 09 09:45:50 S360N12011023C82HU iotedged[12003]: 2024-10-09T07:45:50Z [INFO] - Provisioning edge device...
Okt 09 09:45:50 S360N12011023C82HU iotedged[12003]: 2024-10-09T07:45:50Z [INFO] - Starting provisioning edge device via X509 provisioning...
Okt 09 09:45:50 S360N12011023C82HU iotedged[12003]: 2024-10-09T07:45:50Z [INFO] - Starting DPS registration with scope_id "0ne00xxxxxx", registration_id "S360N12011023C82HU"
Okt 09 09:46:01 S360N12011023C82HU iotedged[12003]: 2024-10-09T07:46:01Z [INFO] - DPS registration assigned device "S360N12011023C82HU" in hub "xxx.azure-devices.net"
Okt 09 09:46:01 S360N12011023C82HU iotedged[12003]: 2024-10-09T07:46:01Z [INFO] - Successful DPS provisioning.
Okt 09 09:46:01 S360N12011023C82HU iotedged[12003]: 2024-10-09T07:46:01Z [INFO] - Finished provisioning edge device.
Okt 09 09:46:01 S360N12011023C82HU iotedged[12003]: 2024-10-09T07:46:01Z [INFO] - Initializing the module runtime...
Okt 09 09:46:01 S360N12011023C82HU iotedged[12003]: 2024-10-09T07:46:01Z [INFO] - Initializing module runtime...
Okt 09 09:46:01 S360N12011023C82HU iotedged[12003]: 2024-10-09T07:46:01Z [INFO] - Using runtime network id azure-iot-edge
Okt 09 09:46:01 S360N12011023C82HU iotedged[12003]: 2024-10-09T07:46:01Z [INFO] - Successfully initialized module runtime
Okt 09 09:46:01 S360N12011023C82HU iotedged[12003]: 2024-10-09T07:46:01Z [INFO] - Finished initializing the module runtime.
Okt 09 09:46:01 S360N12011023C82HU iotedged[12003]: 2024-10-09T07:46:01Z [INFO] - Stopping all modules...
Okt 09 09:46:01 S360N12011023C82HU iotedged[12003]: 2024-10-09T07:46:01Z [INFO] - Finished stopping modules.
Okt 09 09:46:01 S360N12011023C82HU iotedged[12003]: 2024-10-09T07:46:01Z [INFO] - Reprovisioning status InitialAssignment will trigger reconfiguration of modules.
Okt 09 09:46:01 S360N12011023C82HU iotedged[12003]: 2024-10-09T07:46:01Z [INFO] - Detecting if configuration file has changed...
Okt 09 09:46:01 S360N12011023C82HU iotedged[12003]: 2024-10-09T07:46:01Z [INFO] - No change to configuration file detected.
Okt 09 09:46:01 S360N12011023C82HU iotedged[12003]: 2024-10-09T07:46:01Z [INFO] - Edge issuer CA expiration date: 2041-03-14T06:54:01Z
Okt 09 09:46:01 S360N12011023C82HU iotedged[12003]: 2024-10-09T07:46:01Z [INFO] - Obtaining workload CA succeeded.
Okt 09 09:46:01 S360N12011023C82HU iotedged[12003]: 2024-10-09T07:46:01Z [INFO] - Starting management API...
Okt 09 09:46:01 S360N12011023C82HU iotedged[12003]: 2024-10-09T07:46:01Z [INFO] - Starting workload API...
Okt 09 09:46:01 S360N12011023C82HU iotedged[12003]: 2024-10-09T07:46:01Z [INFO] - Starting watchdog with 60 second frequency...
Okt 09 09:46:01 S360N12011023C82HU iotedged[12003]: 2024-10-09T07:46:01Z [INFO] - Listening on fd://iotedge.mgmt.socket/ with 1 thread for management API.
Okt 09 09:46:01 S360N12011023C82HU iotedged[12003]: 2024-10-09T07:46:01Z [INFO] - Listening on fd://iotedge.socket/ with 1 thread for workload API.
Okt 09 09:46:01 S360N12011023C82HU iotedged[12003]: 2024-10-09T07:46:01Z [INFO] - Checking edge runtime status
Okt 09 09:46:01 S360N12011023C82HU iotedged[12003]: 2024-10-09T07:46:01Z [INFO] - Creating and starting edge runtime module edgeAgent
Okt 09 09:46:01 S360N12011023C82HU iotedged[12003]: 2024-10-09T07:46:01Z [WARN] - Error in watchdog when checking for edge runtime status:
Okt 09 09:46:01 S360N12011023C82HU iotedged[12003]: 2024-10-09T07:46:01Z [WARN] - A module runtime error occurred.
Okt 09 09:46:01 S360N12011023C82HU iotedged[12003]: 2024-10-09T07:46:01Z [WARN] -         caused by: Could not get identity $edgeAgent
Okt 09 09:46:01 S360N12011023C82HU iotedged[12003]: 2024-10-09T07:46:01Z [WARN] -         caused by: Could not get module $edgeAgent
Okt 09 09:46:01 S360N12011023C82HU iotedged[12003]: 2024-10-09T07:46:01Z [WARN] -         caused by: HTTP request failed: [401 Unauthorized] {"Message":"{\"errorCode\":401002,\"message\":\"Unauthorized access\",\"trackingId\":\"9AF43B5BAC6B47C38DDE1AD6CF64AECB-G2:-TimeStamp:2024-10-09T07:46:01.963158726Z\",\"timestampUtc\":\"2024-10-09T07:46:01.963158726Z\",\"info\":null}","ExceptionMessage":""}

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 2
  • Comments: 20 (2 by maintainers)

Most upvoted comments

Late to the party but I’m seeing this issue in only one of our total of three IoT Hub instances. The one that seems to be broken has feature flag “GWV2” in it’s features collection while the other two don’t. Is it possible that GWV2 is causing this behavior in IoT Hub when using old IoT Edge version. Using current version of IoT Edge seems to work in all IoT Hubs we have. It would be really helpful if someone from Microsoft could verify if we can trust the non-GWV2 instances to work with older Edge version.

@dperez83 : if you have an update on your ticket, please keep us updated here. From my end, still no progress made on my ticket.

Sorry for the delay, Azure support rolled back an update to our IoT Hub and after that the deployment and everything works fine.

@dme-development: We have identified a change on IoT Hub that is possibly causing your issue and have escalated to that team.