Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zephyr UpdateHub sample issues #69297

Closed
RafalHalik opened this issue Feb 21, 2024 · 7 comments · Fixed by #72036
Closed

Zephyr UpdateHub sample issues #69297

RafalHalik opened this issue Feb 21, 2024 · 7 comments · Fixed by #72036
Assignees
Labels
area: UpdateHub UpdateHub bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug

Comments

@RafalHalik
Copy link

RafalHalik commented Feb 21, 2024

I've been working with the OTA updatehub sample built for mimxrt1060_evk.

I've come across some issues with json parse in the mcuboot updatehub agent. When a package is uploaded for a rollout using updatehub-ce in a docker container. The device does a check to pull the update down i get the following error in a minicom terminal window...
minicom -D /dev/ttyACM0

[00:00:02.503,000] <inf> main: UpdateHub sample app started
[00:00:02.503,000] <inf> main: Confirming the boot image
[00:00:02.503,000] <inf> main: Network disconnected
[00:00:04.527,000] <inf> main: Network connected
[00:00:04.527,000] <inf> main: Starting UpdateHub polling mode
[00:00:04.527,000] <inf> updatehub: SHA-256 verification on download and from flash
[00:00:04.532,000] <inf> updatehub: Probe metadata received
[00:00:04.532,000] <err> updatehub: Could not parse json
[00:01:04.536,000] <inf> updatehub: Probe metadata received
[00:01:04.537,000] <err> updatehub: Could not parse json
[00:02:04.541,000] <inf> updatehub: Probe metadata received
[00:02:04.541,000] <err> updatehub: Could not parse json
[00:03:04.546,000] <inf> updatehub: Probe metadata received
[00:03:04.546,000] <err> updatehub: Could not parse json

However the update would not fail imedietly but after a minute (interval to check for an update again) it would try pull the meta data about the update once again and fail in the same way.
I decided to by-pass the cleanup that happens if the json parse fails and now all checks to do with meta data from the json parse fail and print their error messages...

 <err> updatehub: Could not parse json 
 <err> updatehub: Could not parse json 
 <err> updatehub: SHA256 size is invalid 
 <err> eth_mcux: ENET_GetRxFrameSize return: 4001 

and with this change the update fails and doesn't try again after the minute.

To Reproduce
-Following the steps from https://docs.zephyrproject.org/latest/samples/subsys/mgmt/updatehub/README.html
The only difference being building for a mimxrt1060_evk board.

  • Run docker container for updatehub-ce
    docker run -it -p 8080:8080 -p 5683:5683/udp --rm updatehub/updatehub-ce:latest
  • In browser connect to localhost:8080 or local ip
  • Create package using uhu from signed image as per the examples intructions
  • Upload package zephyr-update.pkg on the updatehub dashboard
  • Create rollout and the update never fails nor completes
  • For update to fail with previously mentioned errors lines 878, 884, 893, 906, 922
    need to be commented out, can be found at ~zephyproject/zephyr/subsys/mgmt/updatehub/updatehub.c

I have also check using uhu if my metadata is valid:

image

Expected behaviour

  • Update never completing, fail at a json parse which can be seen through a minicom -D /dev/ttyACM0
  • If code commented out update failing and reporting back to updatehub that it failed

Impact
Due to this issue I haven't been able to continue on with working with this sample

Environment

  • OS: Linux
  • Toolchain: Zephyr SDK
  • Zephyr version 3.5.0
@RafalHalik RafalHalik added the bug The issue is a bug, or the PR is fixing a bug label Feb 21, 2024
Copy link

Hi @RafalHalik! We appreciate you submitting your first issue for our open-source project. 🌟

Even though I'm a bot, I can assure you that the whole community is genuinely grateful for your time and effort. 🤖💙

@nashif nashif added the priority: medium Medium impact/importance bug label Feb 27, 2024
@nashif
Copy link
Member

nashif commented Feb 27, 2024

@nandojve can you please take a look?

@nandojve
Copy link
Member

@nandojve can you please take a look?

Hi @nashif ,

Yes, It is on the queue.

@nandojve
Copy link
Member

Hi @RafalHalik,

This seems to be related to changes introduced by #50816. We need to understand why this is happening to fix it.

nandojve added a commit to nandojve/zephyr that referenced this issue Apr 27, 2024
After the changes introduced by zephyrproject-rtos#50816 the UpdateHub could not decode
anymore the JSON object. This introduce missing parsing definitions
to allow JSON parser undertood the correct UpdateHub probe object.

Fixes zephyrproject-rtos#69297

Signed-off-by: Gerson Fernando Budke <[email protected]>
nandojve added a commit to nandojve/zephyr that referenced this issue Apr 30, 2024
After the changes introduced by zephyrproject-rtos#50816 the UpdateHub could not decode
anymore the JSON object. This introduce missing parsing definitions
to allow JSON parser undertood the correct UpdateHub probe object.

Fixes zephyrproject-rtos#69297

Signed-off-by: Gerson Fernando Budke <[email protected]>
carlescufi pushed a commit that referenced this issue May 2, 2024
After the changes introduced by #50816 the UpdateHub could not decode
anymore the JSON object. This introduce missing parsing definitions
to allow JSON parser undertood the correct UpdateHub probe object.

Fixes #69297

Signed-off-by: Gerson Fernando Budke <[email protected]>
@nandojve
Copy link
Member

nandojve commented May 3, 2024

Hi @RafalHalik ,

With the #72300 the UpdateHub is fully operational again.

@RafalHalik
Copy link
Author

Hey @nandojve

That's great news thankyou for looking into this

@nandojve
Copy link
Member

nandojve commented May 7, 2024

Hi @RafalHalik ,

The backport is already scheduled for 3.5/3.6. I'll add the missing parts and fix commit msgs soon.
Thank you for reporting : )

nandojve added a commit to nandojve/zephyr that referenced this issue May 7, 2024
After the changes introduced by zephyrproject-rtos#50816 the UpdateHub could not decode
anymore the JSON object. This introduce missing parsing definitions
to allow JSON parser undertood the correct UpdateHub probe object.

Fixes zephyrproject-rtos#69297

Signed-off-by: Gerson Fernando Budke <[email protected]>
(cherry picked from commit 5fb62ca)
nandojve added a commit to nandojve/zephyr that referenced this issue May 7, 2024
This fixes compatibility with recent bootutils API.

Fixes zephyrproject-rtos#69297

Signed-off-by: Gerson Fernando Budke <[email protected]>
(cherry picked from commit 94cd46d)
nandojve added a commit that referenced this issue May 7, 2024
This fixes compatibility with recent bootutils API.

Fixes #69297

Signed-off-by: Gerson Fernando Budke <[email protected]>
(cherry picked from commit 94cd46d)
nandojve added a commit that referenced this issue May 7, 2024
After the changes introduced by #50816 the UpdateHub could not decode
anymore the JSON object. This introduce missing parsing definitions
to allow JSON parser undertood the correct UpdateHub probe object.

Fixes #69297

Signed-off-by: Gerson Fernando Budke <[email protected]>
(cherry picked from commit 5fb62ca)
nandojve added a commit that referenced this issue May 7, 2024
This fixes compatibility with recent bootutils API.

Fixes #69297

Signed-off-by: Gerson Fernando Budke <[email protected]>
(cherry picked from commit 94cd46d)
mariopaja pushed a commit to mariopaja/zephyr that referenced this issue May 26, 2024
After the changes introduced by zephyrproject-rtos#50816 the UpdateHub could not decode
anymore the JSON object. This introduce missing parsing definitions
to allow JSON parser undertood the correct UpdateHub probe object.

Fixes zephyrproject-rtos#69297

Signed-off-by: Gerson Fernando Budke <[email protected]>
henrikbrixandersen pushed a commit that referenced this issue May 29, 2024
After the changes introduced by #50816 the UpdateHub could not decode
anymore the JSON object. This introduce missing parsing definitions
to allow JSON parser undertood the correct UpdateHub probe object.

Fixes #69297

Signed-off-by: Gerson Fernando Budke <[email protected]>
(cherry picked from commit 5fb62ca)
henrikbrixandersen pushed a commit that referenced this issue May 29, 2024
This fixes compatibility with recent bootutils API.

Fixes #69297

Signed-off-by: Gerson Fernando Budke <[email protected]>
(cherry picked from commit 94cd46d)
jhedberg pushed a commit that referenced this issue Jun 2, 2024
After the changes introduced by #50816 the UpdateHub could not decode
anymore the JSON object. This introduce missing parsing definitions
to allow JSON parser undertood the correct UpdateHub probe object.

Fixes #69297

Signed-off-by: Gerson Fernando Budke <[email protected]>
(cherry picked from commit 5fb62ca)
jhedberg pushed a commit that referenced this issue Jun 2, 2024
This fixes compatibility with recent bootutils API.

Fixes #69297

Signed-off-by: Gerson Fernando Budke <[email protected]>
(cherry picked from commit 94cd46d)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: UpdateHub UpdateHub bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants