nrf Cloud FOTA fail with error code 40000

Hi

I have a issue, I have 4 samples nrf9160 module, all run in same firmware with FOTA feature

I found that only one module cannot start FOTA, then I try to read message from UART0 and got below messages:

00:00:07.627,532] [0m<inf> location: Modem FW Ver: mfw_nrf9160_1.3.6[0m
[00:00:07.634,002] [0m<inf> location: Cell ID: 77636892[0m
[00:00:07.715,332] [0m<inf> location_sample: Sending device status...[0m
[00:00:19.058,319] [0m<inf> location_sample: FOTA enabled in device shadow[0m
[00:00:19.141,540] [0m<inf> location_sample: Updating FOTA job status...[0m
[00:00:23.138,671] [1;31m<err> nrf_cloud_codec_internal: REST error msg: Job execution does not exist[0m
[00:00:23.148,010] [1;31m<err> nrf_cloud_rest: nRF Cloud REST error code: 40000[0m
[00:00:23.155,395] [1;31m<err> location_sample: Failed to update FOTA job, error: -77[0m
[00:00:23.163,238] [0m<inf> location_sample: Rebooting in 30s...[0m

I sure that the UUID and Group correctly assigned in nrf Cloud, SDK in 2.5.0, any idea on it?

Best Regards

Dannis

  • Hi Dannis, 

    [00:00:23.148,010] [1;31m<err> nrf_cloud_rest: nRF Cloud REST error code: 40000[0m
    nRF Code Error Reason Solution
    40000
    Bad request error. This error could mean many things. Most of the time it means something is not as expected on the cloud like a file was missing or an internal service failed.
    #define NRF_EBADMSG 77          /**< Bad message */

    Is this the first, last or in the between successful FOTA updates?  What application are you running from the SDK?

    Could you please provide more information on DeviceID? We will need to check with the nRF Cloud team to verify FOTA functionality.  

    Kind regards,
    Øyvind

  • Hi

    its before FOTA update, and below the UUID of device:

    50345835-3031-4b90-8065-0b0a828d1398

    Best Regards

    Dannis

  • [00:00:19.141,540] [0m<inf> location_sample: Updating FOTA job status...[0m
    [00:00:23.138,671] [1;31m<err> nrf_cloud_codec_internal: REST error msg: Job execution does not exist[0m

    It looks like the device is updating the status of a FOTA job, but the cloud does not know about the job.
    The settings module is used to save the info of active FOTA jobs so the status can be reported to the cloud when complete.
    If you enable CONFIG_NRF_CLOUD_LOG_LEVEL_DBG you should be able to see the job execution id that the device has saved.

    I'm not sure how you your device got into this state... but to fix it, you could reset the settings area that stores the FOTA job information.

    struct nrf_cloud_settings_fota_job job_inf;
    
    job_inf.validate = NRF_CLOUD_FOTA_VALIDATE_NONE;
    job_inf.type = NRF_CLOUD_FOTA_TYPE__INVALID;
    job_inf.bl_flags = NRF_CLOUD_FOTA_BL_STATUS_CLEAR;
    memset(job_inf.id, 0, NRF_CLOUD_FOTA_JOB_ID_SIZE);
    
    nrf_cloud_fota_settings_save(&job_inf);
    


  • Hi Dannis,

    Digging further, I see the FOTA job execution for this device in our database says the FOTA update completed successfully. Can you see if it's running your expected new modem firmware version 1.3.6? And was it trying to update the status for the correct "JobId" and "ExecutionId" shown below?

    {
     "JobId": "f0cfc979-d8eb-47db-b775-0cb97d9dce4f",
     "DeviceId": "50345835-3031-4b90-8065-0b0a828d1398",
     "CreatedAt": 1721197983272,
     "ExecutionId": "2f0c02cb-b17e-46d1-9ba2-db425b4f86b0",
     "JobDocument": {
      "BundleId": "APP*be40e218*mfw9160_1.3.6",
      "FileSize": 266531,
      "FirmwareType": 0,
      "Host": "firmware.nrfcloud.com",
      "Version": "mfw9160_1.3.6"
     },
     "LastUpdatedAt": 1721199187789,
     "Status": 3,
     "StatusDetail": "FOTA update completed successfully"
    }

Related