Comments (7)
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.
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.
Hi @andrewbrownmsft :)
On the device, the importation worked fine.
from iot-hub-device-update.
@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:
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.
Thanks for all the work and the research @jw-msft! Can you try with this one?
from iot-hub-device-update.
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:
-
Created a new Ubuntu 18.04.6 LTS VM using https://cdimage.ubuntu.com/releases/18.04/release/ubuntu-18.04.6-server-amd64.iso linked from https://cdimage.ubuntu.com/releases/18.04/release/
-
Installed DeliveryOptimization v1.0.0 agent dependency from .deb pkg on packages.microsoft.com:
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:
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 parsonjson_parse_file
function
from iot-hub-device-update.
Closing due to stale issue and was not able to repro with the latest provided manifest.
from iot-hub-device-update.
Related Issues (20)
- Debian 10 Unable to locate package deviceupdate-agent HOT 2
- Advisory for Debian 11 Based Distro Running on ARM64 SOM HOT 41
- How to get the exit code of the script-handler from ExtendedResultCode? HOT 2
- Default Credentials HOT 1
- docs/agent-reference/how-to-build-agent-code.md contains text referencing deleted content HOT 5
- Azure Device Update over IoT Hub for RHEL device. HOT 6
- Replacement workflow not working HOT 8
- ScriptHandler crashs ADU HOT 3
- Question: How to make custom DTMI model private for ADU HOT 2
- Please provide `.deb` packages for Debian 11/12 armhf & arm64 HOT 6
- Device Update Agent attempting MQTT connection over TLSv1 HOT 2
- Device Update Free Edition HOT 1
- Device Update not applying due to lower case conversion of compat property HOT 7
- Device update group not created based on tags in DeviceTwin HOT 13
- Device not added in Azure Device Update Groups in IoT Hub HOT 5
- Cannot Install device update agent 1.0.3 beta version for Debian11 Arm64 on Debian 11.8 running on Raspberry Pi 4 HOT 1
- Configuration file deviceupdate-agent.service is marked executable HOT 7
- Yocto Rpi3 Device is restarting again and again in a loop HOT 2
- Failed parse of JSON file in Rpi4 device HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from iot-hub-device-update.