-
Notifications
You must be signed in to change notification settings - Fork 72
cmd/firmware_update topic is not published when using a firmware_update workflow #3145
Description
Describe the bug
tedge-agent does not publish the {topic_id}/cmd/firmware_update retained message when a firmware_update.toml workflow is defined.
This results in the Cumulocity IoT Device Management UI not showing the firmware tab, as the tedge-mapper-c8y did not know receive the operation.
Publishing a manual retain message fixes the issue:
tedge mqtt pub te/device/example///cmd/firmware_update '{}' -rThe logs show that the workflow is being read correctly (at least there are no visible errors),
It seems to be limited to the firmware_update operation, as other workflows
2024-09-28T16:30:34.054226172Z INFO tedge_agent::agent: tedge-agent starting
2024-09-28T16:30:34.054431171Z INFO sm-agent: tedge_agent::agent: Starting tedge-agent v1.3.0
2024-09-28T16:30:34.054849399Z INFO Runtime: Started
2024-09-28T16:30:34.057049651Z INFO sm-agent: tedge_agent::operation_workflows: Using operation workflow definition from "/root/dummy/operations/device_profile.toml" for 'device_profile' operation
2024-09-28T16:30:34.058983497Z INFO sm-agent: tedge_agent::operation_workflows: Using operation workflow definition from "/root/dummy/operations/firmware_update.toml" for 'firmware_update' operation
2024-09-28T16:30:34.060869688Z INFO sm-agent: tedge_agent::operation_workflows: Using operation workflow definition from "/root/dummy/operations/custom_op.toml" for 'custom_op' operation
And below shows the retained messages registered
$ tedge mqtt sub 'te/device/example//#'
[te/device/example///cmd/restart] {}
[te/device/example///cmd/log_upload] {"types":["software-management"]}
[te/device/example///cmd/config_snapshot] {"types":["tedge-configuration-plugin","tedge-log-plugin","tedge.toml"]}
[te/device/example///cmd/config_update] {"types":["tedge-configuration-plugin","tedge-log-plugin","tedge.toml"]}
[te/device/example///cmd/software_list] {"types":[]}
[te/device/example///cmd/software_update] {"types":[]}
[te/device/example///cmd/custom_op] {}To Reproduce
-
Add a valid firmware_update workflow
TEDGE_CONFIG_DIR=$PWD/dummy tedge init cp /etc/tedge/operations/firmware_update.toml $PWD/dummy/operations
-
Start a tedge-agent
TEDGE_CONFIG_DIR=$PWD/dummy TEDGE_RUN_LOCK_FILES=false tedge-agent --mqtt-topic-root dummy --mqtt-device-topic-id device/example// -
Stop the agent using ctrl-c (after about ~10 seconds)
-
Check the retained messages on the MQTT broker
TEDGE_CONFIG_DIR=$PWD/dummy tedge mqtt sub 'dummy/device/example//#'
Expected behavior
Screenshots
Environment (please complete the following information):
- OS [incl. version]
- Hardware [incl. revision]
- System-Architecture [e.g. result of "uname -a"]
- thin-edge.io version [e.g. 0.1.0]
Additional context