azureazure-iot-hubazure-iot-hub-device-update

Problem on starting AducIotAgent "Unable to initialize the diagnostic workflow data. [DiagnosticsInterface_Create]"


I'm trying to run AducIotAgent on my ubuntu 20.04 just for testing. By the documentation, I cloned https://github.com/Azure/iot-hub-device-update and tried these:

./scripts/install-deps.sh -a
sudo cmake --build out --target install

Also cloned https://github.com/microsoft/do-client and followed install instructions on the page:

python3 build/build.py --project agent --package-for deb
cd /tmp/build-deliveryoptimization-agent/linux-debug/
sudo apt-get install ./deliveryoptimization-agent*.deb
cd <project root>
python3 build/build.py --project plugin-apt --package-for deb

cd /tmp/build-deliveryoptimization-sdk/linux-debug/
sudo apt-get install ./libdeliveryoptimization*.deb
cd /tmp/build-deliveryoptimization-agent/linux-debug/
sudo apt-get install ./deliveryoptimization-agent*.deb
cd /tmp/build-deliveryoptimization-plugin-apt/linux-debug/
sudo apt-get install ./deliveryoptimization-plugin-apt*.deb

Then I created a device on iothub, grap its connection string and created on my ubuntu the config (/etc/adu/du-config.json) file:

{
  "schemaVersion": "1.0",
  "aduShellTrustedUsers": [
     "adu",
     "do"
  ],
  "manufacturer": "fabrikam",
  "model": "vacuum",
  "agents": [
     {
     "name": "main",
     "runas": "adu",
     "connectionSource": {
        "connectionType": "string",
        "connectionData": "<created device on azure iothub connection String>"
     },
     "manufacturer": "fabrikam",
     "model": "vacuum"
     }
  ]}

So I was expecting everything to work, but when I run

sudo AducIotAgent --enable-iothub-tracing --log-level 1

I get:

2023-09-07T07:57:11.8021Z 3717069[3717069] [I] Agent (linux; 1.0.2) starting. [main]
2023-09-07T07:57:11.8021Z 3717069[3717069] [I] Git Info: main:f9b180de [main]
2023-09-07T07:57:11.8021Z 3717069[3717069] [I] Supported Update Manifest version: min: 4, max: 5 [main]
2023-09-07T07:57:11.8022Z 3717069[3717069] [I] Health check passed. [HealthCheck]
2023-09-07T07:57:11.8023Z 3717069[3717069] [I] Initializing PnP components. [ADUC_PnP_Components_Create]
2023-09-07T07:57:11.8023Z 3717069[3717069] [I] ADUC agent started. Using IoT Hub Client SDK 1.7.0 [AzureDeviceUpdateCoreInterface_Create]
2023-09-07T07:57:11.8023Z 3717069[3717069] [I] Calling ADUC_RegisterPlatformLayer [ADUC_MethodCall_Register]
2023-09-07T07:57:11.8023Z 3717069[3717069] [E] Unable to initialize the diagnostic workflow data. [DiagnosticsInterface_Create]
2023-09-07T07:57:11.8023Z 3717069[3717069] [E] Failed to initialize PnP component 'diagnosticInformation'. [ADUC_PnP_Components_Create]
2023-09-07T07:57:11.8023Z 3717069[3717069] [I] ADUC agent stopping [AzureDeviceUpdateCoreInterface_Destroy]
2023-09-07T07:57:11.8023Z 3717069[3717069] [I] Calling ADUC_Unregister [ADUC_MethodCall_Unregister]
2023-09-07T07:57:11.8023Z 3717069[3717069] [E] ADUC_PnP_Components_Create failed [StartupAgent]
2023-09-07T07:57:11.8023Z 3717069[3717069] [I] Agent exited with code 1 [main]
2023-09-07T07:57:11.8023Z 3717069[3717069] [I] Agent is shutting down with signal 0. [ShutdownAgent]
2023-09-07T07:57:11.8023Z 3717069[3717069] [I] De-initializing command listener thread [UninitializeCommandListenerThread]
2023-09-07T07:57:11.8023Z 3717069[3717069] [I] ADUC agent stopping [AzureDeviceUpdateCoreInterface_Destroy]

I don't know if I'm missing some configuration, some handler implementation, but I'd like to fix and be able to run AducIotAgent.

Any clues?


Solution

  • Solved after adding missing file: du-diagnostics-config.json