# GetStream request getting rejected by aws while doing AWS OTA update

**URL:** <https://forums.freertos.org/t/getstream-request-getting-rejected-by-aws-while-doing-aws-ota-update/17733>\
**Category:** AWS\
**Tags:** aws-iot-core\
**Created:** [June 28, 2023, 9:12am UTC](https://forums.freertos.org/t/getstream-request-getting-rejected-by-aws-while-doing-aws-ota-update/17733 "2023-06-28T09:12:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bhavik2133](https://avatars.discourse-cdn.com/v4/letter/b/59ef9b/32.png) [@bhavik2133](https://forums.freertos.org/u/bhavik2133)\
**Post date:** [June 28, 2023, 9:12am UTC](https://forums.freertos.org/t/getstream-request-getting-rejected-by-aws-while-doing-aws-ota-update/17733/1 "2023-06-28T09:12:57Z")

</div>

Hi,  
I am using the aws ota update feature of AWS IoT Core.

while following the process when the device publishes the “GetStream” message, it gets rejected by the broker, and AWS Cloudwatch traces show the “ **Invalid CBOR message** ”.  
I have attached the snaps for the AWS Cloudwatch traces.

Kindly help me out in debugging the issue.

 ![MicrosoftTeams-image](https://d2v6vdsk2p900z.cloudfront.net/original/2X/7/78cb6ad0f6cd5d12d5ff1a750eedf4e6e3223104.png)  
 ![MicrosoftTeams-image (1)](https://d2v6vdsk2p900z.cloudfront.net/original/2X/7/7dd18abf1b65530b2a98f03180c104be6803908a.png)

---

<div class="post-metadata">

**Author:** ![aggarg](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/aggarg/32/4245_2.png) [@aggarg](https://forums.freertos.org/u/aggarg)\
**Post date:** [June 28, 2023, 9:56am UTC](https://forums.freertos.org/t/getstream-request-getting-rejected-by-aws-while-doing-aws-ota-update/17733/2 "2023-06-28T09:56:45Z")

</div>

> [@bhavik2133](#):
>
> while following the process when the device publishes the “GetStream” message, it gets rejected by the broker, and AWS Cloudwatch traces show the “ **Invalid CBOR message** ”.

The error tells us that the CBOR message sent by the device is not valid. Is it possible to dump the CBOR message before sending?

---

<div class="post-metadata">

**Author:** ![kstribrn](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/kstribrn/32/2085_2.png) [@kstribrn](https://forums.freertos.org/u/kstribrn)\
**Post date:** [June 28, 2023, 4:08pm UTC](https://forums.freertos.org/t/getstream-request-getting-rejected-by-aws-while-doing-aws-ota-update/17733/3 "2023-06-28T16:08:18Z")

</div>

If you’re using the [ota-for-aws-iot-embedded-sdk library](https://github.com/aws/ota-for-aws-iot-embedded-sdk) you may want to see [this issue](https://github.com/aws/ota-for-aws-iot-embedded-sdk/issues/490). It sounds fairly similar to the one you are facing.

For logging, I’d recommend placing the log immediately after [this line](https://github.com/aws/ota-for-aws-iot-embedded-sdk/blob/main/source/ota_mqtt.c#L1136-L1145).

---

<div class="post-metadata">

**Author:** ![bhavik2133](https://avatars.discourse-cdn.com/v4/letter/b/59ef9b/32.png) [@bhavik2133](https://forums.freertos.org/u/bhavik2133)\
**Post date:** [July 6, 2023, 12:14pm UTC](https://forums.freertos.org/t/getstream-request-getting-rejected-by-aws-while-doing-aws-ota-update/17733/4 "2023-07-06T12:14:49Z")

</div>

> [@aggarg](#):
>
> The error tells us that the CBOR message sent by the device is not valid. Is it possible to dump the CBOR message before sending?

Hi Gaurav,  
Thanks for the response on this.

I have captured the CBOR message before sending it is **¦accrdyaf\0al\031\020\0ao\0abY\001B**.  
IN HEX **a6 61 63 63 72 64 79 61 66 5c 30 61 6c 5c 30 33 31 5c 30 32 30 5c 30 61 6f 5c 30 61 62 59 5c 30 30 31 42**

Blocksize used is 4K(4096).

---

<div class="post-metadata">

**Author:** ![aggarg](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/aggarg/32/4245_2.png) [@aggarg](https://forums.freertos.org/u/aggarg)\
**Post date:** [July 6, 2023, 3:06pm UTC](https://forums.freertos.org/t/getstream-request-getting-rejected-by-aws-while-doing-aws-ota-update/17733/5 "2023-07-06T15:06:47Z")

</div>

> [@bhavik2133](#):
>
> IN HEX **a6 61 63 63 72 64 79 61 66 5c 30 61 6c 5c 30 33 31 5c 30 32 30 5c 30 61 6f 5c 30 61 62 59 5c 30 30 31 42**

This does not seem like a valid CBOR, when I try to decode this using this tool - [https://cbor.me/](https://cbor.me/)

Can you try to also log the content before encoding? Then we can decode that using the above tool and see the difference which may give us some hint.
