Giter VIP home page Giter VIP logo

Comments (7)

andrewbrownmsft avatar andrewbrownmsft commented on July 30, 2024 1

Got it, that's what I thought but wanted to be sure. In that case, @eshashah-msft, can you take a look here?

from iot-hub-device-update.

andrewbrownmsft avatar andrewbrownmsft commented on July 30, 2024

Hi. Where is the failure occurring? Is it when importing the update into the DU service, or on the device?

from iot-hub-device-update.

UlisesGascon avatar UlisesGascon commented on July 30, 2024

Hi @andrewbrownmsft :)

On the device, the importation worked fine.

from iot-hub-device-update.

jw-msft avatar jw-msft commented on July 30, 2024

@UlisesGascon Is this the top-level "name" property or the "name" properties in the packages array elements? It's unclear if it's the top-level name property or those in the packages array and if it's the property name or the property value.

Could the repro .json file be provided?

The "Failed to parse specified APT file" trace occurs when the Parson library json_parse_file() call returns NULL here:

Log_Error("Failed to parse specified APT file (%s).", filepath.c_str());

I created the following test app that just calls json_parse_file() and returns 0 on success or 1 on failure:

#include <parson.h>
int main(int argc, char**argv) {
    return NULL == json_parse_file(argv[1]) ? 1 : 0;
}

and built it with:
gcc -g main.c -lparson

After a wget https://raw.githubusercontent.com/UlisesGascon/poc-azure-iot-du-custom-package/main/corretto-1.0.2-manifest.json, I did:

$ ./a.out corretto-1.0.2-manifest.json
$ echo $?
0

I tried making the following changes, but they also all returned 0 (success):

  • "name" to "na:me"
  • "Corretto machine initial manifest" to "Corr:etto machine initial manifest"
  • "name" to "na:me" in packages array
  • "demoapi" to "demo:api"

from iot-hub-device-update.

UlisesGascon avatar UlisesGascon commented on July 30, 2024

Thanks for all the work and the research @jw-msft! Can you try with this one?

from iot-hub-device-update.

jw-msft avatar jw-msft commented on July 30, 2024

Downloaded that file and test app succeeded (parson parses it successfully) -- I see it has the colon char in the value of top-level name property and test app succeeded(0), which should be fine.

Next, I did an E2E repro with released Ubuntu 18.04 DU Agent, but was also not able to repro.

The only thing I can think of that might lead to the issue you're seeing is if you had an old/buggy version of built libparson.a static lib installed on the system in the lib path and then built DU agent from sources with that, or maybe something's introducing some weird non-printable character in the APT manifest.json right before you're uploading it to azure portal blob storage.

E2E Repro Attempt

Here is how I went about the repro attempt:

wget https://packages.microsoft.com/ubuntu/18.04/multiarch/prod/pool/main/d/deliveryoptimization-agent/libdeliveryoptimization_1.0.0_amd64.deb
wget https://packages.microsoft.com/ubuntu/18.04/multiarch/prod/pool/main/libd/libdeliveryoptimization/libdeliveryoptimization_1.0.0_amd64.deb
sudo apt-get install ./deliveryoptimization-agent/libdeliveryoptimization_1.0.0_amd64.deb
sudo apt-get install ./libdeliveryoptimization_1.0.0_amd64.deb
  • Installed released DeviceUpdate v1.0.2 agent from .deb pkg on packages.microsoft.com:
wget https://packages.microsoft.com/ubuntu/18.04/multiarch/prod/pool/main/d/deviceupdate-agent/deviceupdate-agent_1.0.2_ubuntu1804_amd64.deb
sudo apt-get install ./deviceupdate-agent/deviceupdate-agent_1.0.2_ubuntu1804_amd64.deb
  • Setup the /etc/adu/du-config.json with Manufacturer "Contoso" and Model "Toaster"
  • Created and uploaded an import manifest (including the apt manifest json that I renamed to value_colon_manifest.json) for APT package update.

Result

As can be seen from du-agent.20230817-192435.log in the zip, the apt json parse issue was not hit and it continued on to download phase of apt package install, invoking apt that attempted to download those packages.

Zip of adu logs from repro attempt and import manifest used:

repro_attempt.zip

Further steps to try

  • Build DU agent from sources with debug symbols included
git clone https://github.com/azure/iot-hub-device-update
cd iot-hub-device-update
./scripts/install-deps.sh -a
./scripts/build.sh -c --build-packages
cd out
  • sudo apt install the .deb in out

  • sudo apt install gdb

  • gdb --args /usr/bin/AducIotAgent -l0 -e

  • set breakpoint in AptParser::ParseAptContentFromFile and drill down into the parson json_parse_file function

from iot-hub-device-update.

jw-msft avatar jw-msft commented on July 30, 2024

Closing due to stale issue and was not able to repro with the latest provided manifest.

from iot-hub-device-update.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.