COPY from S3 into Redshift Error - The specified key does not exist

0

I have created a manifest file (named as manifest.json in S3) as

{
  "entries": [
    {"url":"s3://bucketname/2024/03/28/", "mandatory":true}]
}

The S3 URL is pointing to a folder. This URL works when I tried the COPY company without a manifest file:

COPY table
FROM 's3://bucketname/2024/03/28/'
IAM_ROLE 'arn:xxxxx'
DELIMITER '	';

However, when I tried to use the manifest file

COPY table
from 's3://bucketname/manifest'
IAM_ROLE 'arn:xxxx'
manifest

I had errors as:

ERROR: Problem reading manifest file - S3ServiceException:The specified key does not exist.,Status 404,Error NoSuchKey

Could anyone help with this error? Thanks!

質問済み 1ヶ月前303ビュー
1回答
1
承認された回答

Hi there

The manifest file manifest.json appears to be located at s3://bucketname/manifest.json, but you are specifying the location as s3://bucketname/manifest (without the .json extension).

To resolve the issue, you need to ensure that the manifest file exists in the correct S3 location and specify the correct location in the COPY command, and ensure it has the .manifest extension. Here's how you can modify the COPY command:


COPY table
FROM 's3://bucketname/manifest.manifest'
IAM_ROLE 'arn:xxxxx'
manifest;

Also, your manifest entry is pointing to a prefix, it needs to have an entry to each file to load:

{
  "entries": [
    {"url":"s3://bucketname/2024/03/28/file1", "mandatory":true},
    {"url":"s3://bucketname/2024/03/28/file2", "mandatory":true}
  ]
}
profile pictureAWS
エキスパート
Matt-B
回答済み 1ヶ月前
profile picture
エキスパート
レビュー済み 1ヶ月前
  • Thank you for your reply! I tried to add the .json but I got the error - Manifest file is not in correct json format. My manifest file is in json format. Any idea how to modify the manifest file?

  • Hi There

    You manifest entries need to point to a file to load. You are pointing to a prefix s3://bucketname/2024/03/28/. You should have an entry for each file that you want to copy in the manifest:

    {
      "entries": [
        {"url":"s3://bucketname/2024/03/28/file1", "mandatory":true},
        {"url":"s3://bucketname/2024/03/28/file2", "mandatory":true}
      ]
    }
    

    I updated my original answer to include this info

  • Thank you! It worked! QQ does manifest file have to point to a specific file, folders won't work?

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ