Aws-sdk-js: Using Media Store Data SDK raises an UnknownEndpoint error, regardless of region.

Created on 19 Oct 2020  路  3Comments  路  Source: aws/aws-sdk-js

Confirm by changing [ ] to [x] below to ensure that it's a bug:

Describe the bug
I'm trying to use the MediaStoreData module in the AWS SDK, however I'm running into a

UnknownEndpoint: Inaccessible host: `data.mediastore.ap-southeast-2.amazonaws.com'. This service may not be available in the `ap-southeast-2' region.

I've tried multiple regions and still cant use the endpoint. I'm simply trying to retrieve an object from MediaStore.

Is the issue in the browser/Node.js?
Node.js

If on Node.js, are you running this on AWS Lambda?
No

Details of the browser/Node.js version
v12.16.3

SDK version number
^2.773.0

To Reproduce (observed behavior)
Require MediaStore data using your credentials:

var AWS = require("aws-sdk");
var mediaStoreData = new AWS.MediaStoreData();

And call getObject(params, callback)

Expected behavior
To retrieve the requested object in MediaStore.

bug needs-triage

All 3 comments

Hey @lreher thanks for opening this, I was able to reproduce this using the code how ever I believe that is happening because the API is not able to hit the correct endpoint. This might be a usage issue since notice in the following endpoints there is aaabbbcccdddee which is added in the data endpoint (retrieved from the console) but if that particular information is not provided to the API call the call fails hence the workaround/solution here would be to the use path and the endpoint together:

CLI example:

aws mediastore-data get-object \
    --endpoint https://aaabbbcccdddee.data.mediastore.us-west-2.amazonaws.com \
    --path events/baseball/setup.jpg setup.jpg

JS example:

var mediastoredata = new AWS.MediaStoreData({region: 'us-west-2', endpoint: 'https://aaabbbcccdddee.data.mediastore.us-west-2.amazonaws.com'});

var params = {
    Path: 'events/baseball/setup.jpg',
};

mediastoredata.getObject(params, function(err, data) {
    if (err) console.log(err, err.stack); // an error occurred
    else     console.log(data);           // successful response
});

Closing this issue now, please reach out if you have any other questions.

Thanks for that! I didn't realise you can specify the endpoint.

Not a problem, this may help someone in future too.

Was this page helpful?
0 / 5 - 0 ratings