# Duplicate OTA-JOB receiving issue while running OTA Agent

**URL:** <https://forums.freertos.org/t/duplicate-ota-job-receiving-issue-while-running-ota-agent/12531>\
**Category:** Texas Instruments\
**Tags:** debug, aws-iot-core\
**Created:** [May 7, 2021, 11:26am UTC](https://forums.freertos.org/t/duplicate-ota-job-receiving-issue-while-running-ota-agent/12531 "2021-05-07T11:26:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Suresh](https://avatars.discourse-cdn.com/v4/letter/s/aca169/32.png) [@Suresh](https://forums.freertos.org/u/Suresh)\
**Post date:** [May 7, 2021, 11:26am UTC](https://forums.freertos.org/t/duplicate-ota-job-receiving-issue-while-running-ota-agent/12531/1 "2021-05-07T11:26:50Z")

</div>

Hi,

Currently I am using TICC3220SF along with AWS-FreeRTOS example demo project downloaded from AWS.

While downloading OTA-JOB document, I am getting the same duplicate JOB document 2 or 3 times.

I understood that, this behaviour is because cloud is expecting Ack from the device (as enabled QOS1 for prvSubscribeToJobNotificationTopics),

Ack is missing due to network issue(testing under slower network).

Whenever this issue occurs, OTA task is getting aborted and reporting JSON parse error to the cloud.

**Device side Error :** _“Superfluous report of current job”_  
**Cloud side error :** _“error occurred during JOB Document parsing”_

If I make device side code changes QOS1 to QOS0 I am able to resolve the issue.  
I wanted to do work around to avoid the duplicate job and continue upgrading the OTA without aborting.

Please help me to resolve this.

Please find the following logs for more info:

> [iot\_thread] [INFO][DEMO][73601] OTA Started  
> [iot\_thread] Creating MQTT Client…  
> [iot\_thread] Starting OTA Agent.  
> [OTA Task] [prvSubscribeToJobNotificationTopics] OK: $aws/things/Temp/jobs/$next/get/accepted  
> [OTA Task] [prvSubscribeToJobNotificationTopics] OK: $aws/things/Temp/jobs/notify-next  
> [OTA Task] [prvPAL\_GetPlatformImageState] xFileInfo.Flags = 0250  
> [OTA Task] [prvPAL\_GetPlatformImageState] eOTA\_PAL\_ImageState\_Valid  
> [OTA Task] [prvPAL\_GetPlatformImageState] xFileInfo.Flags = 0250  
> [OTA Task] [prvPAL\_GetPlatformImageState] eOTA\_PAL\_ImageState\_Valid  
> [OTA Task] [OTA\_CheckForUpdate] Request #0  
> [OTA Task] [prvParseJobDoc] Job was accepted. Attempting to start transfer.  
> [OTA Task] [prvPAL\_GetPlatformImageState] xFileInfo.Flags = 0250  
> [OTA Task] [prvPAL\_GetPlatformImageState] eOTA\_PAL\_ImageState\_Valid  
> [iot\_thread] Error: Could not get a free buffer to copy callback data.  
> [iot\_thread] OTA State: Ready Received: 3 Queued: 2 Processed: 0 Dropped: 1  
> [iot\_thread] Error: Could not get a free buffer to copy callback data.  
> [OTA Task] [prvStartRequestTimer] starting timer  
> [iot\_thread] OTA State: Active Received: 4 Queued: 2 Processed: 0 Dropped: 2  
> [Tmr Svc] [prvRequestTimer\_Callback] timer callback.  
> [iot\_thread] OTA State: Active Received: 4 Queued: 2 Processed: 0 Dropped: 2  
> [OTA Task] [prvPAL\_CreateFileForRx] Receive file created. Token: 1952007250  
> [OTA Task] [prvOTA\_Close] Context-\>0x200000a0  
> [OTA Task] [prvRollbackBundle] Bundle rollback succeeded  
> [iot\_thread] OTA State: Active Received: 4 Queued: 2 Processed: 1 Dropped: 2  
> [OTA Task] [prvParseJobDoc] Superfluous report of current job.  
> [OTA Task] [prvParseJobDoc] Error 3 parsing job document.  
> [OTA Task] [prvParseJobDoc] Ignoring job without ID.  
> [OTA Task] [prvOTA\_Close] Context-\>0x200000a0  
> [OTA Task] [prvPAL\_SetPlatformImageState] Bundle rollback failed after abort (-10282).  
> [OTA Task] [prvUpdateJobStatus] Msg: {“status”:“FAILED”,“statusDetails”:{“reason”:“aborted: 0x24000000”}}  
> [iot\_thread] OTA State: Active Received: 4 Queued: 2 Processed: 1 Dropped: 2  
> [OTA Task] [prvDefaultCustomJobCallback] Received Custom Job inside OTA Agent.  
> [OTA Task] [prvParseJobDoc] Ignoring job without ID.  
> [OTA Task] [prvPAL\_SetPlatformImageState] Bundle rollback failed after abort (-10282).  
> [iot\_thread] OTA State: Active Received: 5 Queued: 3 Processed: 3 Dropped: 2  
> [iot\_thread] adiCheckforOtaUpdate() wait time expired  
> [OTA Task] [prvOTAUpdateTask] Received shutdown event.  
> [OTA Task] [prvOTA\_Close] Context-\>0x200000a0  
> [iot\_thread] [INFO][DEMO][118793] OTA Completed

Regards,  
Suresh

---

<div class="post-metadata">

**Author:** ![pvyawaha](https://avatars.discourse-cdn.com/v4/letter/p/a5b964/32.png) [@pvyawaha](https://forums.freertos.org/u/pvyawaha)\
**Post date:** [May 7, 2021, 7:43pm UTC](https://forums.freertos.org/t/duplicate-ota-job-receiving-issue-while-running-ota-agent/12531/2 "2021-05-07T19:43:01Z")

</div>

Hello,

Can you please share which version/release you are using ? Also if you can please share if you using the default OTA configurations ?

---

<div class="post-metadata">

**Author:** ![Suresh](https://avatars.discourse-cdn.com/v4/letter/s/aca169/32.png) [@Suresh](https://forums.freertos.org/u/Suresh)\
**Post date:** [May 10, 2021, 11:22am UTC](https://forums.freertos.org/t/duplicate-ota-job-receiving-issue-while-running-ota-agent/12531/3 "2021-05-10T11:22:28Z")

</div>

HI pvyawaha,

Thanks for your reply,

I am using SDK _ **SimpleLink\_CC32xx\_v2\_10\_00\_04** _ (OTA : Amazon FreeRTOS OTA V1.0.3).

There is no custom changes, I am using AWS-OTA Example code.  
Creating OTA task _**prvOTAUpdateTask()**_ and checking OTA update by _**OTA\_CheckForUpdate()**_.

Below API is causing the issue (eOTA\_JobParseErr\_BusyWithSameJob):  
_**prvProcessOTAJobMsg()**_

Regards,  
Suresh

---

<div class="post-metadata">

**Author:** ![pvyawaha](https://avatars.discourse-cdn.com/v4/letter/p/a5b964/32.png) [@pvyawaha](https://forums.freertos.org/u/pvyawaha)\
**Post date:** [May 10, 2021, 7:43pm UTC](https://forums.freertos.org/t/duplicate-ota-job-receiving-issue-while-running-ota-agent/12531/4 "2021-05-10T19:43:20Z")

</div>

Hello,

If you are using MQTT protocol ( which is only supported at this time for control messages ) you do not need to call the _**OTA\_CheckForUpdate()**_ as you are already subscribe to the job notification topics. Can you try running the demo provided and check if you still receive the same error?

---

<div class="post-metadata">

**Author:** ![Suresh](https://avatars.discourse-cdn.com/v4/letter/s/aca169/32.png) [@Suresh](https://forums.freertos.org/u/Suresh)\
**Post date:** [May 11, 2021, 11:19am UTC](https://forums.freertos.org/t/duplicate-ota-job-receiving-issue-while-running-ota-agent/12531/5 "2021-05-11T11:19:10Z")

</div>

Hi pvyawaha,

Thanks for your response and support.

Device operates over battery and goes to hibernate mode regularly, Due to application requirement needs to perform _**OTA\_CheckForUpdate()**_.

Regards,  
Suresh
