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

duplicate 114 SmartREST messages sent to Cumulocity IoT in quick succession #2574

Closed
reubenmiller opened this issue Jan 9, 2024 · 2 comments
Assignees
Labels
bug Something isn't working theme:c8y Theme: Cumulocity related topics theme:mqtt Theme: mqtt and mosquitto related topics
Milestone

Comments

@reubenmiller
Copy link
Contributor

Describe the bug

Duplicate Cumulocity IoT SmartREST messages with message id 114 are sent in very short succession, e.g. 10 messages are sent within 170ms.

Below shows the MQTT log snippet pulled from a system test run.

2024-01-09T16:03:33.039402       c8y/s/us                            114,c8y_DownloadConfigFile,c8y_LogfileRequest,c8y_RemoteAccessConnect,c8y_Restart,c8y_SoftwareUpdate,c8y_UploadConfigFile
2024-01-09T16:03:33.039427       c8y/s/us                            114,c8y_DownloadConfigFile,c8y_LogfileRequest,c8y_RemoteAccessConnect,c8y_Restart,c8y_SoftwareUpdate,c8y_UploadConfigFile
2024-01-09T16:03:33.039445       c8y/s/us                            114,c8y_DownloadConfigFile,c8y_LogfileRequest,c8y_RemoteAccessConnect,c8y_Restart,c8y_SoftwareUpdate,c8y_UploadConfigFile
2024-01-09T16:03:33.039461       c8y/s/us                            114,c8y_DownloadConfigFile,c8y_LogfileRequest,c8y_RemoteAccessConnect,c8y_Restart,c8y_SoftwareUpdate,c8y_UploadConfigFile
2024-01-09T16:03:33.039477       c8y/s/us                            114,c8y_DownloadConfigFile,c8y_LogfileRequest,c8y_RemoteAccessConnect,c8y_Restart,c8y_SoftwareUpdate,c8y_UploadConfigFile
2024-01-09T16:03:33.039493       c8y/s/us                            114,c8y_DownloadConfigFile,c8y_LogfileRequest,c8y_RemoteAccessConnect,c8y_Restart,c8y_SoftwareUpdate,c8y_UploadConfigFile
2024-01-09T16:03:33.039509       c8y/s/us                            114,c8y_DownloadConfigFile,c8y_LogfileRequest,c8y_RemoteAccessConnect,c8y_Restart,c8y_SoftwareUpdate,c8y_UploadConfigFile
2024-01-09T16:03:33.039525       c8y/s/us                            114,c8y_DownloadConfigFile,c8y_LogfileRequest,c8y_RemoteAccessConnect,c8y_Restart,c8y_SoftwareUpdate,c8y_UploadConfigFile
2024-01-09T16:03:33.039541       c8y/s/us                            114,c8y_DownloadConfigFile,c8y_LogfileRequest,c8y_RemoteAccessConnect,c8y_Restart,c8y_SoftwareUpdate,c8y_UploadConfigFile
2024-01-09T16:03:33.039556       c8y/s/us                            114,c8y_DownloadConfigFile,c8y_LogfileRequest,c8y_RemoteAccessConnect,c8y_Restart,c8y_SoftwareUpdate,c8y_UploadConfigFile
2024-01-09T16:03:33.039572       tedge/commands/req/software/list    {"id":"c8y-mapper-2024-01-09T16:03:32.979985356Z"}

This issue is very similar to the following issues:

To Reproduce

The error is visible by running the system tests, and checking the MQTT log history (which is included in the test report).

Expected behavior

Screenshots

Environment (please complete the following information):

  • OS [incl. version]: Ubuntu 20.04
  • Hardware [incl. revision]: docker
  • System-Architecture [e.g. result of "uname -a"]: Github Action Ubuntu 20.04 Runner
  • thin-edge.io version [e.g. 0.1.0]: 1.0.0~rc.2~42+g47f393e

Additional context

@reubenmiller reubenmiller added the bug Something isn't working label Jan 9, 2024
@reubenmiller reubenmiller added this to the 1.0.0 milestone Jan 9, 2024
@reubenmiller reubenmiller added theme:c8y Theme: Cumulocity related topics theme:mqtt Theme: mqtt and mosquitto related topics labels Jan 9, 2024
@Bravo555 Bravo555 self-assigned this Jan 10, 2024
@Bravo555
Copy link
Contributor

The duplicates are created because:

  1. we read the operations directory when we construct an internal topic filter in crates/extensions/c8y_mapper_ext/src/config.rs:205, constructing a full list of operations
  2. But we also send 114 when we get "operation registration" MQTT messages, e.g. on topic te/device/main///cmd/restart

The best solution would be most likely to make a current list of supported operation a part of digital twin, which should send messages only when there are actually any changes send.

@Bravo555 Bravo555 removed their assignment Jan 16, 2024
@gligorisaev gligorisaev self-assigned this Jan 16, 2024
@gligorisaev
Copy link
Contributor

QA has thoroughly checked the bug and here are the results:

  • Test for ticket exists in the test suite.
  • tests/RobotFramework/tests/cumulocity/supported_operations/mapper-publishing-agent-supported-ops.robot
  • QA has tested the bug and it's not reproducable anymore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working theme:c8y Theme: Cumulocity related topics theme:mqtt Theme: mqtt and mosquitto related topics
Projects
None yet
Development

No branches or pull requests

3 participants