Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C8y operation fragment updates done incorrectly during operation execution #3162

Open
albinsuresh opened this issue Oct 4, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@albinsuresh
Copy link
Contributor

albinsuresh commented Oct 4, 2024

Describe the bug

When a Cumulocity operation like software update or firmware update is performed, the corresponding fragment updates are expected to be done before the operation is marked successful as listed below. Refer to the section titled SmartREST example from the operation docs listed below:

  1. For firmware update: Set firmware: Template 115
  2. For software update: Set software list: Template 116
  3. For config update: None for the legacy config update operation that tedge currently supports. The template 120 is applicable only for latest typed file-based configuration updates
  4. For device profile: Templates 115 and 116 as above with an additional 120 for config updates

In the existing impl for software update, the software list is updated, but only after the operation is marked successful whereas it is expected to be done before completing the operation. Same for firmware update operation as well. For device profile, these fragment updates are completely missing.

To Reproduce

Trigger these operations from the cloud and check the order of resultant messages published on the MQTT broker.

Expected behavior

The fragment updates to be done as part of the operation execution, before the operation is marked completed.

**Screenshots

Screenshot 2024-10-05 at 2 00 36 AM

As you can see, the Currently Installed firmware, software and config entries appear as Not installed on the device even after the device profile operation is successful.

Additional context

Even though the device profile operation mandates a 120 message for the applied configuration entries, sending the same doesn't seem sufficient when the device only supports legacy file based config updates. Even when the 120 message is sent, the Currently Installed config entry appears with the warning Installed configuration has the same URL but different name or type than the one in the profile.

This is because the 120 template adds the c8y_Configuration_<config type> fragment to the device, but the legacy config update expects the c8y_ConfigurationDump fragment to be set. There is no explicit SmartREST template available for the same. For individual config update operations, this fragment is added implicitly when the operation is marked successful. But the same doesn't happen when the same operation is applied via a device profile.

@albinsuresh albinsuresh added the bug Something isn't working label Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant