Skip to content

getSignedUrl #7018

@rastermechanism

Description

@rastermechanism

Checkboxes for prior research

Describe the bug

async function generateSignedUrl(fileKey) {
    // Create command
    const command = new GetObjectCommand({
      Bucket: bucketName,
      Key: fileKey,
    });
    const signedUrl = await getSignedUrl(docs3, command, { expiresIn: 3600 });
    console.log("signedUrl", signedUrl);
    return signedUrl;
}

I got url of type

https://bucketname.s3.us-east-2.amazonaws.com/1avc.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIAMBJNOLGMC%2F20250416%2Fus-east-2%2Fs3%2Faws4_request&X-Amz-Date=20250416T135Z&X-Amz-Expires=3600&X-Amz-Signature=cc53cd7266b20145f76847666c&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject

Some value are trimmed for just to give you an idea, when i paste the url in browser it shows

<Error>
<Code>NoSuchKey</Code>
<Message>The specified key does not exist.</Message>
<Key>1avc.pdf</Key>
<RequestId>KWPTDR46PGBWBV</RequestId>
<HostId>ubHq4ITY8T2cb6Wdy1NwiuhHQFEaz27Jq4Rt/2lBpPIcg==</HostId>
</Error>

Where as file does exist in my bucket, can someone suggest what is issue ?

Regression Issue

  • Select this option if this issue appears to be a regression.

SDK version number

@aws-sdk/package-name@version, ...

Which JavaScript Runtime is this issue in?

Node.js

Details of the browser/Node.js/ReactNative version

<Error> <Code>NoSuchKey</Code> <Message>The specified key does not exist.</Message> <Key>1avc.pdf</Key> <RequestId>KWPTDR46PGBWBV</RequestId> <HostId>ubHq4ITY8T2cb6Wdy1NwiuhHQFEaz27Jq4Rt/2lBpPIcg==</HostId> </Error>

Reproduction Steps

async function generateSignedUrl(fileKey) {
    // Create command
    const command = new GetObjectCommand({
      Bucket: bucketName,
      Key: fileKey,
    });
    const signedUrl = await getSignedUrl(docs3, command, { expiresIn: 3600 });
    console.log("signedUrl", signedUrl);
    return signedUrl;
}

Observed Behavior

It should downlaod the file

Expected Behavior

it should download the file

Possible Solution

No response

Additional Information/Context

No response

Metadata

Metadata

Assignees

Labels

bugThis issue is a bug.closed-for-stalenessp3This is a minor priority issueresponse-requestedWaiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions