启动 AducIotAgent 时出现问题“无法初始化诊断工作流程数据。[DiagnosticsInterface_Create]”

问题描述 投票:0回答:1

我正在尝试在我的 ubuntu 20.04 上运行 AducIotAgent 只是为了测试。通过文档,我克隆了 https://github.com/Azure/iot-hub-device-update 并尝试了这些:

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

还克隆了https://github.com/microsoft/do-client并按照页面上的安装说明进行操作:

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

然后我在 iothub 上创建了一个设备,获取其连接字符串并在我的 ubuntu 上创建了配置(/etc/adu/du-config.json)文件:

{
  "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"
     }
  ]}

所以我期待一切顺利,但是当我跑步时

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

我得到:

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]

我不知道我是否缺少一些配置、一些处理程序实现,但我想修复并能够运行 AducIotAgent。

有什么线索吗?

azure azure-iot-hub azure-iot-hub-device-update
1个回答
0
投票

添加缺失文件后解决:du-diagnostics-config.json

© www.soinside.com 2019 - 2024. All rights reserved.