Supervisor status (via /v1/device) doesn't reflect downloading state

Hi,

Following the guide at Interacting with the balena Supervisor - Balena Documentation I’m trying to detect when a device has an update in progress, specifically looking for the update_pending, status=Downloading, and download_progress parts.

I’ve found that the only one that seems to reliably get set is update_pending=true. The cloud dashboard happily shows the download progress slider moving across, but looking at the Diagnostics → Supervisor state (which returns identical results to what the app is getting), it has:

{ "api_port": 48484, "ip_address": "10.9.1.31", "os_version": "balenaOS 2.80.3+rev1", "mac_address": "B8:27:EB:70:01:03 B8:27:EB:25:54:56", "supervisor_version": "12.9.3", "update_pending": true, "update_failed": false, "update_downloaded": false, "status": "Idle", "download_progress": null }

I swear I once saw download_progress=0, but I haven’t otherwise seen a status change here from Idle. Obviously the cloud device API sees the download progress fine, but not the supervisor one. The supervisor update_pending goes back false after the container restarts, so it’s not just stuck. The download itself took around 2 minutes on my last run, so it wasn’t just unlucky timing. I’ve watched the supervisor output every 2 seconds during a download and it doesn’t change.

This is on a Pi 3 (64 bit OS), Supervisor 12.9.3, in a single-container app (though deployed/configured with docker-compose.yml).

Is this a supervisor bug or just something to do with my app?

Any guidance appreciated!

Hi,

Thank you for pre-emptively providing device type and version information! Unfortunately the GET /v1/device endpoint is a artifact of single container, and it doesn’t report entirely accurately for multi-container applications. Your app is single container however, but even so, /v1/device is currently not reporting the device state correctly. See: /v1/device not reporting device state correctly · Issue #1748 · balena-os/balena-supervisor · GitHub

We are working on this, and in the meantime I’d recommend using the GET /v2/applications/state endpoint (Interacting with the balena Supervisor - Balena Documentation) instead, which returns the downloadProgress of all containers as well as the status (Downloading/Downloaded/Running/etc.). Let us know if that works for you!

Regards,
Christina

Thanks Christina!

I’ve switched to using the /v2/state/status endpoint and everything’s better now. Good to know about the multi-container thing.

Problem solved.