1

I've had code deploy configured and working for a few weeks. It's setup so that it goes from our CI server on shippable to code deploy. We deploy like so (in a container):

> pip install awscli aws deploy push --application-name $CD_APP_NAME
> --s3-location s3://$CD_BUCKET/$CD_KEY --ignore-hidden-files aws deploy create-deployment --application-name $CD_APP_NAME --s3-location
> bucket=$CD_BUCKET,key=$CD_KEY,bundleType=zip --deployment-group-name
> $CD_DEPLOYMENT_GROUP

Recently code deploy has started to fail every automatic deployment at the DownloadBundle step with the error:

> The request signature we calculated does not match the signature you
> provided. Check your key and signing method.

I don't think anything configuration-wise on our end has changed since it was working a few days ago.

I've tried reinstalling the code deploy agent and removing the deployment bundles from s3 (to have them recreated by the CI script)

Saqib Ali
  • 11,931
  • 41
  • 133
  • 272

2 Answers2

1

The possible one reason for this the codedeploy-agent version has been updated and you have not specified key and bucket name properly.

Make sure you use only bucket name in bucket option below and in key specify the absolute path of zip(bundle) (i.e if your bundle is inside the directory make sure you specify the directory name in key not in bucket)

aws deploy create-deployment  --application-name xxx-app-dev  --deployment-config-name CodeDeployDefault.OneAtATime   --deployment-group-name xxx-appgroup-dev  --s3-location **bucket=xxx-cd-builds**,bundleType=zip,**key=dev/20150706081741UTC/xxx.zip** --profile aws-dev-codedeploy
rink.attendant.6
  • 44,500
  • 61
  • 101
  • 156
Amit Doshi
  • 11
  • 1
1

Amit's answer was THE EXACT SOLUTION to my problem. Using the Jenkins/CodeDeploy plugin:

https://wiki.jenkins-ci.org/display/JENKINS/AWS+Codedeploy+plugin

was giving me this error because I was mixing up my "bucket" and "prefix" paths. The bucket field must contain the bucket name only.

My buggy config:

  • S3 Bucket: "my-bucket/jenkins"
  • S3 Prefix: "$BUILD_NUMBER"

This would create a usable S3 path, but the etag would be completely wrong.

The correct config:

  • S3 Bucket: "my-bucket"
  • S3 Prefix: "jenkins/$BUILD_NUMBER"

A HUGE HIGH FIVE to Amit Doshi. You rock, dude.