Closed hongbin-dramancompany closed 9 months ago
Sorry you are running into that - it does sound like potentially a throttling issue with retrieving credentials. Are you providing any client options? What type of credentials are you using? How are you running the async jobs?
I agree with Alex that it's potentially a throttling issue with credentials. You should resolve credentials in your initializer and pass it into the add action mailer delivery method method.
I would also recommend updating your aws-sdk-rails and aws-sdk-ses.
# this would be :ses or :sesv2 in newer aws-sdk-rails versions
credentials = ... # Aws::InstanceProfileCredentials if Ec2, etc
Aws::Rails.add_action_mailer_delivery_method(:aws_sdk, { credentials: credentials, ... } )
Yeah, agree with @mullermp - the easiest way to fix this issue is to create the credentials outside of the delivery method in your initializer. This will ensure a single credentials object is created (and note: the refreshing of those credentials is thread safe).
We are looking at making the options for the mailer include client and defaulting to a single, shared instance of the client, but believe this would be a breaking change that we'd include in a new MV.
Please re-open if there's still issue.
unable to sign request without credentials set
error messageOur system is
config.action_mailer.delivery_method = :aws_sdk
Aws::Rails.add_action_mailer_delivery_method()
and is using sdk as an option.When an error occurs, the system sends a large number of e-mails to up to N users asynchronous jobs. At this point, the above error message occurs (it works well in normal situatxions)
As far as I know, it occurs when the rate limit of authentication is exceeded. Other aws services made aws client singleton, so the problem has been solved. Is there any way to fix that?