Updating docker-compose online and offline

Hey guys,

I was trying to do a OTA update to test if I could do a offline update and online update on the same machine. But I stumbled over the following logs and I cannot determine which version the aktualizr is actually logging about.

Sep 04 09:09:43 oatmeal aktualizr-torizon[3481]: Event: UpdateCheckComplete, Result - Updates available
Sep 04 09:09:43 oatmeal aktualizr-torizon[3481]: Invalid role in root.json
Sep 04 09:09:43 oatmeal aktualizr-torizon[3481]: Invalid role in root.json
Sep 04 09:09:43 oatmeal aktualizr-torizon[3481]: Event: DownloadProgressReport, Progress at 100%
Sep 04 09:09:43 oatmeal aktualizr-torizon[3481]: Event: DownloadTargetComplete, Result - Success
Sep 04 09:09:43 oatmeal aktualizr-torizon[3481]: Event: AllDownloadsComplete, Result - Success
Sep 04 09:09:43 oatmeal aktualizr-torizon[3481]: Invalid role in root.json
Sep 04 09:09:43 oatmeal aktualizr-torizon[3481]: Invalid role in root.json
Sep 04 09:09:43 oatmeal aktualizr-torizon[3481]: Waiting for Secondaries to connect to start installation...
Sep 04 09:09:44 oatmeal aktualizr-torizon[3481]: Invalid role in root.json
Sep 04 09:09:44 oatmeal aktualizr-torizon[3481]: Invalid role in root.json
Sep 04 09:09:44 oatmeal aktualizr-torizon[3481]: Version 28 in Root metadata doesn't match the expected value 27
Sep 04 09:09:44 oatmeal aktualizr-torizon[3481]: Signature verification for Root metadata failed: Version in Root metadata does not match its expected value.
Sep 04 09:09:44 oatmeal aktualizr-torizon[3481]: Failed to update Image repo metadata: Version in Root metadata does not match its expected value.
Sep 04 09:09:44 oatmeal aktualizr-torizon[3481]: Sending metadata to 2144e5d954d10ea40eec16f185f66d586f23fc6ba0197ed049476ed387c6d1c1 failed: "VERIFICATION_FAILED":3 Failed to update Image repo metadata: Version in Root metadata does not match its expected value.
Sep 04 09:09:44 oatmeal aktualizr-torizon[3481]: Event: AllInstallsComplete, Result - docker-compose:VERIFICATION_FAILED

Why is it complaining about a version mismatch?
The OS I am using is the

6.7.0+build.18-tcbuilder.20240826105730

on the IMX8MP

steps I did was.

  1. I enabled offline updates
  2. updated with usb and lockbox successfully
  3. made a new version of the same docker-compose file
  4. started a OTA update with the torizon UI

The OTA update resulted in the logs above with RESULT - docker-compose:VERIFICATION_FAILED

Kind regards,

Mehmet

Hi, I’m the Toradex AI Assistant. I’m in early beta, and I would appreciate your feedback.
The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


The issue you’re encountering seems to be related to a version mismatch in the root metadata during the OTA update process. This can happen when the root metadata on the device does not match the expected version from the update server. Here are some steps and considerations to help you troubleshoot and resolve this issue:

  1. Check Root Metadata Version:

    • Ensure that the root metadata on your device is up-to-date and matches the version expected by the Torizon Platform. The error message indicates that the device has root metadata version 27, but the server expects version 28.
  2. Update Root Metadata:

    • You may need to update the root metadata on your device manually. This can be done by provisioning the device again with the latest root metadata. You can use the TorizonCore Builder tool to extract and apply the latest root metadata.
  3. Enable Both Online and Offline Updates:

    • Since you are trying to use both online and offline updates, ensure that your configuration file in /etc/sota/conf.d/ has both enable_offline_updates and enable_online_updates set to true. This configuration allows the device to handle both update methods simultaneously.
    [uptane]
    enable_offline_updates = true
    enable_online_updates = true
    offline_updates_source = "/media/usb/update"
    
  4. Restart Aktualizr:

    • After making any changes to the configuration, make sure to restart the Aktualizr service to apply the changes.
    sudo systemctl restart aktualizr
    
  5. Verify Lockbox and OTA Update Compatibility:

    • Ensure that the lockbox used for the offline update and the OTA update are compatible and do not have conflicting metadata. If there are discrepancies, it could lead to verification failures.
  6. Check Logs for More Details:

    • The logs indicate multiple instances of “Invalid role in root.json” and “Version in Root metadata does not match its expected value.” These messages suggest that there might be an issue with the root.json file or its signatures. Check the integrity and signatures of the root.json file.
  7. Re-provision the Device:

    • If the issue persists, consider re-provisioning the device to ensure that it has the correct and up-to-date metadata. This can be done using the TorizonCore Builder tool or through the Torizon Platform UI.
  8. Consult Documentation and Support:

    • Refer to the T

Hi Bot,

How to check the root metadata version and update it?

Greetings @simplymehmet,

I tired the exact same steps you laid out and it worked fine for me.

That said the error you got looks like a bug we recently fixed that can happen in certain circumstances. The fix isn’t in 6.7.0, but will be in 6.8.0. Just to test if this is indeed the same issue, if you restart the device after the failure in step 4, and try the update again, does it now succeed?

Best Regards,
Jeremias

Hi Jeremias,

I re-provisioned the machine and tried again, that seemed to fix the issue I was facing. Was not able to reproduce it after that.

Kind regards,

Mehmet

Good to hear. It may have been some strange transient issue or something of that nature. Well let us know if it appears again in the future.

Best Regards,
Jeremias