FOTA Doom Loop After Failed Download

Toolchain v2.70, SDK v2.7.0, VS Code, Windows

Kicked off an application FOTA update, and somehow it failed:

[00:02:06.161,315] <err> download_client: Error in recv(), errno 11
[00:02:06.168,243] <err> fota_download: Download client error
[00:02:06.174,652] <inf> dfu_target_mcuboot: MCUBoot image upgrade aborted.
[00:02:06.182,067] <inf> dfu_target_mcuboot: MCUBoot image upgrade aborted.

No problem, since it'll retry on next check-in, but:

[00:02:41.507,446] <inf> fota_download: Refuse fragment, restart with offset
[00:02:42.507,537] <inf> fota_download: Downloading from offset: 0x2b4ca
[00:02:43.202,728] <err> download_client: Unexpected HTTP response: 416 requested range not satisfiable
[00:02:43.212,768] <err> fota_download: Download client error
[00:02:43.219,207] <inf> dfu_target_mcuboot: MCUBoot image upgrade aborted.
[00:02:43.226,593] <inf> dfu_target_mcuboot: MCUBoot image upgrade aborted.

That offset is the size of the image, so the server is always going to reject it.

But instead of resetting its state and trying a full download next time, the client just repeats the range request.

And of course, that fails over and over again.

A reboot fixes it, but unrecoverable FOTA failures are bad news...

Related