The following occurs in an Azure IoT Edge 1.2 environment:
If you install the moby, aziot-edge and aziot-identity-service packages only once in a clean environment, you will get "Could not retrieve device information" and provisioning will not succeed.
However, provisioning is successful by installing and launching the same aziot-edge package again.
Do you know the reason for this?
--- Envroiment
Debian 11 / VM / amd64
But , the same is true for Debian 10.
--- Execute Command
root@debian:~# dpkg -i aziot-edge_1.2.3-1_debian10_amd64.deb aziot-identity-service_1.2.2-1_debian10_amd64.deb
root@debian:~# iotedge config mp --force --connection-string '<REPLACE-CONNECTION-STRING>'
root@debian:~# iotedge config apply -c '/etc/aziot/config.toml'
root@debian:~# iotedge system status
System services:
aziot-edged Running
aziot-identityd Ready
aziot-keyd Ready
aziot-certd Ready
aziot-tpmd Ready
Use 'iotedge system logs' to check for non-fatal errors.
Use 'iotedge check' to diagnose connectivity and configuration issues.
root@debian:~# iotedge system logs
-- Journal begins at Tue 2021-08-24 14:46:05 JST, ends at Tue 2021-08-24 14:50:36 JST. --
Aug 24 14:49:43 debian aziot-edged[3077]: 2021-08-24T05:49:43Z [INFO] - Starting Azure IoT Edge Module Runtime
Aug 24 14:49:43 debian aziot-edged[3077]: 2021-08-24T05:49:43Z [INFO] - Version - 1.2.3
Aug 24 14:49:43 debian systemd[1]: Started Azure IoT Edge daemon.
Aug 24 14:49:43 debian aziot-edged[3077]: 2021-08-24T05:49:43Z [INFO] - Initializing the module runtime...
Aug 24 14:49:43 debian aziot-edged[3077]: 2021-08-24T05:49:43Z [INFO] - Initializing module runtime...
Aug 24 14:49:43 debian aziot-edged[3077]: 2021-08-24T05:49:43Z [INFO] - Using runtime network id azure-iot-edge
Aug 24 14:49:43 debian aziot-edged[3077]: 2021-08-24T05:49:43Z [INFO] - Successfully initialized module runtime
Aug 24 14:49:43 debian aziot-edged[3077]: 2021-08-24T05:49:43Z [INFO] - Finished initializing the module runtime.
Aug 24 14:49:43 debian aziot-edged[3077]: 2021-08-24T05:49:43Z [INFO] - Obtaining edge device provisioning data...
Aug 24 14:49:43 debian aziot-edged[3077]: 2021-08-24T05:49:43Z [WARN] - The daemon could not start up successfully: Could not retrieve device information
Aug 24 14:49:43 debian aziot-edged[3077]: 2021-08-24T05:49:43Z [WARN] - caused by: HTTP request error
Aug 24 14:49:43 debian aziot-edged[3077]: 2021-08-24T05:49:43Z [WARN] - caused by: error trying to connect: Permission denied (os error 13)
Aug 24 14:49:43 debian aziot-edged[3077]: 2021-08-24T05:49:43Z [WARN] - Requesting device reprovision.
Aug 24 14:49:43 debian aziot-edged[3077]: 2021-08-24T05:49:43Z [WARN] - The reprovisioning operation failed
Aug 24 14:49:48 debian aziot-edged[3077]: 2021-08-24T05:49:48Z [INFO] - Obtaining edge device provisioning data...
Aug 24 14:49:48 debian aziot-edged[3077]: 2021-08-24T05:49:48Z [WARN] - The daemon could not start up successfully: Could not retrieve device information
Aug 24 14:49:48 debian aziot-edged[3077]: 2021-08-24T05:49:48Z [WARN] - caused by: HTTP request error
Aug 24 14:49:48 debian aziot-edged[3077]: 2021-08-24T05:49:48Z [WARN] - caused by: error trying to connect: Permission denied (os error 13)
Aug 24 14:49:48 debian aziot-edged[3077]: 2021-08-24T05:49:48Z [WARN] - Requesting device reprovision.
Aug 24 14:49:48 debian aziot-edged[3077]: 2021-08-24T05:49:48Z [WARN] - The reprovisioning operation failed
Aug 24 14:49:53 debian aziot-edged[3077]: 2021-08-24T05:49:53Z [INFO] - Obtaining edge device provisioning data...
Aug 24 14:49:53 debian aziot-edged[3077]: 2021-08-24T05:49:53Z [WARN] - The daemon could not start up successfully: Could not retrieve device information
Aug 24 14:49:53 debian aziot-edged[3077]: 2021-08-24T05:49:53Z [WARN] - caused by: HTTP request error
....................
root@debian:~# iotedge system stop
root@debian:~# dpkg -i aziot-edge_1.2.3-1_debian10_amd64.deb
root@debian:~# iotedge system restart
root@debian:~# iotedge system logs
...........
Aug 24 14:50:13 debian aziot-edged[3077]: 2021-08-24T05:50:13Z [WARN] - The reprovisioning operation failed
Aug 24 14:50:17 debian systemd[1]: Stopping Azure IoT Edge daemon...
Aug 24 14:50:17 debian systemd[1]: aziot-edged.service: Succeeded.
Aug 24 14:50:17 debian systemd[1]: Stopped Azure IoT Edge daemon.
Aug 24 14:50:28 debian aziot-edged[3277]: 2021-08-24T05:50:28Z [INFO] - Starting Azure IoT Edge Module Runtime
Aug 24 14:50:28 debian systemd[1]: Started Azure IoT Edge daemon.
Aug 24 14:50:28 debian aziot-edged[3277]: 2021-08-24T05:50:28Z [INFO] - Version - 1.2.3
Aug 24 14:50:28 debian aziot-edged[3277]: 2021-08-24T05:50:28Z [INFO] - Initializing the module runtime...
Aug 24 14:50:28 debian aziot-edged[3277]: 2021-08-24T05:50:28Z [INFO] - Initializing module runtime...
Aug 24 14:50:28 debian aziot-edged[3277]: 2021-08-24T05:50:28Z [INFO] - Using runtime network id azure-iot-edge
Aug 24 14:50:28 debian aziot-edged[3277]: 2021-08-24T05:50:28Z [INFO] - Successfully initialized module runtime
Aug 24 14:50:28 debian aziot-edged[3277]: 2021-08-24T05:50:28Z [INFO] - Finished initializing the module runtime.
Aug 24 14:50:28 debian aziot-edged[3277]: 2021-08-24T05:50:28Z [INFO] - Obtaining edge device provisioning data...
Aug 24 14:50:28 debian systemd[1]: Started Azure IoT Identity Service.
Aug 24 14:50:28 debian aziot-identityd[3280]: 2021-08-24T05:50:28Z [INFO] - Starting service...
Aug 24 14:50:28 debian aziot-identityd[3280]: 2021-08-24T05:50:28Z [INFO] - Version - 1.2.2
Aug 24 14:50:28 debian aziot-identityd[3280]: 2021-08-24T05:50:28Z [INFO] - Provisioning starting. Reason: Startup
Aug 24 14:50:28 debian aziot-identityd[3280]: 2021-08-24T05:50:28Z [INFO] - Updated device info for Edge210824D6.
Aug 24 14:50:28 debian aziot-identityd[3280]: 2021-08-24T05:50:28Z [INFO] - Provisioning complete.
Aug 24 14:50:28 debian aziot-identityd[3280]: 2021-08-24T05:50:28Z [INFO] - Identity reconciliation started. Reason: Startup
Aug 24 14:50:28 debian systemd[1]: Started Azure IoT Keys Service.
Aug 24 14:50:28 debian aziot-keyd[3282]: 2021-08-24T05:50:28Z [INFO] - Starting service...
Aug 24 14:50:28 debian aziot-keyd[3282]: 2021-08-24T05:50:28Z [INFO] - Version - 1.2.2
Aug 24 14:50:28 debian aziot-keyd[3282]: 2021-08-24T05:50:28Z [INFO] - Loaded libaziot-keys with version 0x02000000
Aug 24 14:50:28 debian aziot-keyd[3282]: 2021-08-24T05:50:28Z [INFO] - Starting server...
Aug 24 14:50:28 debian aziot-keyd[3282]: 2021-08-24T05:50:28Z [INFO] - <-- GET /key/device-id?api-version=2020-09-01 {"host": "keyd.sock"}
Aug 24 14:50:28 debian aziot-keyd[3282]: 2021-08-24T05:50:28Z [INFO] - --> 200 {"content-type": "application/json"}
Aug 24 14:50:28 debian aziot-keyd[3282]: 2021-08-24T05:50:28Z [INFO] - <-- POST /sign?api-version=2020-09-01 {"content-type": "application/json", "host": "keyd.sock", "content-length": "378"}
Aug 24 14:50:28 debian aziot-keyd[3282]: 2021-08-24T05:50:28Z [INFO] - --> 200 {"content-type": "application/json"}
Aug 24 14:50:28 debian aziot-identityd[3280]: 2021-08-24T05:50:28Z [INFO] - Identity reconciliation complete.
Aug 24 14:50:28 debian aziot-identityd[3280]: 2021-08-24T05:50:28Z [INFO] - Starting server...
Aug 24 14:50:28 debian aziot-identityd[3280]: 2021-08-24T05:50:28Z [INFO] - <-- POST /identities/device?api-version=2020-0
...........