Skip to content

Edge Agent crashes with ArgumentNullException on DPS provisioning - Ubuntu 24.04 ARM64 #7474

@ryanmkelley

Description

@ryanmkelley

Expected Behavior

Edge Agent should start successfully after DPS provisioning with symmetric key attestation.

Current Behavior

Edge Agent crashes immediately with ArgumentNullException at Program.cs line 218 when using DPS provisioning. Manual provisioning with a connection string works perfectly on the same hardware and deployment.

Steps to Reproduce

  1. Install IoT Edge 1.5 on Ubuntu 24.04 ARM64 (Raspberry Pi5)
  2. Configure DPS provisioning with an individual claim symmetric key
  3. Apply configuration with the following .sh
# Try to add Microsoft repository (for IoT Edge)
curl -sSL https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb -o packages-microsoft-prod.deb
dpkg -i packages-microsoft-prod.deb || true
rm -f packages-microsoft-prod.deb

# Update again
apt-get update

# Install IoT Edge
echo "Installing IoT Edge..."
apt-get install -y aziot-edge || {
    echo "Failed to install aziot-edge. It may not be available for Ubuntu 24.04"
    echo "You may need to use Ubuntu 22.04 instead"
    exit 1
}

# Copy config
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cp "$SCRIPT_DIR/config.toml" /etc/aziot/config.toml

# Apply configuration
iotedge config apply

systemctl enable aziot-edged
systemctl start aziot-edged

Context (Environment)

  • Host OS: Ubuntu 24.04 LTS
  • Architecture: ARM64 (Raspberry Pi 4)
  • Container OS: Linux containers
  • Runtime Versions:
    • IoT Edge: 1.5.21-1
    • Azure IoT Identity Service: 1.5.6-1
    • Edge Agent: mcr.microsoft.com/azureiotedge-agent:1.5
    • Edge Hub: mcr.microsoft.com/azureiotedge-hub:1.5
  • Docker: docker.io 27.5.1-0ubuntu3~24.04.2

Additional Information

What Works

  • Manual provisioning with connection string works perfectly
  • All environment variables are present in Edge Agent container (including IOTEDGE_APIVERSION)
  • DPS provisioning completes successfully
  • Deployment is applied (IoT Hub shows appliedCount: 1)

Root Cause Analysis

This appears to be a race condition where Edge Agent tries to read configuration before it's fully available after DPS provisioning. The issue is specific to:

  • DPS provisioning (manual works)
  • Ubuntu 24.04 (newer systemd/kernel)
  • ARM64 architecture
  • IoT Edge 1.5

Workaround

Clearing Edge Agent state and restarting services fixes the issue:

sudo systemctl stop aziot-edged
sudo docker rm -f edgeAgent
sudo rm -rf /tmp/edgeAgent*
sleep 10
sudo systemctl start aziot-edged

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions