{"action":"created","issue":{"url":"https://api.github.com/repos/drone-plugins/drone-s3-sync/issues/17","repository_url":"https://api.github.com/repos/drone-plugins/drone-s3-sync","labels_url":"https://api.github.com/repos/drone-plugins/drone-s3-sync/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/drone-plugins/drone-s3-sync/issues/17/comments","events_url":"https://api.github.com/repos/drone-plugins/drone-s3-sync/issues/17/events","html_url":"https://github.com/drone-plugins/drone-s3-sync/issues/17","id":150939700,"number":17,"title":"sync stops with AWS error \"NoSuchKey\"","user":{"login":"asyrique","id":5598413,"avatar_url":"https://avatars.githubusercontent.com/u/5598413?v=3","gravatar_id":"","url":"https://api.github.com/users/asyrique","html_url":"https://github.com/asyrique","followers_url":"https://api.github.com/users/asyrique/followers","following_url":"https://api.github.com/users/asyrique/following{/other_user}","gists_url":"https://api.github.com/users/asyrique/gists{/gist_id}","starred_url":"https://api.github.com/users/asyrique/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asyrique/subscriptions","organizations_url":"https://api.github.com/users/asyrique/orgs","repos_url":"https://api.github.com/users/asyrique/repos","events_url":"https://api.github.com/users/asyrique/events{/privacy}","received_events_url":"https://api.github.com/users/asyrique/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-04-25T18:02:11Z","updated_at":"2016-11-19T13:41:20Z","closed_at":null,"body":"Hi,\n\nWe're experiencing an error with Drone artifact uploads to S3 via S3 sync.\n\nThe drone build will randomly fail on certain files with the following error:\n\n```\nERROR: failed to upload /foo/bar/..../baz.svg to foo/img/login.svg: NoSuchKey: The specified key does not exist.\n    status code: 404, request id: 123456\n[info] build failed (exit code 1)\n```\n\nThere are no discernible patterns in the filename, filetype or filesize that we causes the error, nor is there a discernible pattern in the number of files before the upload fails.\n\nPlease let me know if I can provide any extra info to help contextualize this issue, and thanks in advance.\n"},"comment":{"url":"https://api.github.com/repos/drone-plugins/drone-s3-sync/issues/comments/261714526","html_url":"https://github.com/drone-plugins/drone-s3-sync/issues/17#issuecomment-261714526","issue_url":"https://api.github.com/repos/drone-plugins/drone-s3-sync/issues/17","id":261714526,"user":{"login":"bradrydzewski","id":817538,"avatar_url":"https://avatars.githubusercontent.com/u/817538?v=3","gravatar_id":"","url":"https://api.github.com/users/bradrydzewski","html_url":"https://github.com/bradrydzewski","followers_url":"https://api.github.com/users/bradrydzewski/followers","following_url":"https://api.github.com/users/bradrydzewski/following{/other_user}","gists_url":"https://api.github.com/users/bradrydzewski/gists{/gist_id}","starred_url":"https://api.github.com/users/bradrydzewski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bradrydzewski/subscriptions","organizations_url":"https://api.github.com/users/bradrydzewski/orgs","repos_url":"https://api.github.com/users/bradrydzewski/repos","events_url":"https://api.github.com/users/bradrydzewski/events{/privacy}","received_events_url":"https://api.github.com/users/bradrydzewski/received_events","type":"User","site_admin":false},"created_at":"2016-11-19T13:41:20Z","updated_at":"2016-11-19T13:41:20Z","body":"I came across this as well. It looks like it is related to the `delete: true` parameter and some sort of path mismatching. I haven't quite figured it out, but this is what I see in my debugging\r\n\r\nhere is my yaml\r\n\r\n```\r\n  upload:\r\n    image: plugins/s3-sync:1.0\r\n    access: public-read\r\n    region: us-east-1\r\n    bucket: readme.drone.io\r\n    source: public/\r\n    target: /0.5/\r\n    delete: true\r\n```\r\n\r\nI can see it skipping uploads (expected):\r\n\r\n```\r\nSkipping \"/Users/bradrydzewski/code/src/github.com/drone/docs/public/404.html\" because hashes and metadata match\r\nSkipping \"/Users/bradrydzewski/code/src/github.com/drone/docs/public/.gitkeep\" because hashes and metadata match\r\n```\r\n\r\nbut then trying to delete those same files:\r\n\r\n```\r\nRemoving remote file \"0.5/.gitkeep\"\r\nRemoving remote file \"0.5/404.html\"\r\n```\r\n\r\nI think it has to do with this line of code and path mismatches:\r\n\r\n```\r\nfound := false\r\nfor _, l := range local {\r\n\tif l == r {\r\n\t\tfound = true\r\n\t\tbreak\r\n\t}\r\n}\r\n```\r\n\r\nSpecifically in my example the base directory locally doesn't match the base directory to which I am uploading. This is probably part of the problem ..\r\n\r\n```\r\n    source: public/\r\n    target: /0.5/\r\n```\r\n\r\nI've temporarily disabled `delete: false` and now it is working fine. I will try to debug further and see if I can come up with a solution in my spare time."}}
{"actor":{"display_login":"bradrydzewski"}}