dpl: S3 deploy errors with SignatureDoesNotMatch
Since Sept 1 our upload to S3 from https://github.com/rebar/rebar3 has begun to fail with SignatureDoesNotMatch error. Failed job can be viewed here https://travis-ci.org/rebar/rebar3/jobs/79769044 and the travis.yml file here: https://github.com/rebar/rebar3/blob/master/.travis.yml
/home/travis/.rvm/gems/ruby-1.9.3-p551/gems/aws-sdk-core-2.1.20/lib/seahorse/client/plugins/raise_response_errors.rb:15:in `call': The request signature we calculated does not match the signature you provided. Check your key and signing method. (Aws::S3::Errors::SignatureDoesNotMatch)
from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/aws-sdk-core-2.1.20/lib/aws-sdk-core/plugins/s3_sse_cpk.rb:18:in `call'
from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/aws-sdk-core-2.1.20/lib/aws-sdk-core/plugins/param_converter.rb:21:in `call'
from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/aws-sdk-core-2.1.20/lib/seahorse/client/plugins/response_target.rb:21:in `call'
from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/aws-sdk-core-2.1.20/lib/seahorse/client/request.rb:70:in `send_request'
from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/aws-sdk-core-2.1.20/lib/seahorse/client/base.rb:207:in `block (2 levels) in define_operation_methods'
from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/aws-sdk-resources-2.1.20/lib/aws-sdk-resources/services/s3/file_uploader.rb:42:in `block in put_object'
from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/aws-sdk-resources-2.1.20/lib/aws-sdk-resources/services/s3/file_uploader.rb:49:in `open_file'
from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/aws-sdk-resources-2.1.20/lib/aws-sdk-resources/services/s3/file_uploader.rb:41:in `put_object'
from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/aws-sdk-resources-2.1.20/lib/aws-sdk-resources/services/s3/file_uploader.rb:34:in `upload'
from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/aws-sdk-resources-2.1.20/lib/aws-sdk-resources/services/s3/object.rb:210:in `upload_file'
from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/dpl-1.8.2/lib/dpl/provider/s3.rb:56:in `block (2 levels) in push_app'
from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/dpl-1.8.2/lib/dpl/provider/s3.rb:48:in `glob'
from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/dpl-1.8.2/lib/dpl/provider/s3.rb:48:in `block in push_app'
from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/dpl-1.8.2/lib/dpl/provider/s3.rb:47:in `chdir'
from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/dpl-1.8.2/lib/dpl/provider/s3.rb:47:in `push_app'
from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/dpl-1.8.2/lib/dpl/provider.rb:143:in `block in deploy'
from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/dpl-1.8.2/lib/dpl/cli.rb:41:in `fold'
from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/dpl-1.8.2/lib/dpl/provider.rb:143:in `deploy'
from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/dpl-1.8.2/lib/dpl/provider/s3.rb:73:in `deploy'
from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/dpl-1.8.2/lib/dpl/cli.rb:32:in `run'
from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/dpl-1.8.2/lib/dpl/cli.rb:7:in `run'
from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/dpl-1.8.2/bin/dpl:5:in `<top (required)>'
from /home/travis/.rvm/gems/ruby-1.9.3-p551/bin/dpl:23:in `load'
from /home/travis/.rvm/gems/ruby-1.9.3-p551/bin/dpl:23:in `<main>'
failed to deploy
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 72 (21 by maintainers)
Commits related to this issue
- Add S3V1 provider Reinstate S3 provider in its state as of v1.7.22 Some users report upload problems such as https://github.com/travis-ci/travis-ci/issues/4776, so we provide a way to upload with an... — committed to travis-ci/dpl by BanzaiMan 9 years ago
- update travis for s3 — committed to erlang/rebar3 by tsloughter 9 years ago
- wtf trying https://github.com/travis-ci/travis-ci/issues/4776#issuecomment-24493953 4 — committed to hyperaudio/hyperaudio-dashboard by Laurian 7 years ago
- Tweaking Travis CI to fix deployment errors Receiving [errors](https://travis-ci.org/Chicago/lead-safe-api-docs/builds/362190239) when Travis CI is attempting to deploy the site to S3. Using [a recom... — committed to Chicago/lead-safe-api-docs by tomschenkjr 6 years ago
- Downgrade aws-sdk for #42 According to [this thread](https://github.com/travis-ci/travis-ci/issues/4776#issuecomment-180847210), `aws-sdk 2.1.36` had avoided the issue noted in #42. Prior builds were... — committed to Chicago/lead-safe-api-docs by tomschenkjr 6 years ago
- Fixed using https://github.com/travis-ci/travis-ci/issues/4776 — committed to InnovativeInventor/boxes by InnovativeInventor 6 years ago
I think this may be a compound issue depending on your setup, with AWS with no fix-all solution.
We had this issue building for both iOS and Android. It was building our Android build a week ago fine.
We had tried changing the version of the AWS SDK and it always fell through to the backwards compatibility v1 of the SDK which then failed.
We did get it working by encrypting the keys using:
travis encrypt XXXXXXXXXXXXXXX --add deploy.secret_access_keyinstead of:
travis encrypt secret_access_key=XXXXXXXXXXXX --add deploy.secret_access_keyFinally solved this problem for my deploy.
Had to do this:
travis encrypt XXXXXXXXXXXXXXXinstead of:
travis encrypt secret_access_key=XXXXXXXXXXXXThis is different to what the documentation says:
https://docs.travis-ci.com/user/environment-variables/#encrypting-environment-variables
Ah, I stumbled across this problem and spent hours with no progress at all…
I found one advise in #602: if the generated secret key contains “+” or “/” characters, this error will occur. Simply regenerating keys should have solved it, but it didn’t.
In the end I added the keys as env variables directly in Travis. This was the only way that worked.
I finally got it to work. I did a bunch of stuff but in my case I think it might have been user error. I deleted and re-gen’ed all my keys and moved the repo from private to public, but still no luck. The trick was
travis encrypt --add deploy.secret_access_key!=travis encrypt secret_access_key=secretvalue+ copy. I had setup a similar deploy several months back so looking at that file I just googledtravis secureand was taken to http://docs.travis-ci.com/user/encryption-keys/, to which I was like, this is what I must have done to generate thesecure:field since I couldn’t remember. When I ran thetravis encryptcommand it prints out something that looks like I must have copied into the deploy section of the other script so I just replaced the secure section. I randomly ran across http://docs.travis-ci.com/user/deployment/s3/ which gave me the correct encrypt command.A better error from travis would be nice, or maybe some validation check with
travis lintwhich said everything was fine.I ran into this problem. Below is my fix. Hopefully you too can save ~45 minutes of your time.
What ended up working for me was to generate a new access key without a “+” character in it. Then I went into my repository settings in the travis web UI and added an environment variable with my access key. I ended up hardcoding the key ID into my .travis.yml file.
Here is the deploy section of my .travis.yml file:
this works for us:
In my case I got it working setting the two environment variables in travis for my repository:
AWS_ACCESS_KEY_IDandAWS_SECRET_ACCESS_KEY. and this is how my.travis.xmlfile looks like: