Skip to content

cli compiled against golang 1.8.3 cannot download app droplet #1165

Closed
@kkallday

Description

@kkallday

Command

(from cf-acceptance-tests in cf-release 259)

cf curl -i /v2/apps/649e74de-c2a4-45f1-b93f-5d797017f6bc/droplet/download --output droplet.tgz

What occurred

The droplet.tgz file was not a tarball. It was a file that contained the following XML:

<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>SignatureDoesNotMatch</Code><Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message><AWSAccessKeyId>ACCESSKEY</AWSAccessKeyId><StringToSign>GET

application/json
1497493686
/*DROPLET BUCKET*/0f/e8/0fe84d1c-a4f5-4cab-91cb-e084782bfaed/ffdcf5b508ba64897fe28de6f7234b31c40175ad</StringToSign><SignatureProvided>*SOME SIGNATURE*</SignatureProvided><StringToSignBytes>*SOME STRING TO SIGN*</StringToSignBytes><RequestId>* SOME REQUEST ID*</RequestId><HostId>*SOME HOST ID*</HostId></Error>

What you expected to occur

The droplet.tgz file to contain my app bits.

CLI Version

cf version 6.27.0+d26b32dcc.2017-06-08

CC API Endpoint Version

2.82.0

CF Trace

HTTP/1.1 403 Forbidden
Connection: close
Transfer-Encoding: chunked
Content-Type: application/xml
Date: Thu, 15 Jun 2017 23:45:46 GMT
Server: AmazonS3
X-Amz-Id-2: *SOME AMZ ID*
X-Amz-Request-Id: *SOME REQUEST ID*

Platform & Shell Details

Mac OS X and Linux

Any other relevant information

The cf curl reaches the Cloud Controller, which 302 redirects us to the S3 droplet bucket. We were able to successfully download the droplet when we did a normal curl using the same URL that CC redirects cf client to.

We've observed the same issue on Google Cloud. When running tcpdump we noticed that the failing request to Google Cloud Storage had a header of Content-Type: application/json. When we sent the same request without the Content-Type header, we were able to download the droplet.

We believe the root cause is due to a change in net/http (golang/go#19973) in Go 1.8. The client now resends the original request headers when following a redirect.

Thanks,

@acrmp and @kkallday

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions