Error in loading data from AWS S3

12 Ansichten (letzte 30 Tage)
Yona
Yona am 15 Jul. 2018
Kommentiert: Yona am 18 Dez. 2018
I tried to get a files from a bucket i creat in S3
I use a code i saw in different places:
setenv('AWS_ACCESS_KEY_ID', <myKeyID>);
setenv('AWS_SECRET_ACCESS_KEY', <myaccessKey>);
setenv('AWS_REGION', 'us-east-1');
fds = fileDatastore('s3://{mybucket}/','ReadFcn',@load, 'FileExtensions',{'.csv'})
matlab "think" a lot and then I got
Error using fileDatastore (line 102)
Cannot find files or folders matching: 's3://{mybucket}/'.
I try to change to a bucket that don't exist and i got the same error but vary fast, I tried to change the ReadFcn, I try to get directly one file (and not all the files in the bucket), I change the access key. Nothing worked.
Any idea what is the problem?

Akzeptierte Antwort

Arvind Narayanan
Arvind Narayanan am 26 Jul. 2018
Hi Yona,
Based on the error message that you have shared, it seems that the location 's3://{mybucket}/' seems to be the cause of the issue. Please replace {mybucket} with the actual bucket name without any flower brackets.
Even in the case of the above commands:
setenv('AWS_ACCESS_KEY_ID', <myKeyID>);
setenv('AWS_SECRET_ACCESS_KEY', <myaccessKey>);
Please remove the angular brackets and then fill in the keyID and the access key as string type.
If all else fails, you can also use the following API for the data store:
fs = matlab.io.datastore.DsFileSet("s3://{mybucket}/", "IncludeSubFolders", true);
Hope this helps!
Thanks,
Arvind
  1 Kommentar
Yona
Yona am 18 Dez. 2018
I use my bucket name and my key, I just change in before posting this question.
The second way you suggest don't look to work too (after a minute or two I close matlab after it look like it stuck)
For now, I use different solution but the connectiong from matlab to s3 must be better

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Harsh
Harsh am 20 Jul. 2018
Make sure the s3 bucket actually exists and you are using the accurate internationalized resource identifier (IRI) of the form -> s3://bucketname/path_to_file. This error occurs when the bucket on s3 cannot be found. Step by step instructions are here.
  1 Kommentar
Yona
Yona am 23 Jul. 2018
Like you can see in my question, i used this form exactly trying to get a specific file or a but folder.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Introduction to Installation and Licensing finden Sie in Help Center und File Exchange

Produkte


Version

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by