Getting nocode check error in response to s3 object upload

View profile

When I tried to use s3 client to upload objects, I am getting errors. Below is the code snippet

TYPESCRIPT
const s3 = new S3({
        region: "blr1",
        endpoint: "https://blr1.vultrobjects.com",
        credentials: {
          accessKeyId: process.env.NEXT_PUBLIC_S3_ACCESS_KEY_ID!,
          secretAccessKey: process.env.NEXT_PUBLIC_S3_SECRET_ACCESS_KEY!,
        },
      });
      console.log("File key being loaded:", file_key);

      const s3Url = getS3Url(file_key);


on the other hand

TYPESCRIPT
export function getS3Url(file_key: string) {
  const url = `https://${process.env.NEXT_PUBLIC_S3_BUCKET_NAME}.blr1.vultrobjects.com/${file_key}`;
  return url;
}


Comment
FU
1 comment

Join Vultr Community

Points, levels & badges

Enter challenges & submit builds

Register to events & meetups

Get your work featured

1 Comment

0
Commented: 2 years ago
error:

'$fault': 'client',

  '$metadata': {

    httpStatusCode: 404,

    requestId: 'tx00000123108c759aaf47a-00672f3783-d974cef-blr1',

    extendedRequestId: undefined,

    cfId: undefined,

    attempts: 1,

    totalRetryDelay: 0

  },

  Code: 'NoSuchKey',

  BucketName: 'docbuck',

  RequestId: 'tx00000123108c759aaf47a-00672f3783-d974cef-blr1',

  HostId: 'd974cef-blr1-in'

}
0

Post Comment