aws-ses icon indicating copy to clipboard operation
aws-ses copied to clipboard

IncompleteSignature with lastest version 0.7.1

Open dcomihual opened this issue 4 years ago • 21 comments

I upgraded the gem to the last release, and now when I send an email I receive this error message.

IncompleteSignature - Request must contain a signature that conforms to AWS standards

/.rvm/gems/ruby-2.3.3/gems/aws-ses-0.7.1/lib/aws/ses/base.rb:190:in `request'"

dcomihual avatar Sep 30 '20 20:09 dcomihual

Same here. Reverted to 0.7.0 but I guess there the signing isn't working correctly.

rickpastoor avatar Oct 05 '20 12:10 rickpastoor

Same issue here. 0.7.0 works fine.

crazyoptimist avatar Oct 30 '20 00:10 crazyoptimist

@drewblas I have reworked a little sigv4 generation. Now it works well...

svmax avatar Nov 02 '20 09:11 svmax

PR is here ^^^

svmax avatar Nov 02 '20 09:11 svmax

@drewblas Could you check and make new release tag?

svmax avatar Nov 02 '20 09:11 svmax

Nice work @svmax I'd rather recommend not to run lint IMHO. Because your lint config is different from the author's one, which makes it a little bit difficult to review only real changes in the PR.

crazyoptimist avatar Nov 02 '20 15:11 crazyoptimist

@CrazyOptimist yeah, well let's turn back a whitespace batch))

svmax avatar Nov 02 '20 18:11 svmax

So, gentlemen (@CrazyOptimist @drewblas), where we are and what was done: Efficient AWS SES sigv4 generation based on given payload; changed delivery service on canonical (which is used by aws-core); request method has been redesigned to allow headers and payload to be signed during encryption + changed helper methods for sigv4 generation.

I hope this is more than enough to allow this feature to be merged and placed as a release tag

svmax avatar Nov 03 '20 06:11 svmax

Gentlemen, do you happen to have an update on this? I'd love to move to the new signature version.

rickpastoor avatar Nov 16 '20 09:11 rickpastoor

Tried @svmax PR #79 - seems to work now without the error! Hopefully the AWS warning emails will come to an end now.

For reference for other interested parties:

  • I've added signature_version 4 to the credentials:
 ActionMailer::Base.add_delivery_method :ses, AWS::SES::Base, secrets...ses_credentials.merge(signature_version: 4)

And referenced the fork as a Gem:

# TODO: https://github.com/drewblas/aws-ses/pull/79
gem "aws-ses", git: "https://github.com/zebitex/aws-ses.git", ref: "78-sigv4-problem"

Until version >= 0.7.2 will be released.

zealot128 avatar Jan 13 '21 17:01 zealot128

Any updates on this? It seems V3 signature will be turned off on Feb 28.

Xtinct avatar Feb 25 '21 22:02 Xtinct

@drewblas Could you merge and publish the patch? Or grant maintenance permission to someone else? I'm waiting for this patch!

crazyoptimist avatar Feb 26 '21 03:02 crazyoptimist

I am also waiting for this patch, would appreciate the new version getting published

toddnestor avatar Mar 03 '21 22:03 toddnestor

@drewblas I am facing the same issue. Any updates on when this will be merged?

eni9889 avatar Mar 30 '21 02:03 eni9889

And referenced the fork as a Gem:

TODO: https://github.com/drewblas/aws-ses/pull/79

gem "aws-ses", git: "https://github.com/zebitex/aws-ses.git", ref: "78-sigv4-problem" Until version >= 0.7.2 will be released.

In case you missed this. @eni9889

crazyoptimist avatar Mar 30 '21 02:03 crazyoptimist

Thank you @svmax for the fix and @CrazyOptimist for showing how to reference the PR.

I hate to say it folks, but @drewblas appears to be MIA. I can't find any activity since November, five months ago.

I decided to go ahead and switch to the official aws-sdk-rails gem instead of waiting to see how this turns out. Using it was as simple as this gem, the initializer file was just:

creds = Aws::Credentials.new(ENV['RAILS_SES_ACCESS_KEY_ID'], ENV['RAILS_SES_SECRET_ACCESS_KEY'])

Aws::Rails.add_action_mailer_delivery_method(
  :ses,
  credentials: creds,
  region: 'us-east-1'
)

The aws-sdk-rails is a just a wrapper for the ruby SDK, which is using v4 signatures by default, as verified when we deployed the gem change to production today.

dnalbach avatar Mar 31 '21 17:03 dnalbach

Thanks a lot, @dnalbach that worked for me as well.

geronimo-dlm avatar Mar 31 '21 20:03 geronimo-dlm

Thank you @svmax for the fix and @CrazyOptimist for showing how to reference the PR.

I hate to say it folks, but @drewblas appears to be MIA. I can't find any activity since November, five months ago.

I decided to go ahead and switch to the official aws-sdk-rails gem instead of waiting to see how this turns out. Using it was as simple as this gem, the initializer file was just:

creds = Aws::Credentials.new(ENV['RAILS_SES_ACCESS_KEY_ID'], ENV['RAILS_SES_SECRET_ACCESS_KEY'])

Aws::Rails.add_action_mailer_delivery_method(
  :ses,
  credentials: creds,
  region: 'us-east-1'
)

The aws-sdk-rails is a just a wrapper for the ruby SDK, which is using v4 signatures by default, as verified when we deployed the gem change to production today.

@dnalbach

I am also using this aws-sdk-rails for sending mail but still getting below error :

~/.rvm/gems/ruby-2.4.9/gems/aws-sdk-dynamodb-1.16.0/lib/aws-sdk-dynamodb/client_api.rb:1110:in block in module:ClientApi': undefined method endpoint_operation=' for #<Seahorse::Model::Api> (NoMethodError)

I am using below versions : Ruby : 2.4.1 Rails: 5.2.0 and aws-sdk-rails 3.6.0

Do you have any idea why this error occurs. If you need more information I can give you.

Thanks in advanced

Gauravbtc avatar Apr 01 '21 11:04 Gauravbtc

@dnalbach

I am also using this aws-sdk-rails for sending mail but still getting below error :

~/.rvm/gems/ruby-2.4.9/gems/aws-sdk-dynamodb-1.16.0/lib/aws-sdk-dynamodb/client_api.rb:1110:in block in module:ClientApi': undefined method endpoint_operation=' for #<Seahorse::Model::Api> (NoMethodError)

I am using below versions : Ruby : 2.4.1 Rails: 5.2.0 and aws-sdk-rails 3.6.0

Do you have any idea why this error occurs. If you need more information I can give you.

Thanks in advanced

I'm, sorry, I do not. I can tell you that we are using the following versions and are not experiencing that error:

  • Ruby 2.6.3
  • Rails 5.2.5
  • aws-sdk-rails 3.6.0

We do not use DynamoDB in Rails and have no configuration for it.

I did a quick Google search and see an old issue for that in the aws-sdk-ruby, which is what the aws-sdk-rails wraps, that was resolved many years ago: https://github.com/aws/aws-sdk-ruby/issues/1033

Obviously there is a difference between your Rails instance and ours. It does seem odd that your error is for a Ruby 2.4.9 gem when you are using 2.4.1 according to your post. You might try updating the patch version of your Ruby to latest 2.4.10 and see if that makes a difference.

If you were on the same version of Ruby and Rails and still getting it, we'd know it was configuration, but it would be pretty hard to pin down the specific config differences.

My advice would be to file an issue in either the aws-sdk-rails or aws-sdk-ruby Github projects. Both are very active projects, with the ruby one being extremely active.

dnalbach avatar Apr 01 '21 16:04 dnalbach

@drewblas is lurking, but active.

image

I am preparing to deploy 0.7.1 on production, because it seems we are loosing mails, because of Amazon "progressive rejection". If that fails, I will be upset. Not with @drewblas, but with Amazon not being able to compensate to @drewblas the hours he spent on supporting Amazon clients.

abitrolly avatar Apr 13 '21 06:04 abitrolly

Got the same error, and switched to aws-sdk-ruby https://github.com/drewblas/aws-ses/issues/78#issuecomment-811270479 thanks everyone who helped to solve this.

abitrolly avatar Apr 14 '21 16:04 abitrolly