{
    "componentChunkName": "component---src-templates-blog-post-jsx",
    "path": "/post/how-to-fix-access-denied-in-aws-athena/",
    "result": {"data":{"site":{"siteMetadata":{"title":"WEB EGG","author":"Leko - CTO at Yuimedi"}},"markdownRemark":{"id":"60b66652-bf3e-51db-88da-e0819192cd5a","excerpt":"こんにちは。 はじめてAWS Athenaを使用してみました 試しにS3に置いてあるCSVをもとにテーブルを作ろうとしたらAccess Denied…","html":"<p>こんにちは。<br>\nはじめてAWS Athenaを使用してみました</p>\n<p>試しにS3に置いてあるCSVをもとにテーブルを作ろうとしたら<code>Access Denied</code>のエラーが発生<br>\n権限は足りており、疎通確認もできているので、権限系の問題ではない。ではなぜ？</p>\n<p>調べてみたらしょーもないところでドハマリしていたので、備忘録を残しておきます</p>\n<!--more-->\n<h2 id=\"エラーの詳細\" style=\"position:relative;\"><a href=\"#%E3%82%A8%E3%83%A9%E3%83%BC%E3%81%AE%E8%A9%B3%E7%B4%B0\" aria-label=\"エラーの詳細 permalink\" class=\"autolink-header before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>エラーの詳細</h2>\n<p>出てきたエラーはこうです</p>\n<blockquote>\n<p>Your query has the following error: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. com.amazon.ws.emr.hadoop.fs.shaded.com.amazonaws.services.s3.model.AmazonS3Exception: Access Denied (Service: Amazon S3; Status Code: 403; Error Code: AccessDenied; Request ID: XXXXXXXXXXXX), S3 Extended Request ID: XXXXXXX/XXXXXX</p>\n<p>This query ran against the ‘default’ database, unless qualified by the query. Please post the error message on our forum or contact customer support with query id.</p>\n</blockquote>\n<p>DDLのタスクにて<code>Access Denied</code>が起きているよ、とのこと<br>\nこのエラーを見た時に真っ先に権限を疑ったのですが、AthenaとS3にFullAccessを付けても治らず</p>\n<h2 id=\"対応方法\" style=\"position:relative;\"><a href=\"#%E5%AF%BE%E5%BF%9C%E6%96%B9%E6%B3%95\" aria-label=\"対応方法 permalink\" class=\"autolink-header before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>対応方法</h2>\n<p>AWSのページを見つけました</p>\n<blockquote>\n<p>The S3 location should match the format s3://bucket/path; don’t include the endpoint. For example, s3://us-east-1.amazonaws.com/bucket/path would result in an “Access Denied” error.</p>\n<p>— <a href=\"https://aws.amazon.com/premiumsupport/knowledge-center/access-denied-athena/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Resolve “Access Denied” Errors When Running Amazon Athena Queries</a></p>\n</blockquote>\n<p>えぇ…<br>\nここで、実際の画面を見てみましょう</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 668px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/42c92605b944b5a9e6da25f40914a360/54bf4/693663e8211dbcfade29c5af49de6d5e.png\"\n    style=\"display: block\"\n    target=\"_blank\"\n    rel=\"noopener\"\n  >\n    <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 40.7185628742515%; position: relative; bottom: 0; left: 0; background-image: url('data:image/svg+xml,%3csvg%20xmlns=\\'http://www.w3.org/2000/svg\\'%20width=\\'400\\'%20height=\\'163\\'%20viewBox=\\'0%200%20400%20163\\'%20preserveAspectRatio=\\'none\\'%3e%3cpath%20d=\\'M8%207c0%202%200%203%202%203l2-1h1l10%201c9%200%209%200%209-2-1-3-3-4-3-2s0%202-2%200-2-2-3%200h-1c0-2-2-1-3%201l-1%203V7c0-2%200-2-3-2h-5c-1-2-3-1-3%202m309%20132c-3%203-1%204%202%202h1l6%201%205-1h26l1%201c0%201%205%200%206-2h3l-1-2-2%201h-1l-3-1h-5c-1-1-2%200-3%201h-15l-16-1c-1-1-3%200-4%201m-221%208c-2%202-2%203-1%203l3-2h1c0%202%2011%202%2011%201h13l4%201%204-1h2l3%201h5l2-1c0-2-2-3-6-3h-6c0%202-1%202-1%201l-8-1h-12l-2%201h-3l-2-1h-3c-2-1-2-1-4%201m146%200c-2%202-2%202-1%203l2-1c1-2%201-2%202-1%201%202%2011%202%2011%201h23l3%201h5l2-1%201-1v2h5l4-2c1-1%200-2-10-2h-12c0%202-1%202-1%201l-8-1h-12l-2%201h-3l-2-1h-3c-2-1-2-1-4%201m60-1l1%201v2l1%201%201-1h27l2-1h1c1%201%201%201%201-1s0-2-1-1h-10l-10%201h-1c0-2%200-2-1-1h-11m-194%208c-3%201-4%204-1%204l1-1h26l4%201%204-1h5l1%201h4c1%200%203-2%203-4l-1%201h-2l-2-1h-29l-2%201h-3l-2-1h-6\\'%20fill=\\'%23d3d3d3\\'%20fill-rule=\\'evenodd\\'/%3e%3c/svg%3e'); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/42c92605b944b5a9e6da25f40914a360/5251b/693663e8211dbcfade29c5af49de6d5e.webp 167w,\n/static/42c92605b944b5a9e6da25f40914a360/7390e/693663e8211dbcfade29c5af49de6d5e.webp 334w,\n/static/42c92605b944b5a9e6da25f40914a360/7c056/693663e8211dbcfade29c5af49de6d5e.webp 668w,\n/static/42c92605b944b5a9e6da25f40914a360/0a92e/693663e8211dbcfade29c5af49de6d5e.webp 1002w,\n/static/42c92605b944b5a9e6da25f40914a360/aa5f8/693663e8211dbcfade29c5af49de6d5e.webp 1007w\"\n              sizes=\"(max-width: 668px) 100vw, 668px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/42c92605b944b5a9e6da25f40914a360/21521/693663e8211dbcfade29c5af49de6d5e.png 167w,\n/static/42c92605b944b5a9e6da25f40914a360/86d36/693663e8211dbcfade29c5af49de6d5e.png 334w,\n/static/42c92605b944b5a9e6da25f40914a360/74866/693663e8211dbcfade29c5af49de6d5e.png 668w,\n/static/42c92605b944b5a9e6da25f40914a360/d69c4/693663e8211dbcfade29c5af49de6d5e.png 1002w,\n/static/42c92605b944b5a9e6da25f40914a360/54bf4/693663e8211dbcfade29c5af49de6d5e.png 1007w\"\n            sizes=\"(max-width: 668px) 100vw, 668px\"\n            type=\"image/png\"\n          />\n          <img\n            class=\"gatsby-resp-image-image\"\n            src=\"/static/42c92605b944b5a9e6da25f40914a360/74866/693663e8211dbcfade29c5af49de6d5e.png\"\n            alt=\"undefined\"\n            title=\"undefined\"\n            loading=\"lazy\"\n            decoding=\"async\"\n            style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n          />\n        </picture>\n  </a>\n    </span></p>\n<p>お分かりいただけただろうか。<br>\nプレースホルダがエンドポイントまで含めたURLを促しているのに対し、<br>\n<strong>バケットパスを入力する要素の下に、ヘルプテキストが書かれている</strong></p>\n<p>ちゃんと読んでいればハマらないんでしょうが、プレースホルダ見るじゃん。それに従うじゃん。 <strong>エラーになるじゃん</strong><br>\nということで納得はいかないのですが、治りはしました</p>","timeToRead":2,"frontmatter":{"title":"AWS Athenaでテーブルを作る時にAccess Deniedと怒られたら試すこと","tags":["AWS","AWS Athena"],"date":"May 02, 2017","featuredImage":null}}},"pageContext":{"slug":"/how-to-fix-access-denied-in-aws-athena/","previous":{"fields":{"slug":"/introduction-of-raspberry-pi-with-gui/"},"frontmatter":{"title":"Raspberry pi 3 Model BでGUIを起動してインターネットに繋がるまでの手順","tags":["RaspberryPi"]}},"next":{"fields":{"slug":"/how-to-parse-of-coverage-report-with-phpunit/"},"frontmatter":{"title":"PHPUnitのカバレッジレポート(XML)を使ってカバレッジの計算してみた","tags":["PHP","PHPUnit"]}}}},
    "staticQueryHashes": ["2585454260","2954598359"]}