简体   繁体   中英

AWS CLI for S3 - Errno 2 No such file or directory: u'

I'm trying to extract a few hundred GB of data from an S3 bucket to a Windows 10 computer's external hard drive and the command I'm using (in a .bat file with AWSCLI-64bit installed) is:

aws s3 sync s3://aws-extraction/ F:\Bowral-PE\ --delete --region ap-southeast-2 > "%SyncLogFile%"

For the most part it seems to be working because files seem to be downloading and directories seem to be getting created. So far there's 82GB of data downloaded, but every single line says in the cmd verbose output shows:

download failed: s3://aws-extraction/Archive/somedirectory/ to F:\\Bowral-PE\\Archive\\somedirectory Errno 2 No such file or directory: u'F:\\Bowral-PE\\Archive\\somedirectory '

Any ideas why I'm getting this and how to stop it?

Please note that the AWSCLI seems to be using Python or something similar (a guess based on results when searching for the error), and I am a complete newbie when it comes to Python.

I hit the similar problem when using the msi version of latest awscli on my windows 10 today:

C:>aws s3 sync s3://<my_bucket_name>/ <local_dir>
   fatal error [Errno 2] No such file or directory

The above sync command works if I backup the bucket content to a unix machine.

After some googling, seems the "fatal error [Errno 2] No such file or directory" is coming out from python.

I realised the awscli's windows msi version uses the self contained python (v2.7), which may be too old for windows 10.

I then installed the latest python (v3.6), used pip way to install awscli following the instructions here .

After this the direct backup / restoration works as expected.

For me, I was getting this notification at the same time:

在此处输入图片说明

By clicking on it and allowing Python to access the folder I was trying to save it in, I was able to rerun the command and it succeeded.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM