{"action":"created","issue":{"url":"https://api.github.com/repos/aws/aws-cli/issues/2213","repository_url":"https://api.github.com/repos/aws/aws-cli","labels_url":"https://api.github.com/repos/aws/aws-cli/issues/2213/labels{/name}","comments_url":"https://api.github.com/repos/aws/aws-cli/issues/2213/comments","events_url":"https://api.github.com/repos/aws/aws-cli/issues/2213/events","html_url":"https://github.com/aws/aws-cli/issues/2213","id":180417730,"number":2213,"title":"aws s3 cp [Errno 2] No such file or directory","user":{"login":"mariotacke","id":4942019,"avatar_url":"https://avatars.githubusercontent.com/u/4942019?v=3","gravatar_id":"","url":"https://api.github.com/users/mariotacke","html_url":"https://github.com/mariotacke","followers_url":"https://api.github.com/users/mariotacke/followers","following_url":"https://api.github.com/users/mariotacke/following{/other_user}","gists_url":"https://api.github.com/users/mariotacke/gists{/gist_id}","starred_url":"https://api.github.com/users/mariotacke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mariotacke/subscriptions","organizations_url":"https://api.github.com/users/mariotacke/orgs","repos_url":"https://api.github.com/users/mariotacke/repos","events_url":"https://api.github.com/users/mariotacke/events{/privacy}","received_events_url":"https://api.github.com/users/mariotacke/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-09-30T22:48:33Z","updated_at":"2016-10-04T19:47:06Z","closed_at":null,"body":"I'm getting an error on Windows trying to `cp` or `sync` from S3: `[Errno 2] No such file or directory`. The files I want to copy or sync download correctly but the process exists with exit 1. Why does it throw an error and why is it trying to sync an empty folder?\r\n\r\n### CLI\r\n```sh\r\naws --version\r\naws-cli/1.10.67 Python/2.7.9 Windows/8 botocore/1.4.57\r\n```\r\n\r\n### Bucket Structure\r\n```\r\nmy-bucket\r\n  - test\r\n    - test-file.txt\r\n```\r\n\r\n### Command\r\n```\r\naws s3 cp s3://my-bucket/test . --recursive\r\n> download: s3://my-bucket/test/test-file.txt to .\\test-file.txt\r\n> download failed: s3://my-bucket/test/ to .\\ [Errno 2] No such file or \r\n  directory: u'C:\\\\Users\\\\my-username\\\\s3\\\\'\r\n```\r\n\r\nThe same exact error occurs when I use `sync`.\r\n\r\nAny idea what I am doing wrong? There are no other files in my bucket or sub-folder."},"comment":{"url":"https://api.github.com/repos/aws/aws-cli/issues/comments/251492562","html_url":"https://github.com/aws/aws-cli/issues/2213#issuecomment-251492562","issue_url":"https://api.github.com/repos/aws/aws-cli/issues/2213","id":251492562,"user":{"login":"kyleknap","id":4605355,"avatar_url":"https://avatars.githubusercontent.com/u/4605355?v=3","gravatar_id":"","url":"https://api.github.com/users/kyleknap","html_url":"https://github.com/kyleknap","followers_url":"https://api.github.com/users/kyleknap/followers","following_url":"https://api.github.com/users/kyleknap/following{/other_user}","gists_url":"https://api.github.com/users/kyleknap/gists{/gist_id}","starred_url":"https://api.github.com/users/kyleknap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kyleknap/subscriptions","organizations_url":"https://api.github.com/users/kyleknap/orgs","repos_url":"https://api.github.com/users/kyleknap/repos","events_url":"https://api.github.com/users/kyleknap/events{/privacy}","received_events_url":"https://api.github.com/users/kyleknap/received_events","type":"User","site_admin":false},"created_at":"2016-10-04T19:47:06Z","updated_at":"2016-10-04T19:47:06Z","body":"@mariotacke So this is the part that looks a little fishy\r\n```\r\ndownload failed: s3://my-bucket/test/ to .\\ [Errno 2] No such file or directory: u'C:\\\\Users\\\\my-username\\\\s3\\\\'\r\n```\r\nCould you run on a list objects on that key?\r\n```\r\n$ aws s3 ls s3://my-bucket/test/\r\n```\r\nI have a feeling the key is of non-zero size. If it is of non-zero size, the reason you are seeing this is because when a file ends with ``/`` or ``\\`` for windows it implies that it is a directory and it is invalid otherwise to have a file with that name and when the CLI tries to download it as a file, it will throw errors. The key needs to be of size zero for the CLI to skip over it.\r\n\r\nIf this is not the case, could you provide debug logs for the command you are running as I was not able to reproduce it?"}}
{"actor":{"display_login":"kyleknap"}}