Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

INBOUND_EMAIL_ESP amazon_ses won't work without django-amazon-ses lib #3508

Closed
Lutseslav opened this issue Dec 5, 2023 · 0 comments
Closed
Labels

Comments

@Lutseslav
Copy link
Contributor

What went wrong?

What happened:

  • Django raises an exception when configured to use amazon_ses ESP
2023-12-05 11:10:59 source=engine:app google_trace_id=none logger=apps.social_auth.middlewares SocialAuthAuthCanceledExceptionMiddleware.process_exception: The boto3 package is required to use this ESP, but isn't installed.
(Be sure to use `pip install django-anymail[amazon_ses]` with your desired ESPs.)
2023-12-05 11:10:59 source=engine:app google_trace_id=none logger=django.request Internal Server Error: /integrations/v1/inbound_email_webhook
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
               ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/django/views/decorators/csrf.py", line 56, in wrapper_view
    return view_func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/django/views/generic/base.py", line 104, in view
    return self.dispatch(request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/etc/app/apps/email/inbound.py", line 58, in dispatch
    integration_token = self.get_integration_token_from_request(request)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/etc/app/apps/email/inbound.py", line 79, in get_integration_token_from_request
    messages = self.get_messages_from_esp_request(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/etc/app/apps/email/inbound.py", line 108, in get_messages_from_esp_request
    view = view_class(**kwargs)
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/anymail/webhooks/amazon_ses.py", line 39, in __init__
    self.session_params, self.client_params = _get_anymail_boto3_params(kwargs=kwargs)
                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/anymail/exceptions.py", line 189, in __call__
    raise self._error
anymail.exceptions.AnymailImproperlyInstalled: The boto3 package is required to use this ESP, but isn't installed.
(Be sure to use `pip install django-anymail[amazon_ses]` with your desired ESPs.)

What did you expect to happen:

  • location /integrations/v1/inbound_email_webhook must properly handle SNS subscription request

How do we reproduce it?

  1. Configure Grafana to use amazon_ses as INBOUND_EMAIL_ESP
  2. Send any http request to /integrations/v1/inbound_email_webhook
  3. Open onCall engine logs to see the problem

Grafana OnCall Version

v1.3.64

Product Area

Alert Flow & Configuration

Grafana OnCall Platform?

Kubernetes

User's Browser?

No response

Anything else to add?

Seems that requirements.txt lacks corresponding pip package django-amazon-ses as anymail documentation suggests.

@Lutseslav Lutseslav added the bug Something isn't working label Dec 5, 2023
joeyorlando added a commit that referenced this issue Dec 11, 2023
# What this PR does
Fixes django-anymail[amazon-ses] issues according to [anymail
docs](https://anymail.dev/en/stable/esps/amazon_ses/)

## Which issue(s) this PR fixes
[#3508](#3508)

## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated
- [ ] Documentation added (or `pr:no public docs` PR label added if not
required)
- [ ] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required)

---------

Co-authored-by: Joey Orlando <joey.orlando@grafana.com>
Co-authored-by: Joey Orlando <joseph.t.orlando@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant