IoT GetStream request rejected for out of the range of data available.

0

Hi, I am new to IoT Core, and I am implementing MQTT-based file delivery. I created stream for the file located at S3 bucket. When I publish the request message using client to the topic $aws/things/mydevice/streams/stream12345/get/json, it publish a reject message in topic $aws/things/mydevice/streams/stream12345/rejected/json:

 {
  "code": "InvalidRequest",
  "o": "InvalidRequest",
  "message": "The data requested is out of the range of data available.",
  "m": "The data requested is out of the range of data available."
}

I have made sure that:

  1. My device environment can access such file in S3 ( I used curl <s3-object-url> and it displayed content`
  2. The stream has an role that has full IoT and S3 permissions (I know it's not recommended, but for testing, I enabled them both but still doesn't work)

Now then, I don't understand why it's out of reach. There are no questions in the forum and online, so I asked this for more info and guidance. I don't think documentation explain this well (in beginner's perspective)

Thank you for the help in advance!!!

asked 10 months ago239 views
1 Answer
2
Accepted Answer

Hi. InvalidRequest is defined in the documentation as:

The request is generally identified as malformed. For more information, see the error message.

So it seems likely the payload you sent in the get is incorrect. Please review that: https://docs.aws.amazon.com/iot/latest/developerguide/mqtt-based-file-delivery-in-devices.html#mqtt-based-file-delivery-get-getstream

The AWS IoT Device SDK for Embedded C includes an OTA library that has an implementation of MQTT file streaming. It may be useful to review how it constructs a GetStream request: https://github.com/aws/ota-for-aws-iot-embedded-sdk/blob/main/source/ota_cbor.c#L238

If you are developing this in C for a device firmware update, I recommend you instead use the AWS IoT C SDK libraries.

profile pictureAWS
EXPERT
Greg_B
answered 10 months ago
profile picture
EXPERT
reviewed 10 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions