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!

질문됨 한 달 전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
답변함 한 달 전
profile picture
전문가
검토됨 한 달 전
  • 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?

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠