-
Notifications
You must be signed in to change notification settings - Fork 58
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
Cumulocity operation updates fails due to MqttServiceException with message Operation with id xxx for device id yyy not found #3429
Comments
After parsing all of the operations received via JSON, it shows that the operations for the same external id get allocated with different {"delivery":{"log":[],"time":"2025-02-26T16:58:06.309Z","status":"PENDING"},"agentId":"3816339621","creationTime":"2025-02-26T16:58:06.270Z","deviceId":"3316341441","id":"16340838","status":"PENDING","c8y_DownloadConfigFile":{"type":"CONFIG1","url":"https://<redacted>.cumulocity.com/inventory/binaries/5016340837"},"description":"Send configuration snapshot CONFIG1 to device","externalSource":{"externalId":"TST_slash_binary_apple:device:TST_pull_meek_ivy","type":"c8y_Serial"}}
{"delivery":{"log":[],"time":"2025-02-26T16:58:09.449Z","status":"PENDING"},"agentId":"3816339621","creationTime":"2025-02-26T16:58:09.416Z","deviceId":"7316341440","id":"16340847","status":"PENDING","c8y_DownloadConfigFile":{"type":"CONFIG1_BINARY","url":"https://<redacted>.cumulocity.com/inventory/binaries/5216341469"},"description":"Send configuration snapshot CONFIG1_BINARY to device","externalSource":{"externalId":"TST_slash_binary_apple:device:TST_pull_meek_ivy","type":"c8y_Serial"}}
{"delivery":{"log":[],"time":"2025-02-26T17:00:14.303Z","status":"PENDING"},"agentId":"3816339621","creationTime":"2025-02-26T17:00:14.266Z","deviceId":"7316341440","id":"16341151","status":"PENDING","c8y_DownloadConfigFile":{"type":"CONFIG-ROOT","url":"https://<redacted>.cumulocity.com/inventory/binaries/3216342201"},"description":"Send configuration snapshot CONFIG-ROOT to device","externalSource":{"externalId":"TST_slash_binary_apple:device:TST_pull_meek_ivy","type":"c8y_Serial"}}
{"delivery":{"log":[],"time":"2025-02-26T17:02:24.556Z","status":"PENDING"},"agentId":"3816339621","creationTime":"2025-02-26T17:02:24.521Z","deviceId":"3316341441","id":"16343440","status":"PENDING","c8y_DownloadConfigFile":{"type":"CONFIG1","url":"https://<redacted>.cumulocity.com/inventory/binaries/9016342321"},"description":"Send configuration snapshot CONFIG1 to device","externalSource":{"externalId":"TST_slash_binary_apple:device:TST_pull_meek_ivy","type":"c8y_Serial"}}
{"delivery":{"log":[],"time":"2025-02-26T17:02:27.741Z","status":"PENDING"},"agentId":"3816339621","creationTime":"2025-02-26T17:02:27.708Z","deviceId":"7316341440","id":"16343454","status":"PENDING","c8y_DownloadConfigFile":{"type":"CONFIG1_BINARY","url":"https://<redacted>.cumulocity.com/inventory/binaries/1016343453"},"description":"Send configuration snapshot CONFIG1_BINARY to device","externalSource":{"externalId":"TST_slash_binary_apple:device:TST_pull_meek_ivy","type":"c8y_Serial"}}
{"delivery":{"log":[],"time":"2025-02-26T17:04:33.017Z","status":"PENDING"},"agentId":"3816339621","creationTime":"2025-02-26T17:04:32.983Z","deviceId":"7316341440","id":"16343767","status":"PENDING","c8y_DownloadConfigFile":{"type":"CONFIG-ROOT","url":"https://<redacted>.cumulocity.com/inventory/binaries/8716343766"},"description":"Send configuration snapshot CONFIG-ROOT to device","externalSource":{"externalId":"TST_slash_binary_apple:device:TST_pull_meek_ivy","type":"c8y_Serial"}}
{"delivery":{"log":[],"time":"2025-02-26T17:06:52.364Z","status":"PENDING"},"agentId":"3816339621","creationTime":"2025-02-26T17:06:52.268Z","deviceId":"7316341440","id":"16344082","status":"PENDING","c8y_DownloadConfigFile":{"type":"CONFIG1","url":"https://<redacted>.cumulocity.com/inventory/binaries/5116344525"},"description":"Send configuration snapshot CONFIG1 to device","externalSource":{"externalId":"TST_slash_binary_apple:device:TST_pull_meek_ivy","type":"c8y_Serial"}}
{"delivery":{"log":[],"time":"2025-02-26T17:08:55.727Z","status":"PENDING"},"agentId":"3816339621","creationTime":"2025-02-26T17:08:55.698Z","deviceId":"3316341441","id":"16347232","status":"PENDING","c8y_DownloadConfigFile":{"type":"CONFIG1_BINARY","url":"https://<redacted>.cumulocity.com/inventory/binaries/6916345340"},"description":"Send configuration snapshot CONFIG1_BINARY to device","externalSource":{"externalId":"TST_slash_binary_apple:device:TST_pull_meek_ivy","type":"c8y_Serial"}}
{"delivery":{"log":[],"time":"2025-02-26T17:09:04.972Z","status":"PENDING"},"agentId":"3816339621","creationTime":"2025-02-26T17:09:04.943Z","deviceId":"7316341440","id":"16347254","status":"PENDING","c8y_DownloadConfigFile":{"type":"CONFIG-ROOT","url":"https://<redacted>.cumulocity.com/inventory/binaries/5516345343"},"description":"Send configuration snapshot CONFIG-ROOT to device","externalSource":{"externalId":"TST_slash_binary_apple:device:TST_pull_meek_ivy","type":"c8y_Serial"}}
{"delivery":{"log":[],"time":"2025-02-26T17:11:17.040Z","status":"PENDING"},"agentId":"3816339621","creationTime":"2025-02-26T17:11:17.008Z","deviceId":"3316341441","id":"16347308","status":"PENDING","c8y_DownloadConfigFile":{"type":"CONFIG1","url":"https://<redacted>.cumulocity.com/inventory/binaries/4616345349"},"description":"Send configuration snapshot CONFIG1 to device","externalSource":{"externalId":"TST_slash_binary_apple:device:TST_pull_meek_ivy","type":"c8y_Serial"}}
{"delivery":{"log":[],"time":"2025-02-26T17:11:20.645Z","status":"PENDING"},"agentId":"3816339621","creationTime":"2025-02-26T17:11:20.610Z","deviceId":"7316341440","id":"16347310","status":"PENDING","c8y_DownloadConfigFile":{"type":"CONFIG1_BINARY","url":"https://<redacted>.cumulocity.com/inventory/binaries/3916344598"},"description":"Send configuration snapshot CONFIG1_BINARY to device","externalSource":{"externalId":"TST_slash_binary_apple:device:TST_pull_meek_ivy","type":"c8y_Serial"}}
{"delivery":{"log":[],"time":"2025-02-26T17:13:28.407Z","status":"PENDING"},"agentId":"3816339621","creationTime":"2025-02-26T17:13:28.372Z","deviceId":"7316341440","id":"16347315","status":"PENDING","c8y_DownloadConfigFile":{"type":"CONFIG1","url":"invalid://hellö.zip"},"description":"Send configuration snapshot CONFIG1 to device","externalSource":{"externalId":"TST_slash_binary_apple:device:TST_pull_meek_ivy","type":"c8y_Serial"}}
{"delivery":{"log":[],"time":"2025-02-26T17:15:41.552Z","status":"PENDING"},"agentId":"3816339621","creationTime":"2025-02-26T17:15:41.522Z","deviceId":"3316341441","id":"16347321","status":"PENDING","description":"Retrieve CONFIG1 configuration snapshot from device","c8y_UploadConfigFile":{"type":"CONFIG1"},"externalSource":{"externalId":"TST_slash_binary_apple:device:TST_pull_meek_ivy","type":"c8y_Serial"}}
{"delivery":{"log":[],"time":"2025-02-26T17:16:17.876Z","status":"PENDING"},"agentId":"3816339621","creationTime":"2025-02-26T17:16:17.845Z","deviceId":"7316341440","id":"16347323","status":"PENDING","description":"Retrieve CONFIG1_BINARY configuration snapshot from device","c8y_UploadConfigFile":{"type":"CONFIG1_BINARY"},"externalSource":{"externalId":"TST_slash_binary_apple:device:TST_pull_meek_ivy","type":"c8y_Serial"}}
{"delivery":{"log":[],"time":"2025-02-26T17:18:26.793Z","status":"PENDING"},"agentId":"3816339621","creationTime":"2025-02-26T17:18:26.759Z","deviceId":"7316341440","id":"16347327","status":"PENDING","description":"Retrieve unknown_type configuration snapshot from device","c8y_UploadConfigFile":{"type":"unknown_type"},"externalSource":{"externalId":"TST_slash_binary_apple:device:TST_pull_meek_ivy","type":"c8y_Serial"}}
{"delivery":{"log":[],"time":"2025-02-26T17:19:03.932Z","status":"PENDING"},"agentId":"3816339621","creationTime":"2025-02-26T17:19:03.898Z","deviceId":"3316341441","id":"16347331","status":"PENDING","description":"Retrieve CONFIG1 configuration snapshot from device","c8y_UploadConfigFile":{"type":"CONFIG1"},"externalSource":{"externalId":"TST_slash_binary_apple:device:TST_pull_meek_ivy","type":"c8y_Serial"}}
{"delivery":{"log":[],"time":"2025-02-26T17:19:53.805Z","status":"PENDING"},"agentId":"3816339621","creationTime":"2025-02-26T17:19:53.771Z","deviceId":"3316341441","id":"16347337","status":"PENDING","description":"Retrieve CONFIG3 configuration snapshot from device","c8y_UploadConfigFile":{"type":"CONFIG3"},"externalSource":{"externalId":"TST_slash_binary_apple:device:TST_pull_meek_ivy","type":"c8y_Serial"}}
{"delivery":{"log":[],"time":"2025-02-26T17:20:47.167Z","status":"PENDING"},"agentId":"3816339621","creationTime":"2025-02-26T17:20:47.137Z","deviceId":"3316341441","id":"16347344","status":"PENDING","description":"Retrieve [email protected] configuration snapshot from device","c8y_UploadConfigFile":{"type":"[email protected]"},"externalSource":{"externalId":"TST_slash_binary_apple:device:TST_pull_meek_ivy","type":"c8y_Serial"}} The number of operations (18 in total) seem to be split almost evenly between the two different Device ID values:
|
Log file from the test run: log.html.zip |
The deviceId Test Case - Passes (when deviceId=3316341441)Test case Set Configuration from Device Text file (Child Device) ${CHILD_SN} ${PARENT_SN}:device:${CHILD_SN} CONFIG1 /etc/config1.json /home/runner/work/thin-edge.io/thin-edge.io/tests/RobotFramework/tests/cumulocity/configuration/config1-version2.json 640 tedge:tedge delete_file_before=${true} The test case creates an operation for the "correct" ${operation} = {"deviceId": "3316341441", "description": "Send configuration snapshot CONFIG1 to device", "status": "PENDING", "deviceName": "MQTT Device TST_slash_binary_apple:device:TST_pull_meek_ivy", "c8y_Downlo... Result
Operation (as received by the device) Note: the operation associated with the test case was identified using the deliver timestamp: {
"delivery": {
"log": [],
"time": "2025-02-26T16:58:06.309Z",
"status": "PENDING"
},
"agentId": "3816339621",
"creationTime": "2025-02-26T16:58:06.270Z",
"deviceId": "3316341441",
"id": "16340838",
"status": "PENDING",
"c8y_DownloadConfigFile": {
"type": "CONFIG1",
"url": "https://<redacted>.cumulocity.com/inventory/binaries/5016340837"
},
"description": "Send configuration snapshot CONFIG1 to device",
"externalSource": {
"externalId": "TST_slash_binary_apple:device:TST_pull_meek_ivy",
"type": "c8y_Serial"
}
} Test Case - Fails (when deviceId=7316341440)Test case Set Configuration from Device Binary file (Child Device) ${CHILD_SN} ${PARENT_SN}:device:${CHILD_SN} CONFIG1_BINARY /etc/binary-config1.tar.gz /home/runner/work/thin-edge.io/thin-edge.io/tests/RobotFramework/tests/cumulocity/configuration/binary-config1.tar.gz 640 tedge:tedge delete_file_before=${true} The test case creates an operation for the "incorrect" ${operation} = {"deviceId": "7316341440", "description": "Send configuration snapshot CONFIG1_BINARY to device", "status": "PENDING", "deviceName": "TST_pull_meek_ivy", "c8y_DownloadConfigFile": {"type": "CONFIG1_BI... Result
Operation (as received by the device) {
"delivery": {
"log": [],
"time": "2025-02-26T16:58:09.449Z",
"status": "PENDING"
},
"agentId": "3816339621",
"creationTime": "2025-02-26T16:58:09.416Z",
"deviceId": "7316341440",
"id": "16340847",
"status": "PENDING",
"c8y_DownloadConfigFile": {
"type": "CONFIG1_BINARY",
"url": "https://<redacted>.cumulocity.com/inventory/binaries/5216341469"
},
"description": "Send configuration snapshot CONFIG1_BINARY to device",
"externalSource": {
"externalId": "TST_slash_binary_apple:device:TST_pull_meek_ivy",
"type": "c8y_Serial"
}
} |
Looking at the "deviceName" which is added automatically to the operation (after the operation is created via REST API), the devices names are very similar,
This would suggest that there might be a race condition between the registration of a child device via the
|
Describe the bug
Cumulocity errors (published on the
c8y/s/e
topic) were discovered which indicate that a specific operation does not match the device id related to it. The error messages seem to be sent by the server when the operation status is updated via504/505/506
SmartREST messages.For example, the following operation was received via MQTT:
Topic:
c8y/devicecontrol/notifications
Payload:
When the mapper tries updating the operation status, then Cumulocity an error after each message reporting that the operation is not associated with the device. The 504/506 messages are show below along with the response from Cumulocity on the
c8y/s/e
topic:Update operation to EXECUTING: 504,16340847
Update operation to EXECUTING: 506,16340847
However later in the same test suite, the
deviceId
for the device with the same externalId has changed from7316341440
to3316341441
! Though the operation was created about 12 minutes later.Below shows a comparison between the two operations which both share the same external id
TST_slash_binary_apple:device:TST_pull_meek_ivy
, but have differentdeviceId
:To Reproduce
The unexpected behaviour was detected during a failed system test run for an unrelated PR.
Test Suite: Configuration Operation
Tests:
Expected behavior
Screenshots
Environment (please complete the following information):
Debian 12
(Container)Github Runner
x86_64
1.4.3~175+g5d0f3a4
(from PR test: remove maximum mqtt message count assertion #3428)Additional context
Below is the log file containing the full test run:
log.html.zip
The text was updated successfully, but these errors were encountered: