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 PUT Copy fails with go 1.8 #1058

Closed
leelynne opened this issue Jan 26, 2017 · 3 comments
Closed

S3 PUT Copy fails with go 1.8 #1058

leelynne opened this issue Jan 26, 2017 · 3 comments

Comments

@leelynne
Copy link

The aws sdk doesn't add Content-Length to the S3 Copy request with go 1.8rc2 and instead the request ends up with Transfer-Encoding: chunked. Debug outputs are below.
Code is a simple copy object command.

	r := &s3.CopyObjectInput{
		Bucket:      &mybucket,
		CopySource:  &src,
		Key: aws.String(destKey),
	}
	_, err := s3serv.CopyObject(r)

With go 1.7:

2017/01/25 21:10:06 DEBUG: Request s3/CopyObject Details:
---[ REQUEST POST-SIGN ]-----------------------------
PUT http://mybucket/data.tar.gz HTTP/1.1
Host: mybucket.s3-us-west-2.amazonaws.com
User-Agent: aws-sdk-go/1.5.1 (go1.7.4; linux; amd64)
Content-Length: 0
Authorization:
X-Amz-Content-Sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
X-Amz-Copy-Source: mybucket/other-location.tar.gz
X-Amz-Copy-Source-If-Unmodified-Since: Mon, 1 Jan 0001 00:00:00 GMT
X-Amz-Date: 20170126T051006Z
Accept-Encoding: gzip


2017/01/25 21:10:06 DEBUG: Response s3/CopyObject Details:
---[ RESPONSE ]--------------------------------------
HTTP/1.1 200 OK
Content-Length: 234
Content-Type: application/xml
Date: Thu, 26 Jan 2017 05:10:07 GMT
Server: AmazonS3
X-Amz-Copy-Source-Version-Id: C_UCKAsstrExUE8hKljK5D9N4M6UXiX2
X-Amz-Id-2: Z78nqBvr1zM984vtwumQc37iY8JCGMggVd9qBxFjWyTAzL4aU/XOM9H2NEB24E0sODbj64mK/6Q=
X-Amz-Request-Id: 148EBBAD670CC82B
X-Amz-Version-Id: 1q4Ul_wDggg0vCWRWUay5uKFN_NI1bbK

With Go 1.8rc2:


2017/01/25 21:48:00 DEBUG: Request s3/CopyObject Details:
---[ REQUEST POST-SIGN ]-----------------------------
PUT http://mybucket/data.tar.gz HTTP/1.1
Host: mybucket.s3-us-west-2.amazonaws.com
User-Agent: aws-sdk-go/1.5.1 (go1.8rc2; linux; amd64)
Transfer-Encoding: chunked
Authorization:
X-Amz-Content-Sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
X-Amz-Copy-Source: mybucket/other-location.tar.gz
X-Amz-Copy-Source-If-Unmodified-Since: Mon, 1 Jan 0001 00:00:00 GMT
X-Amz-Date: 20170126T054800Z
Accept-Encoding: gzip

0


2017/01/25 21:48:00 DEBUG: Response s3/CopyObject Details:
---[ RESPONSE ]--------------------------------------
HTTP/1.1 501 Not Implemented
Connection: close
Transfer-Encoding: chunked
Content-Type: application/xml
Date: Thu, 26 Jan 2017 05:48:00 GMT
Server: AmazonS3
X-Amz-Id-2: PmFzE/jxEVlQl2n99ICLen8XEfRxReghKAGxCu9igla2relsdftkO1jEdvt9/2cv2mfixRipV1E=
X-Amz-Request-Id: 3349C414B772F2C0

126
<Error><Code>NotImplemented</Code><Message>A header you provided implies functionality that is not implemented</Message><Header>Transfer-Encoding</Header><RequestId>3349C414B772F2C0</RequestId><HostId>PmFzE/jxEVlQl2n99ICLen8XEfRxReghKAGxCu9igla2relsdftkO1jEdvt9/2cv2mfixRipV1E=</HostId></Error>
0

@xibz
Copy link
Contributor

xibz commented Jan 26, 2017

Hello @leelynne, thank you for reaching out to us. We've addressed this issue in the later versions of the SDK, #991. Can you update and see if that fixes the problem?

@leelynne
Copy link
Author

Ugh, my apologies. I thought I was on the latest version but actually had it locked on 1.5.1. All good. Thanks!

@xibz
Copy link
Contributor

xibz commented Jan 26, 2017

@leelynne no worries. If you run into any other issues, please let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants