How to push the software update file using device update agent to ubuntu system?

Saxena, Shreyansh 5 Reputation points
2023-10-27T07:33:38.3666667+00:00

We have created a SWU file that contains sample python application, software description file & preinstall.sh script.

While trying to push a SWU file using azure device update through the azure portal to ubuntu, this process is getting failed with the following errors:

  • SWU file is not getting downloaded completely in this location: '/var/lib/adu/downloads'
  • The shell script "example-a-b-update.sh" is getting downloaded and executed post which it is getting deleted.

Logs

  • DU Agent logs

2023-10-27T06:48:07.0691Z 310[310] [D] context:0xb1ec34e0 [DefaultIoTHubSendReportedStateCompletedCallback]

2023-10-27T06:48:07.0691Z 310[310] [D] D2C message processed successfully (t:0, r:0, content:0xb38737d0 ) [DefaultIoTHubSendReportedStateCompletedCallback]

2023-10-27T06:48:07.0691Z 310[310] [D] Send message completed (status:3) [OnUpdateResultD2CMessageCompleted]

2023-10-27T06:48:07.3697Z 310[310] [D] context:0xb1ec3580 [DefaultIoTHubSendReportedStateCompletedCallback]

2023-10-27T06:48:07.3697Z 310[310] [D] D2C message processed successfully (t:1, r:0, content:0xb38d6870 ) [DefaultIoTHubSendReportedStateCompletedCallback]

2023-10-27T06:48:07.3697Z 310[310] [D] Send message completed (status:3) [OnUpdateResultD2CMessageCompleted]

2023-10-27T06:48:09.0319Z 310[6531] [I] Action 'Download' complete. Result: 0 (failed), 806355461 (0x30100205) [ADUC_Workflow_WorkCompletionCallback]

2023-10-27T06:48:09.0319Z 310[6531] [I] WorkCompletionCallback: Download failed. Going to state Failed [ADUC_Workflow_WorkCompletionCallback]

2023-10-27T06:48:09.0319Z 310[6531] [I] Setting UpdateState to Failed [ADUC_Workflow_SetUpdateStateHelper]

2023-10-27T06:48:09.0320Z 310[6531] [D] [ADUC_D2C_Message_SendAsync] ==== MULTI-LINE LOG BEGIN ====

Queueing message (t:0, c:0x80078b0, m:{"deviceUpdate":{"__t":"c","agent":{"lastInstallResult":{"stepResults":{"step_0":{"resultCode":0,"extendedResultCode":806355461,"resu>

2023-10-27T06:48:09.0320Z 310[6531] [I] Workflow is Complete. [ADUC_Workflow_AutoTransitionWorkflow]

2023-10-27T06:48:09.0728Z 310[310] [D] Sending D2C message (t:0, retries:0). [ProcessMessage]

2023-10-27T06:48:09.0728Z 310[310] [D] [ADUC_D2C_Default_Message_Transport_Function] ==== MULTI-LINE LOG BEGIN ====

Sending D2C message:

{"deviceUpdate":{"__t":"c","agent":{"lastInstallResult":{"stepResults":{"step_0":{"resultCode":0,"extendedResultCode":806355461,"resultDetails":"The install script doesn't>

2023-10-27T06:48:09.6739Z 310[310] [D] context:0xb1ec34e0 [DefaultIoTHubSendReportedStateCompletedCallback]

2023-10-27T06:48:09.6739Z 310[310] [D] D2C message processed successfully (t:0, r:0, content:0x8007af0 ) [DefaultIoTHubSendReportedStateCompletedCallback]

2023-10-27T06:48:09.6739Z 310[310] [D] Send message completed (status:3) [OnUpdateResultD2CMessageCompleted]

2023-10-27T06:53:30.4320Z 310[310] [D] IotHub connection status: 1, reason: 7 [IoTHub_CommunicationManager_ConnectionStatus_Callback]

2023-10-27T06:53:30.4320Z 310[310] [E] IoTHub connection is broken. [IoTHub_CommunicationManager_ConnectionStatus_Callback]

2023-10-27T06:53:30.5410Z 310[310] [I] Refreshing the handle for the PnP channels. [ADUC_PnP_Components_HandleRefresh]

2023-10-27T06:53:31.6892Z 310[310] [I] Attempting to create connection to IotHub using type: ADUC_ConnType_Module [ADUC_DeviceClient_Create]

2023-10-27T06:53:31.6893Z 310[310] [I] IotHub Protocol: MQTT [GetIotHubProtocolFromConfig]

2023-10-27T06:53:31.6905Z 310[310] [I] IoTHub Device Twin callback registered. [ADUC_DeviceClient_Create]

2023-10-27T06:53:31.6905Z 310[310] [I] Refreshing the handle for the PnP channels. [ADUC_PnP_Components_HandleRefresh]

2023-10-27T06:53:31.6905Z 310[310] [I] Successfully re-authenticated the IoT Hub connection. [ADUC_Refresh_IotHub_Connection_SAS_Token]

  • SWU Update log

2023-10-27T06:48:07.5018Z 310[6531] [I] [SWUpdateHandler_PerformAction] ==== MULTI-LINE LOG BEGIN ====

2023-10-27T06:48:07.4950Z 6535[6535] [I] Run as uid(0), defaultUid(114), effectiveUid(0), effectiveGid(121) [main]

2023-10-27T06:48:07.4950Z 6535[6535] [I] Executing script. Path: /var/lib/adu/downloads/611718c8-bace-4c77-b60d-a0c9ede7c965/example-du-swupdate-script.sh [Execute]

2023-10-27T06:48:07.4996Z 6535[6535] [I] ########## Begin Child's Logs ########## [ShowChildProcessLogs]

2023-10-27T06:48:07.4997Z 6535[6535] [I] # ^[[1;33mWarning:^[[0m ************************************************* [ShowChildProcessLogs]

2023-10-27T06:48:07.4997Z 6535[6535] [I] # ^[[1;33mWarning:^[[0m * WARNING * [ShowChildProcessLogs]

2023-10-27T06:48:07.4997Z 6535[6535] [I] # ^[[1;33mWarning:^[[0m * * [ShowChildProcessLogs]

2023-10-27T06:48:07.4997Z 6535[6535] [I] # ^[[1;33mWarning:^[[0m * THIS FILE IS FOR DEMONSTRATION PURPOSES ONLY. * [ShowChildProcessLogs]

2023-10-27T06:48:07.4997Z 6535[6535] [I] # ^[[1;33mWarning:^[[0m * DO NOT USE THIS FOR YOUR REAL PRODUCT UPDATE! * [ShowChildProcessLogs]

2023-10-27T06:48:07.4997Z 6535[6535] [I] # ^[[1;33mWarning:^[[0m * * [ShowChildProcessLogs]

2023-10-27T06:48:07.4997Z 6535[6535] [I] # ^[[1;33mWarning:^[[0m ************************************************* [ShowChildProcessLogs]

2023-10-27T06:48:07.4997Z 6535[6535] [I] # /var/lib/adu/downloads/611718c8-bace-4c77-b60d-a0c9ede7c965/example-du-swupdate-script.sh: line 93: syntax error: unexpected en>2023-10-27T06:48:07.4997Z 6535[6535] [I] ########## End Child's Logs ########## [ShowChildProcessLogs]

2023-10-27T06:48:07.5018Z 310[6531] [I] [SWUpdateHandler_PerformAction] ==== MULTI-LINE LOG END ====

2023-10-27T06:48:07.5021Z 310[6531] [I] Downloading file #0 [Download]

2023-10-27T06:48:07.5024Z 310[6531] [E] Invalid Hash, Expect: iq/fG56uWOvRoUaXe6wU+H0TkvQ3TEYeRvceA91bft8=, Result: NU1JybYWauUxFeJDn2pQ+yXerXly96k859FoAtpccJo=, SHAversio>2023-10-27T06:48:07.5025Z 310[6531] [I] Downloading file #1 [Download]

2023-10-27T06:48:07.5026Z 310[6531] [I] Downloading full target update payload to '/var/lib/adu/downloads/611718c8-bace-4c77-b60d-a0c9ede7c965/du-agent-swupdate-filecopy-t>2023-10-27T06:48:09.0090Z 310[6531] [I] Action (--action-download) begin [SWUpdateHandler_PerformAction]

2023-10-27T06:48:09.0090Z 310[6531] [I] Parsing handlerProperties.arguments: --swu-file /var/lib/adu/downloads/*/du-agent-swupdate-filecopy-test-1_1.0.swu --restart-to-app>2023-10-27T06:48:09.0318Z 310[6531] [E] Install failed, extendedResultCode:0x30101001 (exitCode:1) [SWUpdateHandler_PerformAction]

2023-10-27T06:48:09.0319Z 310[6531] [I] [SWUpdateHandler_PerformAction] ==== MULTI-LINE LOG BEGIN ====

2023-10-27T06:48:09.0312Z 6538[6538] [I] Run as uid(0), defaultUid(114), effectiveUid(0), effectiveGid(121) [main]

2023-10-27T06:48:09.0312Z 6538[6538] [I] Executing script. Path: /var/lib/adu/downloads/611718c8-bace-4c77-b60d-a0c9ede7c965/example-du-swupdate-script.sh [Execute]

2023-10-27T06:48:09.0316Z 6538[6538] [I] ########## Begin Child's Logs ########## [ShowChildProcessLogs]

2023-10-27T06:48:09.0316Z 6538[6538] [I] # execvp failed, returned -1, error 2 [ShowChildProcessLogs]

2023-10-27T06:48:09.0316Z 6538[6538] [I] ########## End Child's Logs ########## [ShowChildProcessLogs]

Azure device update portal log


The install script doesn't create a result file '/var/lib/adu/downloads/611718c8-bace-4c77-b60d-a0c9ede7c965/aduc_result.json'.

 

Please respond to the query as soon as possible,

Thanks in advance!!

Azure IoT Edge
Azure IoT Edge
An Azure service that is used to deploy cloud workloads to run on internet of things (IoT) edge devices via standard containers.
576 questions
Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,205 questions
{count} vote

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.