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?

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则

相关内容