S3 multipart upload to presigned URL returns HTTP 500 on OPTIONS request

0

We have set up a S3 bucket with CORS rules to upload data to. The upload is done using a presigned URL and a multipart upload. We have several deployments that have this setup working. On the latest setup that we deployed today the S3 bucket is returning a HTTP code 500 (in the OPTIONS request) and a CORS error No 'Access-Control-Allow-Origin' header is present on the requested resource when attempting a PUT request using the needed payload and headers.

While investigating the error with curl we found that the bucket returns a redirect from https://bucketname.s3.amazonaws.com/ to https://bucketname.s3.eu-central-1.amazonaws.com/. When we send a request to the URL that includes the region with the needed payload and headers, we now receive Access-Control-Allow-Origin headers but a HTTP code 403 with a response that the signatures do not match.

When the CORS configuration is removed from the bucket, we receive HTTP code 403 and a CORS error.

We have also tried server different options in the CORS configuration, all of which resulted in a HTTP code 500.

Rebuilding the bucket also did not change the above-described problems.

질문됨 2년 전1830회 조회
1개 답변
1
수락된 답변

If the bucket is new, this redirection response is expected while DNS propagation takes place. See https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingRouting.html for further details.

The redirection will stop once DNS has propagated fully, and S3 should start responding to the non-region-specific DNS name for your bucket.

However, it may be more reliable to specify the region when creating the presigned URLs, just in case S3 returns a redirect at some point in the future.

AWS
전문가
Paul_L
답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠