Closed technolingo closed 1 year ago
Thanks for the report, and for including the whole stack trace (which was essential to figure out what's going on here).
This seems to be a combination of some problems in your code or environment, plus an Anymail bug that results in misleading error messages.
First, the problems on your end:
mail_admins
to let you know about the problem. But Anymail was unable to successfully create a boto3 sesv2 client to send that mail. The most likely explanation is boto3 can't find the necessary credentials, though there could be other causes. (Have you successfully sent any email from this server?)Django logging sends the email with fail_silently=True
, so the correct behavior would be for Anymail to just ignore the configuration problems and not send any email. (And then you would hopefully discover problem 1 above in your log files.)
The Anymail bug is in the SESv2 backend: it should not be trying to post_to_esp if boto3 client creation failed and fail_silently is enabled. The "boto3 sesv2 client does not have method" error message is misleading: the actual problem is there is no client, and we should just ignore that if asked to fail_silently.
I'll fix the Anymail bug. In the meantime, I'd suggest either fixing your server settings so that Anymail is able to successfully send email through SES, or removing mail_admins
from your Django logging config (if you don't want to receive email about errors).
Hi @medmunds ,
Thank you very much for your prompt and detailed response! Indeed, I had misconfigured the boto3 environment variables. Now the issue is resolved.
Best
Reporting an error? It's helpful to know:
Anymail version:
django-anymail[amazon_ses]==9.1
ESP:
SES
Your ANYMAIL settings
Versions of Django, requests, python
Exact error message and/or stack trace
Any other relevant code and settings (e.g., for problems sending, your code that sends the message) None