Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

S3 v3.540.0 - v3.565.0 breaks when used with s3-request-presigner@v3.565.0 #6045

Open
3 tasks done
mattkrick opened this issue May 1, 2024 · 2 comments
Open
3 tasks done
Assignees
Labels
bug This issue is a bug. closing-soon This issue will automatically close in 4 days unless further comments are made. p2 This is a standard priority issue response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.

Comments

@mattkrick
Copy link

Checkboxes for prior research

Describe the bug

Unable to presign a URL using an S3 client that is at v3.540.0 or newer

SDK version number

@aws-sdk/client-s3@^3.540.0

Which JavaScript Runtime is this issue in?

Node.js

Details of the browser/Node.js/ReactNative version

v20.11.0

Reproduction Steps

const client = new S3Client({
      region: 'us-east-1',
      bucketEndpoint: true
    })
const command = new GetObjectCommand({Bucket: this.baseUrl, Key: key})
const encodedUri = await getSignedUrl(client, command, {expiresIn: 3600})

Observed Behavior

TypeError: Cannot read properties of undefined (reading 'parseArn')
at callFunction (/node_modules/@smithy/util-endpoints/dist-cjs/index.js:269:50)
at evaluateCondition (/node_modules/@smithy/util-endpoints/dist-cjs/index.js:280:17)
at evaluateConditions (/node_modules/@smithy/util-endpoints/dist-cjs/index.js:293:34)
at evaluateErrorRule (/node_modules/@smithy/util-endpoints/dist-cjs/index.js:397:39)
at evaluateRules (/node_modules/@smithy/util-endpoints/dist-cjs/index.js:431:7)
at evaluateTreeRule (/node_modules/@smithy/util-endpoints/dist-cjs/index.js:416:10)
at evaluateRules (/node_modules/@smithy/util-endpoints/dist-cjs/index.js:433:35)
at evaluateTreeRule (/node_modules/@smithy/util-endpoints/dist-cjs/index.js:416:10)
at evaluateRules (/node_modules/@smithy/util-endpoints/dist-cjs/index.js:433:35)
at resolveEndpoint (/node_modules/@smithy/util-endpoints/dist-cjs/index.js:462:20)

Expected Behavior

No error

Possible Solution

No response

Additional Information/Context

No response

@mattkrick mattkrick added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels May 1, 2024
@RanVaknin
Copy link
Contributor

RanVaknin commented May 7, 2024

HI @mattkrick ,

I'm not able to reproduce this issue:

$ npm ls
rvaknin/test_folder/5125
├── @aws-sdk/client-s3@3.569.0
└── @aws-sdk/s3-request-presigner@3.569.0
import { S3Client, GetObjectCommand } from '@aws-sdk/client-s3'
import { getSignedUrl } from '@aws-sdk/s3-request-presigner'

const s3Client = new S3Client({
    region:"us-east-1",
    bucketEndpoint: true
});

const url = await getSignedUrl(s3Client, new GetObjectCommand({
    Bucket: 'https://your-bucket-name.s3.amazonaws.com',
    Key: 'foo.txt',
}), { expiresIn: 3600 });

console.log(url);

/*
prints:

https://your-bucket-name.s3.amazonaws.com/foo.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=REDACTED%2F20240507%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240507T190255Z&X-Amz-Expires=3600&X-Amz-Signature=REDACTED&X-Amz-SignedHeaders=host&x-id=GetObject

*/

Did you update the rest of the SDK's dependencies to all be on @latest?

Thanks,
Ran~

@RanVaknin RanVaknin self-assigned this May 7, 2024
@RanVaknin RanVaknin added response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days. p2 This is a standard priority issue and removed needs-triage This issue or PR still needs to be triaged. labels May 7, 2024
Copy link

This issue has not received a response in 1 week. If you still think there is a problem, please leave a comment to avoid the issue from automatically closing.

@github-actions github-actions bot added the closing-soon This issue will automatically close in 4 days unless further comments are made. label May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. closing-soon This issue will automatically close in 4 days unless further comments are made. p2 This is a standard priority issue response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.
Projects
None yet
Development

No branches or pull requests

2 participants