Error in loading data from AWS S3

5 visualizaciones (últimos 30 días)
Yona
Yona el 15 de Jul. de 2018
Comentada: Yona el 18 de Dic. de 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?

Respuesta aceptada

Arvind Narayanan
Arvind Narayanan el 26 de Jul. de 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 comentario
Yona
Yona el 18 de Dic. de 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

Iniciar sesión para comentar.

Más respuestas (1)

Harsh
Harsh el 20 de Jul. de 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 comentario
Yona
Yona el 23 de Jul. de 2018
Like you can see in my question, i used this form exactly trying to get a specific file or a but folder.

Iniciar sesión para comentar.

Categorías

Más información sobre MATLAB en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by