aws-sdk-go-v2 icon indicating copy to clipboard operation
aws-sdk-go-v2 copied to clipboard

Glacier - signature we calculated does not match the signature you provided when uploading in parallel

Open jczornik opened this issue 1 year ago • 2 comments

Describe the bug

I get the following error: api error InvalidSignatureException: The request signature we calculated does not match the signature you provided. when trying to run multiple parts upload in parallel. The same code runs without any issues when uploading parts in a single thread.

Expected Behavior

No error should be returned.

Current Behavior

API return following error: peration error Glacier: UploadMultipartPart, https response error StatusCode: 403, RequestID: <request id>, api error InvalidSignatureException: The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.

Reproduction Steps

I have the following function to upload a part:

func uploadPart(client *glacier.Client, account string, vault string, uploadId string, part part) ([]byte, error) {
	input := glacier.UploadMultipartPartInput{
		AccountId: &account,
		Body:      part.reader,
		VaultName: &vault,
		UploadId:  &uploadId,
		Range:     &part.contentRange,
	}

	r, err := client.UploadMultipartPart(context.TODO(), &input)
	if err != nil {
		return nil, err
	}

	if *r.Checksum != part.sha256 {
		return nil, errors.New("Checksums mismatch")
	}

	return hex.DecodeString(*r.Checksum)
}

Where part is defined as:

type part struct {
	reader       io.Reader
	sha256       string
	contentRange string
	partNo       int64
}

If I run uploadPart multiple times in the goroutine, I get an error about the signature mismatch.

Possible Solution

No response

Additional Information/Context

No response

AWS Go SDK V2 Module Versions Used

github.com/jczornik/glacier_backup github.com/aws/[email protected] github.com/jczornik/glacier_backup github.com/aws/aws-sdk-go-v2/[email protected] github.com/jczornik/glacier_backup github.com/aws/aws-sdk-go-v2/[email protected] github.com/jczornik/glacier_backup github.com/aws/aws-sdk-go-v2/feature/ec2/[email protected] github.com/jczornik/glacier_backup github.com/aws/aws-sdk-go-v2/internal/[email protected] github.com/jczornik/glacier_backup github.com/aws/aws-sdk-go-v2/internal/endpoints/[email protected] github.com/jczornik/glacier_backup github.com/aws/aws-sdk-go-v2/internal/[email protected] github.com/jczornik/glacier_backup github.com/aws/aws-sdk-go-v2/service/[email protected] github.com/jczornik/glacier_backup github.com/aws/aws-sdk-go-v2/service/internal/[email protected] github.com/jczornik/glacier_backup github.com/aws/aws-sdk-go-v2/service/internal/[email protected] github.com/jczornik/glacier_backup github.com/aws/aws-sdk-go-v2/service/[email protected] github.com/jczornik/glacier_backup github.com/aws/aws-sdk-go-v2/service/[email protected] github.com/jczornik/glacier_backup github.com/aws/aws-sdk-go-v2/service/[email protected] github.com/jczornik/glacier_backup github.com/aws/[email protected] github.com/aws/[email protected] github.com/aws/[email protected] github.com/aws/[email protected] github.com/google/[email protected] github.com/aws/[email protected] github.com/jmespath/[email protected] github.com/aws/aws-sdk-go-v2/[email protected] github.com/aws/[email protected] github.com/aws/aws-sdk-go-v2/[email protected] github.com/aws/aws-sdk-go-v2/[email protected] github.com/aws/aws-sdk-go-v2/[email protected] github.com/aws/aws-sdk-go-v2/feature/ec2/[email protected] github.com/aws/aws-sdk-go-v2/[email protected] github.com/aws/aws-sdk-go-v2/internal/[email protected] github.com/aws/aws-sdk-go-v2/[email protected] github.com/aws/aws-sdk-go-v2/service/[email protected] github.com/aws/aws-sdk-go-v2/[email protected] github.com/aws/aws-sdk-go-v2/service/[email protected] github.com/aws/aws-sdk-go-v2/[email protected] github.com/aws/aws-sdk-go-v2/service/[email protected] github.com/aws/aws-sdk-go-v2/[email protected] github.com/aws/[email protected] github.com/aws/aws-sdk-go-v2/[email protected] github.com/google/[email protected] github.com/aws/aws-sdk-go-v2/[email protected] github.com/aws/aws-sdk-go-v2/internal/[email protected] github.com/aws/aws-sdk-go-v2/[email protected] github.com/aws/aws-sdk-go-v2/internal/endpoints/[email protected] github.com/aws/aws-sdk-go-v2/[email protected] github.com/aws/aws-sdk-go-v2/service/internal/[email protected] github.com/aws/aws-sdk-go-v2/[email protected] github.com/aws/aws-sdk-go-v2/service/internal/[email protected] github.com/aws/aws-sdk-go-v2/[email protected] github.com/aws/[email protected] github.com/aws/aws-sdk-go-v2/[email protected] github.com/aws/aws-sdk-go-v2/feature/ec2/[email protected] github.com/aws/aws-sdk-go-v2/[email protected] github.com/aws/aws-sdk-go-v2/service/[email protected] github.com/aws/aws-sdk-go-v2/[email protected] github.com/aws/aws-sdk-go-v2/service/[email protected] github.com/aws/aws-sdk-go-v2/[email protected] github.com/aws/aws-sdk-go-v2/service/[email protected] github.com/aws/aws-sdk-go-v2/[email protected] github.com/aws/[email protected] github.com/aws/aws-sdk-go-v2/[email protected] github.com/google/[email protected] github.com/aws/aws-sdk-go-v2/[email protected] github.com/aws/aws-sdk-go-v2/internal/[email protected] github.com/aws/aws-sdk-go-v2/[email protected] github.com/aws/aws-sdk-go-v2/internal/endpoints/[email protected] github.com/aws/aws-sdk-go-v2/[email protected] github.com/aws/aws-sdk-go-v2/service/internal/[email protected] github.com/aws/aws-sdk-go-v2/[email protected] github.com/aws/aws-sdk-go-v2/service/internal/[email protected] github.com/aws/aws-sdk-go-v2/feature/ec2/[email protected] github.com/aws/[email protected] github.com/aws/aws-sdk-go-v2/feature/ec2/[email protected] github.com/aws/[email protected] github.com/aws/aws-sdk-go-v2/feature/ec2/[email protected] github.com/google/[email protected] github.com/aws/aws-sdk-go-v2/internal/[email protected] github.com/aws/[email protected] github.com/aws/aws-sdk-go-v2/internal/[email protected] github.com/aws/[email protected] github.com/aws/aws-sdk-go-v2/internal/endpoints/[email protected] github.com/aws/[email protected] github.com/aws/aws-sdk-go-v2/internal/endpoints/[email protected] github.com/aws/[email protected] github.com/aws/aws-sdk-go-v2/internal/endpoints/[email protected] github.com/google/[email protected] github.com/aws/aws-sdk-go-v2/service/[email protected] github.com/aws/[email protected] github.com/aws/aws-sdk-go-v2/service/[email protected] github.com/aws/aws-sdk-go-v2/internal/[email protected] github.com/aws/aws-sdk-go-v2/service/[email protected] github.com/aws/aws-sdk-go-v2/internal/endpoints/[email protected] github.com/aws/aws-sdk-go-v2/service/[email protected] github.com/aws/[email protected] github.com/aws/aws-sdk-go-v2/service/[email protected] github.com/google/[email protected] github.com/aws/aws-sdk-go-v2/service/internal/[email protected] github.com/aws/[email protected] github.com/aws/aws-sdk-go-v2/service/internal/[email protected] github.com/aws/[email protected] github.com/aws/aws-sdk-go-v2/service/internal/[email protected] github.com/aws/[email protected] github.com/aws/aws-sdk-go-v2/service/internal/[email protected] github.com/google/[email protected] github.com/aws/aws-sdk-go-v2/service/[email protected] github.com/aws/[email protected] github.com/aws/aws-sdk-go-v2/service/[email protected] github.com/aws/aws-sdk-go-v2/internal/[email protected] github.com/aws/aws-sdk-go-v2/service/[email protected] github.com/aws/aws-sdk-go-v2/internal/endpoints/[email protected] github.com/aws/aws-sdk-go-v2/service/[email protected] github.com/aws/[email protected] github.com/aws/aws-sdk-go-v2/service/[email protected] github.com/google/[email protected] github.com/aws/aws-sdk-go-v2/service/[email protected] github.com/aws/[email protected] github.com/aws/aws-sdk-go-v2/service/[email protected] github.com/aws/aws-sdk-go-v2/internal/[email protected] github.com/aws/aws-sdk-go-v2/service/[email protected] github.com/aws/aws-sdk-go-v2/internal/endpoints/[email protected] github.com/aws/aws-sdk-go-v2/service/[email protected] github.com/aws/[email protected] github.com/aws/aws-sdk-go-v2/service/[email protected] github.com/google/[email protected] github.com/aws/aws-sdk-go-v2/service/[email protected] github.com/aws/[email protected] github.com/aws/aws-sdk-go-v2/service/[email protected] github.com/aws/aws-sdk-go-v2/internal/[email protected] github.com/aws/aws-sdk-go-v2/service/[email protected] github.com/aws/aws-sdk-go-v2/internal/endpoints/[email protected] github.com/aws/aws-sdk-go-v2/service/[email protected] github.com/aws/aws-sdk-go-v2/service/internal/[email protected] github.com/aws/aws-sdk-go-v2/service/[email protected] github.com/aws/aws-sdk-go-v2/service/internal/[email protected] github.com/aws/aws-sdk-go-v2/service/[email protected] github.com/aws/[email protected] github.com/aws/aws-sdk-go-v2/service/[email protected] github.com/google/[email protected] github.com/aws/[email protected] github.com/google/[email protected]

Compiler and Version used

go version go1.21.5 linux/amd64

Operating System and version

Debian GNU/Linux 12 (bookworm)

jczornik avatar Feb 20 '24 23:02 jczornik

Hi @jczornik ,

Thanks for your patience. I'm looking into this and will update you with my findings.

All the best, Ran~

RanVaknin avatar Feb 29 '24 18:02 RanVaknin

Hi @jczornik ,

Do you mind sharing a more complete code sample of both the non current calls that succeeds, and then the concurrent one that fails?

Thanks! Ran~

RanVaknin avatar Mar 08 '24 21:03 RanVaknin

This issue has not received a response in 1 week. If you want to keep this issue open, please just leave a comment below and auto-close will be canceled.

github-actions[bot] avatar Mar 19 '24 00:03 github-actions[bot]