Hi, when I try to upload screenshots to experiment...
# ask-questions
h
Hi, when I try to upload screenshots to experiment, I got this CORS error. I configured to access our S3 bucket. what else I need to configure?
f
interesting
can you share the headers?
h
I solved this by add CORS settings in the s3 bucket. but then I got the new error when calling upload URL
f
hrmm, hard to tell where that is coming from
h
Copy code
<Error>
<Code>SignatureDoesNotMatch</Code>
<Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message>
I got this error…
my initial guess is this related with these 2 setting? I just makeup 2 random string to set these 2 env values. Am’I wrong?
@fresh-football-47124 I suggest you to change the s3 upload using the v4 version https://github.com/aws/aws-sdk-js/issues/1213#issuecomment-259261766
Copy code
var s3 = new AWS.S3({signatureVersion: 'v4'});
f
okay, thanks Herb, we'll take a look at this tomorrow, shouldn't be hard
1
h
@fresh-football-47124 Any update on this one?
f
I spoke to Jeremy about it, he was still looking into it
I'll make a note to work on it tomorrow
1
f
@helpful-carpenter-3208 Does your AWS bucket policy require a specific signature version? According to the docs, both v2 and v4 and allowed by default unless you restrict the signature version in the bucket policy. https://docs.aws.amazon.com/AmazonS3/latest/API/bucket-policy-s3-sigv4-conditions.html
I see, looks like v2 is deprecated and any new buckets created only support v4. I'll update our api to use v4 when signing the url.
h
Cool~ Thanks for investigate this!
f
Just pushed. New docker build will be available in about 10 minutes
👍 1
h
Hi, @future-teacher-7046 I can see you have made the change and it indeed use the v4 signed url. but I’m still got 400 error…
I’m wondering if something else I’m missing on our bucket
f
is it just through Growthbook?
can you access the files directly?
h
Yes, it’s through our selfhosted growthbook. the file is not uploaded to our s3 bucket.
this 400 request is mean to upload the file to s3. but got 400
f
i see
if you want to DM me the S3 permissions/config, I can check it against our config
1
a
I am running into this exact issue, was there a solution to it?
🙌 1
f
HI Loren
sorry, wrong link