Error while deploying an Update package using Azure device update for IoT Hub

Hari Prashanth 25 Reputation points
2023-08-04T17:21:29.1533333+00:00

I have an update script that contains just these two command as shown below to update the system packages of an Ubuntu server to the latest.

#!/bin/bash
sudo apt update -y 
sudo apt upgrade -y

I had created an importmanifest.json file as shown below.

{
  "compatibility": [
    {
      "manufacturer": "intel",
      "model": "edgeappliance"
    }
  ],
  "createdDateTime": "2023-08-03T11:24:23Z",
  "description": "ubuntu update",
  "files": [
    {
      "filename": "updatescript.sh",
      "hashes": {
        "sha256": "petQB+fmawhdUvXM+rEnxR86syv0KoAVHz47ic7o220="
      },
      "sizeInBytes": 97
    }
  ],
  "instructions": {
    "steps": [
      {
        "handler": "microsoft/script:1",
		"files": [
          "updatescript.sh"
        ],
		"handlerProperties": {
                    "scriptFileName": "updatescript.sh"
        },
        "type": "inline"
      }
    ]
  },
  "manifestVersion": "5.0",
  "updateId": {
    "name": "systemupdate",
    "provider": "Stratus",
    "version": "1.1"
  }
}

I had created an update package using the above importmanifest.json and the update script file. While trying to deploy the update, getting the below extended response code and description in Device update for IoT hub.

Extended result code: 810549765

Description: Cannot parse the script result file '/var/lib/adu/downloads/d270d434-629d-4b08-b553-73f79c763380/action--action-download_aduc_result.json'.

Need to understand if the script ran fine while deploying the update and the changes to be made in script/importmanifest file to get a success response from device agent on the IoT edge device

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.
598 questions
{count} votes

Accepted answer
  1. LeelaRajeshSayana-MSFT 17,766 Reputation points Moderator
    2023-08-09T00:50:35.97+00:00

    Hi @Hari Prashanth Sharing pointers from the thread Device update failing to help other community members with similar issue.

    Here are some points that you might seem helpful.

    1. Your update script is wrong. IoT hub expects the script in a specific manner(Some functions and flags should be there by default you can add yours on top of it). Refer to example script to generate your script.
    2. To understand the execution of the script on the device side please refer to the readme.MD . Not very descriptive but still give you basic idea of how the script is executed on the device side.
    3. Now coming on to the actual issue that you are facing, that error code 810549765 which means ADUC_ERC_SCRIPT_HANDLER_INSTALL_FAILURE_PARSE_RESULT_FILE. You can find the extended results codes here .
    4. The script gets called at different stages with different flags. The following are the flags that get called, in chronological order
      1. --action-is-installed
      2. --action-download
      3. --action-install
      4. --action-apply
      5. --action-cancel, if needed
      6. All of these flags are not passed at the same time. The script run again and again with different flags. At each stage a result file is generated, which decides the execution of the next step.
      7. In your scenario, it is not able to find the download result file, action--action-download_aduc_result.json. Hence the error.
      8. My advice is just fix your update script as per the example script and this particular error should be gone.
      9. Last but not the least, try referring to the repo than the official documentation. It is easier to understand what is happening when you're looking at the actual code.

    Please let us know if you need any additional assistance on this issue.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

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.