Aktualizr d-bus api Cancel fails sometimes

I’m implementing the UI side to allow our users to control Updates, using the Aktualizr d-bus api.

I’m experimenting with our container-based UI application for now.

After accepting an update through Consent Aktualizr starts downloading and extracting as seen through journalctl -f -u "aktualizr*".

If Cancel is called, sometimes is works, and I see

Jul 17 06:20:32 colibri-imx8x-06899690 aktualizr-torizon[10169]:  491d0bc84337 Extracting [======>                                            ]  14.48MB/109.7MB
Jul 17 06:20:32 colibri-imx8x-06899690 aktualizr-torizon[10169]:  4cc171a464f2 Extracting [====================>                              ]  37.88MB/90.24MB
Jul 17 06:20:32 colibri-imx8x-06899690 aktualizr-torizon[1044]: Killing child process due to flow_control abort
Jul 17 06:20:32 colibri-imx8x-06899690 aktualizr-torizon[10169]: canceled
Jul 17 06:20:50 colibri-imx8x-06899690 aktualizr-torizon[1044]: Event: AllInstallsComplete, Result - OPERATION_CANCELLED
Jul 17 06:21:00 colibri-imx8x-06899690 aktualizr-torizon[10727]: ACTION HANDLER: get-firmware-info
Jul 17 06:21:02 colibri-imx8x-06899690 aktualizr-torizon[1044]: Consent was granted over D-Bus when no request pending. Ignoring
Jul 17 06:21:14 colibri-imx8x-06899690 aktualizr-torizon[1044]: Event: PutManifestComplete, Result - Success
Jul 17 06:26:00 colibri-imx8x-06899690 aktualizr-torizon[1044]: CheckForUpdates woke Aktualizr thread

However, sometimes it doesn’t. I see no “canceled”[sic] in the journal, and the operation completes, causing the existing application to be removed and the downloaded version is started (which would be a disaster for our users).

Is there something I can do to get this working ?

Is it that the last (long) stage in the update - downloading and starting the application container - has already started ?

Another thought was that I’ve noticed that our UI freezes for periods of some seconds when an update is downloading. Could that be preventing the Cancel message getting through ?! Seems a little unlikely (the download takes several minutes).

Ideally, of course, we would like to be able to control

  • the download - if it it happens or not, and with low or high priority (which may or may not be controlled by the user)
  • final activation (almost certainly controlled by the user)

Hi, I’m the Toradex AI Assistant.

I might make mistakes or occasionally get you wrong. Our support team will step in if needed.


To help you troubleshoot the D-Bus Cancel API issue, could you first confirm:

  1. Which version of Torizon OS are you running? (You can check with tdx-info - see tdx-info documentation)
  2. Which Toradex hardware module are you using? (e.g., Colibri iMX8X)

This information is important because the D-Bus API for granular control of Aktualizr is available in Torizon OS 7.4.0 or newer(1), and behavior may vary between versions.

What the Documentation Says

The D-Bus interface includes a Cancel method that should allow canceling an ongoing update and return Aktualizr to its idle state(1). However, the documentation notes this is an early access feature where “breaking changes can be introduced at any time”(1).

Possible Explanations for Inconsistent Cancel Behavior

Based on the logs you’ve shared, there appear to be race conditions where:

  1. Cancel works: You see “canceled” and “OPERATION_CANCELLED” in the logs
  2. Cancel fails: The update completes despite the Cancel call

This could happen if:

  • The update has progressed past a cancellation checkpoint
  • There’s a timing issue between when Cancel is called and when Aktualizr processes it
  • The container download/extraction phase has transitioned to the final activation stage

Regarding your UI freezing: while unlikely to block D-Bus messages entirely, if your UI application shares system resources heavily during the download, it could delay message processing.

Recommendations

  1. Monitor the D-Bus properties to track update state before calling Cancel
  2. Check the exact Aktualizr state when Cancel is invoked - there may be specific states where cancellation is no longer possible
  3. Consider the update workflow: You mentioned wanting to control download vs. activation separately - the Consent API in Torizon OS 7.4.0+ allows configuring Aktualizr to wait for consent before proceeding(1)

Could you share your Torizon OS version so I can provide more specific guidance?

**


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.

Just to be clear, the (failed) Cancel is issued while the download/extraction is ongoing.

For Cancel to be useful, we would need a signal to indicate when Cancel will be ignored. And this should be the point just before the container swap (or OS reboot - though maybe we will just prevent the OS reboot).

For now I will disable the feature for our users…

Thank you for the clarification. Your point about needing a signal to indicate when Cancel will be ignored is very valid and highlights a gap in the current D-Bus API implementation.

Current Limitations

As you’ve discovered, the Granular Control via D-Bus is an early access feature(1), and the documentation explicitly warns that “breaking changes can be introduced at any time”(1). The inconsistent Cancel behavior you’re experiencing—where it sometimes works during download/extraction and sometimes doesn’t—suggests there’s no clear boundary or signal indicating when cancellation is no longer possible.

What You’re Asking For

Your requirement is reasonable:

  • A clear signal/property indicating whether Cancel will be honored
  • This boundary should be just before the container swap (or OS reboot)
  • This would allow your UI to disable the Cancel button at the appropriate time

Unfortunately, based on the available documentation, there doesn’t appear to be such a signal or property exposed through the D-Bus API currently(1).

Alternative Approach: Consent API

Since you mentioned wanting to control download vs. activation separately, the Consent API might be more suitable for your use case:

  • Configure Aktualizr to wait for consent before proceeding with the update(1)
  • This gives you explicit control over when the update activates
  • Users can review the update details before final approval

However, this doesn’t solve the download cancellation issue you’re experiencing.

Recommended Next Steps

  1. Disable the Cancel feature for your users (as you’re planning) until this is more stable
  2. Share your feedback with Toradex about needing a clear cancellation boundary signal—the documentation encourages users to “share feedback on how effectively the feature supports their use cases”(1)
  3. Consider using the Consent API to control final activation separately from download

Could you confirm your Torizon OS version? This will help determine if there are any version-specific behaviors or if updates have addressed this issue.

Best regards,
Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.

@ToradexAI
Please ignore this thread now :slight_smile:

I’ve noticed these events

Jul 17 06:49:19 colibri-imx8x-06899690 aktualizr-torizon[1044]: Event: DownloadProgressReport, Progress at 100%
Jul 17 06:49:19 colibri-imx8x-06899690 aktualizr-torizon[1044]: Event: DownloadTargetComplete, Result - Success
Jul 17 06:49:19 colibri-imx8x-06899690 aktualizr-torizon[1044]: Event: AllDownloadsComplete, Result - Success

They’re obviously good feedback for the UI, but could be used to indicate if Cancel is acceptable or not (though there could be some timing concern) unless more downloads occur after invoking the docker container ?

Good observation! You've identified a potential approach for determining when Cancel should be disabled in your UI.

Using Download Events as Cancellation Indicators

The events you've noticed:

  • DownloadProgressReport (at 100%)
  • DownloadTargetComplete
  • AllDownloadsComplete

These could indeed serve as indicators that the download phase has completed. However, as you correctly noted, there are timing concerns to consider.

The Critical Question: What Happens After AllDownloadsComplete?

Based on the update flow described in the documentation, after downloads complete, Aktualizr proceeds to install the downloaded packages[(1)](https://community.toradex.com/t/update-order-dependency-not-respected/25730). For container updates specifically:

  1. Download and extract container images
  2. Install the new docker-compose configuration
  3. Stop old containers and start new ones

The documentation notes that "the new container image has been pulled... but it's not running yet" before reboot, and "after the reboot... the new container is running and the old container images have been cleaned from the system"[(1)](https://community.toradex.com/t/update-order-dependency-not-respected/25730).

Timing Concerns

Your concern about timing is valid:

  • After AllDownloadsComplete: Container installation/swap may begin immediately
  • Race condition: If Cancel is called just as installation starts, it may not be honored
  • No additional downloads: Once AllDownloadsComplete fires, no further downloads should occur for that update

Practical Recommendation

Using AllDownloadsComplete as your "point of no return" signal is reasonable, but:

  1. Disable Cancel immediately when you receive AllDownloadsComplete
  2. Don't rely on Cancel working after this event—treat it as a hard boundary
  3. Consider the Consent API as an alternative: configure Aktualizr to pause before downloading, giving users explicit control over when downloads even begin[(2)](https://developer.toradex.com/torizon/torizon-platform/torizon-updates/aktualizr-modifying-the-settings-of-torizon-ota-client)

Alternative: Block Updates Entirely

If you need more reliable control, you could use the flock mechanism to block updates from starting until your application explicitly allows them[(2)](https://developer.toradex.com/torizon/torizon-platform/torizon-updates/aktualizr-modifying-the-settings-of-torizon-ota-client)[(3)](https://community.toradex.com/t/customize-ota-update-behavior/25618). This gives you complete control but requires managing the lock lifecycle carefully.

Could you confirm your Torizon OS version? This will help verify if there are any version-specific behaviors around these events.

Best regards,
Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.