Azure / iot-hub-device-update

Device Update for IoT Hub agent
MIT License
51 stars 36 forks source link

Ignore duplicate deployment workflow not working as expected #609

Open JoergZeidler opened 4 months ago

JoergZeidler commented 4 months ago

During long-term testing I encountered an issue with the deployment status.

Expected Behavior

Deployment status should not change even after a token expiry refresh.

Current Behavior

Deployment status changed from Successfully back to In Progress.

Steps to Reproduce

  1. Prepare device with software version "A"
  2. Start an update via IotHub to software version "B"
  3. software version "B" successfully deployed on device 3.1. current update state is succeeded 3.2 deployment status is succeeded (module twin: reported property "state": 0)
  4. wait at least 1h
  5. check deployment status: 5.1. deployments status changed to "in progress" (module twin: reported property "state": 6) -> NOK 5.1. current update state still succeeded

Device Information

DU Agent Version 1.1.0

Logs

token expiry connection refresh changed deployment status to "in progress"

log.txt

cutout:

Ignoring duplicate deployment 6409ddb9d8ce39ade510df4a-20242685040, action 3

[ADUC_Workflow_HandleUpdateAction:714]
PropertyUpdated event handler completed. [ADUC_Workflow_HandlePropertyUpdate:638]
Queueing message (t:1, c:0xff3f1c40, m:{"deviceUpdate":{"__t":"c","service":{"value":{"workflow":{"action":3,"id":"6409ddb9d8ce39ade>
OrchestratorPropertyUpdateCallback ended [OrchestratorUpdateCallback:517]
Sending D2C message (t:0, retries:0). [ProcessMessage:390]
Sending D2C message:
 {"deviceUpdate":{"__t":"c","agent":{"lastInstallResult":{"stepResults":null,"resultCode":1,"extendedResultCodes":"00000000","resultDetails":null},**"state":6,"**workflow":{"acti>
 2024-03-06T09:41:32.1685Z 1276[1276] [D] Sending D2C message (t:1, retries:0). [ProcessMessage:390]

Additional Information

PR to fix the issue

JoergZeidler commented 3 months ago

I found another use case where the deployment status will be switched back to "in Progress". Use Case "consciously forcing a failed state"

Imho, the agent should not touch the last state in case he doesn't do anything... -> Ignoring Retry. currentRetryToken '(NULL)', nextRetryToken '(NULL)'

JoergZeidler commented 2 months ago

Any news about that topic in general?

Unfortunately, I haven't found a solution by myself for the use case(https://github.com/Azure/iot-hub-device-update/issues/609#issuecomment-1985562107) yet and need pls support here....

agreentree-dmc commented 1 month ago

@JoergZeidler Have you heard anything further on this topic or found a work-around? I am experiencing the same issue.

JoergZeidler commented 1 month ago

@JoergZeidler Have you heard anything further on this topic or found a work-around? I am experiencing the same issue.

@agreentree-dmc unfortunately no.....