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!

feita há um mês303 visualizações
1 Resposta
1
Resposta aceita

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
ESPECIALISTA
Matt-B
respondido há um mês
profile picture
ESPECIALISTA
avaliado há um mês
  • 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?

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas