{"id":758,"date":"2020-06-19T22:40:00","date_gmt":"2020-06-19T17:10:00","guid":{"rendered":"http:\/\/www.ankitsharma.blog\/?p=758"},"modified":"2020-12-19T22:41:46","modified_gmt":"2020-12-19T17:11:46","slug":"s3-copy-issues","status":"publish","type":"post","link":"https:\/\/www.ankitsharma.blog\/index.php\/s3-copy-issues\/","title":{"rendered":"S3 Copy Issues"},"content":{"rendered":"\n<p>Hey Fellas, I was working with a backup script today on AWS and there it had a step where an artifact is to be backed up to AWS S3 service. On copying, I started receiving the error below:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">upload failed: &lt;source_file> to s3:\/\/&lt;bucket>\/&lt;key> Connection was closed before we received a valid response from endpoint URL: \"&lt;s3 bucket public url>\/&lt;object key name>\".<\/pre>\n\n\n\n<p>If you have also got into this problem then please be with me. I started looking into a lot of things and realized that the IAM role which had the policy attached was missing a single clause in the Resource definition.<\/p>\n\n\n\n<p>I missed specifying the recursive objects on the bucket. Effectively this is achieved by appending <strong>\/*<\/strong> to the bucket name in the resource section of the policy. Look at the resource definition below:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\"Resource\": \"arn:aws:s3:::&lt;bucket-name>\/*\"<\/pre>\n\n\n\n<p>There you are. It is the right was to specify permissions for an IAM role or the S3 Bucket Policy. <\/p>\n\n\n\n<p>Good Luck using AWS CLI.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hey Fellas, I was working with a backup script today on AWS and there it had a step where an artifact is to be backed up to AWS S3 service. On copying, I started receiving the error below: upload failed:&#8230; <\/p>\n","protected":false},"author":1,"featured_media":761,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[55,19,23],"tags":[56,24,57],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>S3 Copy Issues &#187; Ankit Sharma<\/title>\n<meta name=\"description\" content=\"Connection was closed before we received a valid response from endpoint URL: AWS S3 CLI\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.ankitsharma.blog\/index.php\/s3-copy-issues\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"S3 Copy Issues &#187; Ankit Sharma\" \/>\n<meta property=\"og:description\" content=\"Connection was closed before we received a valid response from endpoint URL: AWS S3 CLI\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.ankitsharma.blog\/index.php\/s3-copy-issues\/\" \/>\n<meta property=\"og:site_name\" content=\"Ankit Sharma\" \/>\n<meta property=\"article:published_time\" content=\"2020-06-19T17:10:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-12-19T17:11:46+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.ankitsharma.blog\/wp-content\/uploads\/2020\/12\/amazon-s3.png\" \/>\n\t<meta property=\"og:image:width\" content=\"640\" \/>\n\t<meta property=\"og:image:height\" content=\"480\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Ankit Sharma\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ankit Sharma\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.ankitsharma.blog\/index.php\/s3-copy-issues\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.ankitsharma.blog\/index.php\/s3-copy-issues\/\"},\"author\":{\"name\":\"Ankit Sharma\",\"@id\":\"https:\/\/www.ankitsharma.blog\/#\/schema\/person\/37b04ecf3989b3c285db5048cc61a918\"},\"headline\":\"S3 Copy Issues\",\"datePublished\":\"2020-06-19T17:10:00+00:00\",\"dateModified\":\"2020-12-19T17:11:46+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.ankitsharma.blog\/index.php\/s3-copy-issues\/\"},\"wordCount\":139,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.ankitsharma.blog\/#\/schema\/person\/37b04ecf3989b3c285db5048cc61a918\"},\"keywords\":[\"AWS\",\"Linux\",\"S3\"],\"articleSection\":[\"AWS\",\"devops\",\"Linux\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.ankitsharma.blog\/index.php\/s3-copy-issues\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.ankitsharma.blog\/index.php\/s3-copy-issues\/\",\"url\":\"https:\/\/www.ankitsharma.blog\/index.php\/s3-copy-issues\/\",\"name\":\"S3 Copy Issues &#187; Ankit Sharma\",\"isPartOf\":{\"@id\":\"https:\/\/www.ankitsharma.blog\/#website\"},\"datePublished\":\"2020-06-19T17:10:00+00:00\",\"dateModified\":\"2020-12-19T17:11:46+00:00\",\"description\":\"Connection was closed before we received a valid response from endpoint URL: AWS S3 CLI\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.ankitsharma.blog\/index.php\/s3-copy-issues\/\"]}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.ankitsharma.blog\/#website\",\"url\":\"https:\/\/www.ankitsharma.blog\/\",\"name\":\"Ankit Sharma\",\"description\":\"technology | food | cars | lifesyle | rants\",\"publisher\":{\"@id\":\"https:\/\/www.ankitsharma.blog\/#\/schema\/person\/37b04ecf3989b3c285db5048cc61a918\"},\"alternateName\":\"ankitsharma\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.ankitsharma.blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/www.ankitsharma.blog\/#\/schema\/person\/37b04ecf3989b3c285db5048cc61a918\",\"name\":\"Ankit Sharma\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.ankitsharma.blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.ankitsharma.blog\/wp-content\/uploads\/2021\/11\/cropped-ankitsharma-logo1.png\",\"contentUrl\":\"https:\/\/www.ankitsharma.blog\/wp-content\/uploads\/2021\/11\/cropped-ankitsharma-logo1.png\",\"width\":415,\"height\":68,\"caption\":\"Ankit Sharma\"},\"logo\":{\"@id\":\"https:\/\/www.ankitsharma.blog\/#\/schema\/person\/image\/\"},\"sameAs\":[\"https:\/\/www.ankitsharma.blog\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"S3 Copy Issues &#187; Ankit Sharma","description":"Connection was closed before we received a valid response from endpoint URL: AWS S3 CLI","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.ankitsharma.blog\/index.php\/s3-copy-issues\/","og_locale":"en_US","og_type":"article","og_title":"S3 Copy Issues &#187; Ankit Sharma","og_description":"Connection was closed before we received a valid response from endpoint URL: AWS S3 CLI","og_url":"https:\/\/www.ankitsharma.blog\/index.php\/s3-copy-issues\/","og_site_name":"Ankit Sharma","article_published_time":"2020-06-19T17:10:00+00:00","article_modified_time":"2020-12-19T17:11:46+00:00","og_image":[{"width":640,"height":480,"url":"https:\/\/www.ankitsharma.blog\/wp-content\/uploads\/2020\/12\/amazon-s3.png","type":"image\/png"}],"author":"Ankit Sharma","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Ankit Sharma","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.ankitsharma.blog\/index.php\/s3-copy-issues\/#article","isPartOf":{"@id":"https:\/\/www.ankitsharma.blog\/index.php\/s3-copy-issues\/"},"author":{"name":"Ankit Sharma","@id":"https:\/\/www.ankitsharma.blog\/#\/schema\/person\/37b04ecf3989b3c285db5048cc61a918"},"headline":"S3 Copy Issues","datePublished":"2020-06-19T17:10:00+00:00","dateModified":"2020-12-19T17:11:46+00:00","mainEntityOfPage":{"@id":"https:\/\/www.ankitsharma.blog\/index.php\/s3-copy-issues\/"},"wordCount":139,"commentCount":0,"publisher":{"@id":"https:\/\/www.ankitsharma.blog\/#\/schema\/person\/37b04ecf3989b3c285db5048cc61a918"},"keywords":["AWS","Linux","S3"],"articleSection":["AWS","devops","Linux"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.ankitsharma.blog\/index.php\/s3-copy-issues\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.ankitsharma.blog\/index.php\/s3-copy-issues\/","url":"https:\/\/www.ankitsharma.blog\/index.php\/s3-copy-issues\/","name":"S3 Copy Issues &#187; Ankit Sharma","isPartOf":{"@id":"https:\/\/www.ankitsharma.blog\/#website"},"datePublished":"2020-06-19T17:10:00+00:00","dateModified":"2020-12-19T17:11:46+00:00","description":"Connection was closed before we received a valid response from endpoint URL: AWS S3 CLI","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.ankitsharma.blog\/index.php\/s3-copy-issues\/"]}]},{"@type":"WebSite","@id":"https:\/\/www.ankitsharma.blog\/#website","url":"https:\/\/www.ankitsharma.blog\/","name":"Ankit Sharma","description":"technology | food | cars | lifesyle | rants","publisher":{"@id":"https:\/\/www.ankitsharma.blog\/#\/schema\/person\/37b04ecf3989b3c285db5048cc61a918"},"alternateName":"ankitsharma","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.ankitsharma.blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.ankitsharma.blog\/#\/schema\/person\/37b04ecf3989b3c285db5048cc61a918","name":"Ankit Sharma","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.ankitsharma.blog\/#\/schema\/person\/image\/","url":"https:\/\/www.ankitsharma.blog\/wp-content\/uploads\/2021\/11\/cropped-ankitsharma-logo1.png","contentUrl":"https:\/\/www.ankitsharma.blog\/wp-content\/uploads\/2021\/11\/cropped-ankitsharma-logo1.png","width":415,"height":68,"caption":"Ankit Sharma"},"logo":{"@id":"https:\/\/www.ankitsharma.blog\/#\/schema\/person\/image\/"},"sameAs":["https:\/\/www.ankitsharma.blog"]}]}},"_links":{"self":[{"href":"https:\/\/www.ankitsharma.blog\/index.php\/wp-json\/wp\/v2\/posts\/758"}],"collection":[{"href":"https:\/\/www.ankitsharma.blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ankitsharma.blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ankitsharma.blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ankitsharma.blog\/index.php\/wp-json\/wp\/v2\/comments?post=758"}],"version-history":[{"count":3,"href":"https:\/\/www.ankitsharma.blog\/index.php\/wp-json\/wp\/v2\/posts\/758\/revisions"}],"predecessor-version":[{"id":762,"href":"https:\/\/www.ankitsharma.blog\/index.php\/wp-json\/wp\/v2\/posts\/758\/revisions\/762"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ankitsharma.blog\/index.php\/wp-json\/wp\/v2\/media\/761"}],"wp:attachment":[{"href":"https:\/\/www.ankitsharma.blog\/index.php\/wp-json\/wp\/v2\/media?parent=758"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ankitsharma.blog\/index.php\/wp-json\/wp\/v2\/categories?post=758"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ankitsharma.blog\/index.php\/wp-json\/wp\/v2\/tags?post=758"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}