-
Notifications
You must be signed in to change notification settings - Fork 2k
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
cannot engage S3 accelerated endpoints due to AWS SDK API changes? #4809
Comments
Hi. i'm not sure how to reproduce this problem. when I set |
are you using an old bucket with the old behaviour? (bucket created 10+ years ago) |
The bucket was created last week, here's my env:
The error shows only when trying to upload a file. |
how's you frontend code look like? any codesandbox or similar to reproduce the problem? we need some steps to reproduce the problem. "trying to upload a file" can be done in many ways using uppy. |
Good point, sorry I wasn't clear about it. uppyOptions: {
id: 'uppy',
autoProceed: true,
allowMultipleUploadBatches: false,
debug: true,
restrictions: {
maxFileSize: 2 * 1024 * 1024 * 1024, // 2Gb
allowedFileTypes: [
'video/mp4',
'video/mpeg',
'application/x-mpegURL'
],
requiredMetaFields: [],
},
meta: {},
infoTimeout: 10_000,
}
this.uppy = new Uppy({...this.uppyOptions})
this.uppy.use(this.AwsS3Multipart, {
shouldUseMultipart: (file) => file.size > 100 * 2 ** 20,
companionUrl: 'https://upload.domain.com/',
getTemporarySecurityCredentials: true}) I will try to create a repro later, as it might be tricky |
I wanted to clarify, do you receive an accelerated S3 endpoint in such case? |
ok with s3-multipart i managed to reproduce the problem. I think what's going on is:
however all other S3 methods do NOT support |
Thanks so much for looking into this, I was bracing to spend my Saturday on an investigation. Please let me know if I can help with tests. |
Sure, feel free to test the pr linked above if youre able to |
I can see now that
...s3-accelerate.amazonaws.com/' , yet in browser I still can see upload going to a regional bucket URL. Trying to find where it get's overwrited down the line.
|
After some more debugging I found out that inside server-side Companion an endpoint is formed and passed around correctly as accelerated, but on client-side the actual endpoint is formed by
despite Bucket name and region are returned on {
"credentials": {
"AccessKeyId": "....",
"SecretAccessKey": "....",
"SessionToken": "...=",
"Expiration": "2023-12-09T17:40:03.000Z"
},
"bucket": "bucket-name",
"region": "eu-west-1"
} So, my question is: is it a bug in Companion that the actual endpoint is never passed to the client or I missed something about plugin or Companion configuration? I've updated const host = `${bucketName}.s3-accelerate.amazonaws.com` And everything works as expected now. So seems like accelerated endpoint feature was never a part of |
We support signing on the server using
We also support signing on the server using
{
"url": "https://***.s3-accelerate.amazonaws.com/my-prefix/...",
"expires": 800
} I believe what you are asking for is the |
create a separate s3 client for `createPresignedPost` fixes #4809
I'll create a new issue for that #4822 |
Initial checklist
Link to runnable example
No response
Steps to reproduce
In .env set
COMPANION_AWS_USE_ACCELERATE_ENDPOINT=“true”
and observe the error:A custom endpoint cannot be combined with S3 Accelerate
Expected behavior
Companion should use accelerated S3 endpoint based on
COMPANION_AWS_USE_ACCELERATE_ENDPOINT=“true”
setting alone.
Actual behavior
Trying to use S3 accelerated endpoints and in my .env I have defined:
COMPANION_AWS_USE_ACCELERATE_ENDPOINT=“true”
and did not defined
COMPANION_AWS_ENDPOINT
Yet, Companion returns such error:
A custom endpoint cannot be combined with S3 Accelerate
Listing an accelerated endpoint via
COMPANION_AWS_ENDPOINT
did not help.Actually, this error comes not from companion source code, but from AWS SDK itself. Looks like it's similar to #4135, but that workaround does not work anymore apparently.
I have tried messing with source code inside the block where endpoint is defined (https://github.com/transloadit/uppy/pull/4140/files#diff-bde6ee25e8588159566b1b6c431f00a59aac00d4226f750f1402def0eebf24bcR36), but the all my attempts produced either the error message above or a non-accelerated S3 bucket URL.
I will try to dig deeper inside SDK to see at what stage does it decide which URL to return, but if anyone more familiar with the code can have a quick look, it'd probably be faster.
Thanks heaps in advance.
The text was updated successfully, but these errors were encountered: