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?

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南