Forcing updates through API or SDK does not work

We are currently running BalenaOS version: balenaOS 2.67.3+rev2 and Supervisor version: v12.3.0 on a set of devices. We are trying to design the update process by programmatically asking the supervisor to update to a new release and ignore the update lock that we set during the boot of our services.

However, calling this update command seems to give no result at all. Whether it is from inside of the Balena Python SDK (balena.models.supervisor.update(force=True)) or from the API inside of the container (POST /v1/update). In both cases, there is no reaction from the supervisor to update to a new release.

Updating to the latest version of the supervisor (v14) does seem to work. Are we using a wrong command? The documentation does not specificy that these commands are not compatible with our current version of the supervisor.

Hi

Just to summarize, balena.models.supervisor.update

  • works on 14.x
  • doesn’t work on 12.3.0

from inside the container using the SDK/API. Is that right?

You managed to get it working on 14.x after manually updating from the dashboard or via a full fledged new OS on your devices?

Yes that’s a good summary! I updated the supervisor to 14.x independently from the OS, so it was still running BalenaOS v2.67

When you say independently from the OS, you mean from the actions menu in the dashboard right?

Yess exactly

Would it be possible for you to share support access to a device that is on v12.3.0 ?

It would also help if you can share the code snippet of how you are invoking the SDK/API

To share access to your device, please enable it from the dashboard and then DM me the UUID of your device

Ok! I’ll send you a DM

Wanted to make sure you received my DM?

Hi,

Sorry for the delay; can you enable support access again for us to take a look. Also, do share what you have tried for the supervisor update and any supporting logs.

My understanding is you have the supervisor update working but only manually not via API/SDK. Please correct me if thats not the case.

Regards,
Nitish

Hi @avonic ,

Supervisor dev here. I wanted to gather some more context about your programmatic update process as you’ve described it. You mentioned that you query the POST /v1/update Supervisor endpoint to tell the Supervisor to check for release updates, but it doesn’t have an effect. Do you have the instant update trigger config disabled, by any chance? If the config is disabled, the Supervisor currently ignores any calls to POST /v1/update, and only polls for release updates on a poll interval (15 minutes by default). This behavior is subject to change in a future Supervisor version. We have a related issue here, feel free to follow for updates: Allow update API endpoints to fetch + apply target state regardless of `instantUpdates` status when request body specifies it · Issue #1924 · balena-os/balena-supervisor · GitHub

It sounds to me like the process you’re trying to implement here is the same functionality as that offered by the balena API if instant update triggers were enabled. Could you provide more info about why the process is necessary?

As a side note, I believe the upgrade from Supervisor v12 to v14 was a red herring in this case, because the Supervisor will always check for release updates on startup.

Thanks,
Christina