FreeRTOS OTA upgrade abort and restart,

I have implemented the FreeRTOS OTA on my STM32 device. Generally it works fine, but sometime, maybe 1 in 10 case, I found OTA upgrade abort and restart it.
may I know what is the reason behind it and may I know how to resume it not restart it?
as I have already download large data, if network or anything wrong, it good to resume not restart.

OtaOverMqtt.c        +1899 prvRunOTA                  Received: 306   Queued: 306   Processed: 235   Dropped: 0
OtaOverMqtt.c        +1899 prvRunOTA                  Received: 309   Queued: 309   Processed: 235   Dropped: 0
core_mqtt.c          +781  recvExact                 Unable to receive packet: Timed out in transport recv.
core_mqtt.c          +891  receivePacket             Packet reception failed. ReceivedBytes=1574, ExpectedBytes=2159.
core_mqtt.c          +2194 MQTT_ProcessLoop          Exiting process loop due to failure: ErrorStatus=MQTTRecvFailedcore_mqtt_agent.c    +1025 MQTTAgent_CommandLoop     MQTT operation failed with status MQTTRecvFailed

OtaOverMqtt.c        +1899 prvRunOTA                  Received: 309   Queued: 309   Processed: 235   Dropped: 0
OtaOverMqtt.c        +1899 prvRunOTA                  Received: 309   Queued: 309   Processed: 235   Dropped: 0
OtaOverMqtt.c        +1899 prvRunOTA                  Received: 309   Queued: 309   Processed: 235   Dropped: 0
OtaOverMqtt.c        +1899 prvRunOTA                  Received: 309   Queued: 309   Processed: 235   Dropped: 0
OtaOverMqtt.c        +1899 prvRunOTA                  Received: 309   Queued: 309   Processed: 235   Dropped: 0
OtaOverMqtt.c        +1899 prvRunOTA                  Received: 309   Queued: 309   Processed: 235   Dropped: 0
OtaOverMqtt.c        +1899 prvRunOTA                  Received: 309   Queued: 309   Processed: 235   Dropped: 0
OtaOverMqtt.c        +1899 prvRunOTA                  Received: 309   Queued: 309   Processed: 235   Dropped: 0
OtaOverMqtt.c        +1899 prvRunOTA                  Received: 309   Queued: 309   Processed: 235   Dropped: 0
mtd_mqtt.c           +109  vPubTask                  Mtd_MQTT_Publish failed
OtaOverMqtt.c        +1724 prvMQTTAgentTask          Suspended OTA agent.
OtaOverMqtt.c        +1289 prvSocketDisconnect       Disconnecting TLS connection.

sockets_wrapper.c    +115  Sockets_Connect           DNS OK: Host:a2l4ym2rlvj63k-ats.iot.ap-southeast-2.amazonaws.com,type:Unknown, addr (::)

core_mqtt_serializer +969  deserializeConnack        CONNACK session present bit not set.
core_mqtt_serializer +911  logConnackResponse        Connection accepted.
OtaOverMqtt.c        +1371 prvMQTTConnect            Session present: 0

OtaOverMqtt.c        +1899 prvRunOTA                  Received: 309   Queued: 309   Processed: 235   Dropped: 0
OtaOverMqtt.c        +1735 prvMQTTAgentTask          Resumed OTA agent.
OtaOverMqtt.c        +1505 prvMQTTSubscribe          Subscribed to topic $aws/things/350999901/jobs/notify-next.

OtaOverMqtt.c        +1899 prvRunOTA                  Received: 309   Queued: 309   Processed: 235   Dropped: 0
OtaOverMqtt.c        +1899 prvRunOTA                  Received: 309   Queued: 309   Processed: 235   Dropped: 0
OtaOverMqtt.c        +1899 prvRunOTA                  Received: 309   Queued: 309   Processed: 235   Dropped: 0
OtaOverMqtt.c        +1899 prvRunOTA                  Received: 309   Queued: 309   Processed: 235   Dropped: 0
OtaOverMqtt.c        +1899 prvRunOTA                  Received: 309   Queued: 309   Processed: 235   Dropped: 0
OtaOverMqtt.c        +858  prvMqttJobCallback        Received job message callback $aws/things/xxx/jobs/$next/225"},"queuedAt":1638401299,"startedAt":1638401326,"lastUpdatedAt":1638401703,"version
OtaOverMqtt.c        +1899 prvRunOTA                  Received: 309   Queued: 309   Processed: 235   Dropped: 0
OtaOverMqtt.c        +1505 prvMQTTSubscribe          Subscribed to topic $aws/things/xxx/streams/AFR_OTA-70a32a07-473c-448e-ae81-96289bd07b26/data/cbor.


OtaOverMqtt.c        +1899 prvRunOTA                  Received: 1   Queued: 1   Processed: 1   Dropped: 0
OtaOverMqtt.c        +1899 prvRunOTA                  Received: 1   Queued: 1   Processed: 1   Dropped: 0

The second case:

OtaOverMqtt.c        +1899 prvRunOTA                  Received: 118   Queued: 118   Processed: 84   Dropped: 0
OtaOverMqtt.c        +926  prvMqttDataCallback       Error: No OTA data buffers available.

OtaOverMqtt.c        +926  prvMqttDataCallback       Error: No OTA data buffers available.

OtaOverMqtt.c        +1899 prvRunOTA                  Received: 118   Queued: 118   Processed: 84   Dropped: 0
OtaOverMqtt.c        +1899 prvRunOTA                  Received: 118   Queued: 118   Processed: 84   Dropped: 0
mtd_mqtt.c           +109  vPubTask                  Mtd_MQTT_Publish failed
OtaOverMqtt.c        +1899 prvRunOTA                  Received: 118   Queued: 118   Processed: 84   Dropped: 0
OtaOverMqtt.c        +926  prvMqttDataCallback       Error: No OTA data buffers available.

OtaOverMqtt.c        +926  prvMqttDataCallback       Error: No OTA data buffers available.

OtaOverMqtt.c        +1899 prvRunOTA                  Received: 118   Queued: 118   Processed: 84   Dropped: 0
OtaOverMqtt.c        +926  prvMqttDataCallback       Error: No OTA data buffers available.

OtaOverMqtt.c        +926  prvMqttDataCallback       Error: No OTA data buffers available.

OtaOverMqtt.c        +1899 prvRunOTA                  Received: 118   Queued: 118   Processed: 84   Dropped: 0
core_mqtt.c          +1678 validatePublishParams     A nonzero payload length requires a non-NULL payload: payloadLength=1041760256, pPayload=0x0.
core_mqtt.c          +1975 MQTT_Publish              MQTT PUBLISH failed with status MQTTBadParameter.
core_mqtt_agent.c    +1025 MQTTAgent_CommandLoop     MQTT operation failed with status MQTTBadParameter

OtaOverMqtt.c        +1899 prvRunOTA                  Received: 118   Queued: 118   Processed: 84   Dropped: 0
OtaOverMqtt.c        +1724 prvMQTTAgentTask          Suspended OTA agent.
OtaOverMqtt.c        +1289 prvSocketDisconnect       Disconnecting TLS connection.


using_mbedtls_pkcs11 +575  tlsSetup                  Failed to perform TLS handshake: mbedTLSError=-1,  pNoHighLevelMbedTlsCodeStr : ERROR - Generic error.
OtaOverMqtt.c        +1267 prvSocketConnect          Retrying connection with backoff and jitter.

core_mqtt_serializer +969  deserializeConnack        CONNACK session present bit not set.
core_mqtt_serializer +911  logConnackResponse        Connection accepted.
OtaOverMqtt.c        +1371 prvMQTTConnect            Session present: 0

OtaOverMqtt.c        +1899 prvRunOTA                  Received: 118   Queued: 118   Processed: 84   Dropped: 0
OtaOverMqtt.c        +1735 prvMQTTAgentTask          Resumed OTA agent.
OtaOverMqtt.c        +1899 prvRunOTA                  Received: 118   Queued: 118   Processed: 84   Dropped: 0
OtaOverMqtt.c        +1505 prvMQTTSubscribe          Subscribed to topic $aws/things/xxx/jobs/notify-next.


OtaOverMqtt.c        +1899 prvRunOTA                  Received: 118   Queued: 118   Processed: 84   Dropped: 0
OtaOverMqtt.c        +858  prvMqttJobCallback        Received job message callback $aws/things/xxx/jobs/$next
OtaOverMqtt.c        +1899 prvRunOTA                  Received: 118   Queued: 118   Processed: 84   Dropped: 0
OtaOverMqtt.c        +1899 prvRunOTA                  Received: 118   Queued: 118   Processed: 84   Dropped: 0
OtaOverMqtt.c        +1505 prvMQTTSubscribe          Subscribed to topic $aws/things/350999901/streams/AFR_OTA-70a32a07-473c-448e-ae81-96289bd07b26/data/cbor.


OtaOverMqtt.c        +1899 prvRunOTA                  Received: 1   Queued: 1   Processed: 0   Dropped: 0
OtaOverMqtt.c        +1899 prvRunOTA                  Received: 3   Queued: 3   Processed: 3   Dropped: 0
OtaOverMqtt.c        +1899 prvRunOTA                  Received: 4   Queued: 4   Processed: 4   Dropped: 0

Hello,

The OTA demo should suspend and resume if a network error happens during the download. From the part of logs you shared it seems the network was disconnected the agent was suspended and resumed after the the device reconnects. Can you please confirm if the same job was received and not the next one in the queue and if the previous job was aborted ?

It will be great if you can upload the complete log by removing any sensitive information that you want to hide.