AWS OTA successful, but OTA job on AWS console shows "Failed"

Hi,

I’m running the OTA library and can successfully update my firmware. Attached is a complete log of an OTA update job. I can tell from the log that the update succeeded (my version number changed from 5 to 6).

The log shows that all is ok:

[INFO] [OTA] [ota.c:1940] New image has a higher version number than the current image: New image version=0.6.0, Previous image version=0.5.0

[INFO] [OTADemo] [OtaOverMqttDemoExample.c:850] New image validation succeeded in self test mode.

However, when I look in the AWS console after the update has been completed, the status of the OTA job indicates “Failed”.

How can I debug this, does anyone know what can be wrong?

OTA_Success_But_Shows_Fail_In_AWS_Console.zip (12.4 KB)

Found the problem.

I need to support normal OTA as well as YModem updates. To support YModem updates (when cloud functionality/connectivity is disabled), the firmware image in selftest state is validated by my own app.
However, when OTA writes a new image, my app validates it first (as it cannot distinguish between an image in selftest state by OTA or by a YModem update) before the OTA library tries to validate it again. This gives successful update, but causes a reported failed job in the AWS console.

I gave it some good thought and luckily guessed this was the problem, but was unable to properly debug this as I could not find the reason why the console reported “Failed”. Is there a way to get more information / logging on errors in the AWS console?

You might be able to find value in the “OTA Troubleshooting” user guide. You can read the OTA failure code, which can help give you more context when a failure occurs.

Thanks, that is really useful!