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

Bug: Sendgrid Email Notification Webhook not working #2600

Open
inohan opened this issue Feb 14, 2025 · 0 comments · May be fixed by #2601
Open

Bug: Sendgrid Email Notification Webhook not working #2600

inohan opened this issue Feb 14, 2025 · 0 comments · May be fixed by #2601

Comments

@inohan
Copy link

inohan commented Feb 14, 2025

Version: Calicotab ver. 2.9.2 running on Heroku

There seems to be a bug with the email notification webhook on Sendgrid. I've replaced the Email Status Secret Key with (EMAIL_STATUS_SECRET_KEY) and the URL (domain name) with (HOSTNAME).

2025-02-14T02:48:13.733027+00:00 app[web.1]: 02:48:13 wsgi.1  | [2025-02-14 11:48:13,732] ERROR django.request: Internal Server Error: /_/admin/notifications/event-webhook/(EMAIL_STATUS_SECRET_KEY)
2025-02-14T02:48:13.733086+00:00 app[web.1]: 02:48:13 wsgi.1  | Traceback (most recent call last):
2025-02-14T02:48:13.733138+00:00 app[web.1]: 02:48:13 wsgi.1  |   File "/app/.heroku/python/lib/python3.11/site-packages/django/core/handlers/exception.py", line 55, in inner
2025-02-14T02:48:13.733166+00:00 app[web.1]: 02:48:13 wsgi.1  |     response = get_response(request)
2025-02-14T02:48:13.733201+00:00 app[web.1]: 02:48:13 wsgi.1  |                ^^^^^^^^^^^^^^^^^^^^^
2025-02-14T02:48:13.733234+00:00 app[web.1]: 02:48:13 wsgi.1  |   File "/app/.heroku/python/lib/python3.11/site-packages/django/core/handlers/base.py", line 197, in _get_response
2025-02-14T02:48:13.733267+00:00 app[web.1]: 02:48:13 wsgi.1  |     response = wrapped_callback(request, *callback_args, **callback_kwargs)
2025-02-14T02:48:13.733307+00:00 app[web.1]: 02:48:13 wsgi.1  |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-02-14T02:48:13.733331+00:00 app[web.1]: 02:48:13 wsgi.1  |   File "/app/.heroku/python/lib/python3.11/site-packages/sentry_sdk/integrations/django/views.py", line 84, in sentry_wrapped_callback
2025-02-14T02:48:13.733364+00:00 app[web.1]: 02:48:13 wsgi.1  |     return callback(request, *args, **kwargs)
2025-02-14T02:48:13.733387+00:00 app[web.1]: 02:48:13 wsgi.1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-02-14T02:48:13.733420+00:00 app[web.1]: 02:48:13 wsgi.1  |   File "/app/.heroku/python/lib/python3.11/site-packages/django/views/generic/base.py", line 104, in view
2025-02-14T02:48:13.733468+00:00 app[web.1]: 02:48:13 wsgi.1  |     return self.dispatch(request, *args, **kwargs)
2025-02-14T02:48:13.733505+00:00 app[web.1]: 02:48:13 wsgi.1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-02-14T02:48:13.733546+00:00 app[web.1]: 02:48:13 wsgi.1  |   File "/app/tabbycat/tournaments/mixins.py", line 126, in dispatch
2025-02-14T02:48:13.733583+00:00 app[web.1]: 02:48:13 wsgi.1  |     return super().dispatch(request, *args, **kwargs)
2025-02-14T02:48:13.733611+00:00 app[web.1]: 02:48:13 wsgi.1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-02-14T02:48:13.733638+00:00 app[web.1]: 02:48:13 wsgi.1  |   File "/app/.heroku/python/lib/python3.11/site-packages/django/views/generic/base.py", line 143, in dispatch
2025-02-14T02:48:13.733665+00:00 app[web.1]: 02:48:13 wsgi.1  |     return handler(request, *args, **kwargs)
2025-02-14T02:48:13.733692+00:00 app[web.1]: 02:48:13 wsgi.1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-02-14T02:48:13.733718+00:00 app[web.1]: 02:48:13 wsgi.1  |   File "/app/tabbycat/notifications/views.py", line 200, in post
2025-02-14T02:48:13.733744+00:00 app[web.1]: 02:48:13 wsgi.1  |     timestamp = timezone.make_aware(dt, datetime.timezone.utc)
2025-02-14T02:48:13.733769+00:00 app[web.1]: 02:48:13 wsgi.1  |                                         ^^^^^^^^^^^^^^^^^
2025-02-14T02:48:13.733794+00:00 app[web.1]: 02:48:13 wsgi.1  | AttributeError: type object 'datetime.datetime' has no attribute 'timezone'
2025-02-14T02:48:13.733819+00:00 app[web.1]: 02:48:13 wsgi.1  | 2025-02-14 11:48:13,732 - django.request - ERROR - Internal Server Error: /_/admin/notifications/event-webhook/(EMAIL_STATUS_SECRET_KEY)
2025-02-14T02:48:13.733844+00:00 app[web.1]: 02:48:13 wsgi.1  | Traceback (most recent call last):
2025-02-14T02:48:13.733869+00:00 app[web.1]: 02:48:13 wsgi.1  |   File "/app/.heroku/python/lib/python3.11/site-packages/django/core/handlers/exception.py", line 55, in inner
2025-02-14T02:48:13.733894+00:00 app[web.1]: 02:48:13 wsgi.1  |     response = get_response(request)
2025-02-14T02:48:13.733918+00:00 app[web.1]: 02:48:13 wsgi.1  |                ^^^^^^^^^^^^^^^^^^^^^
2025-02-14T02:48:13.733947+00:00 app[web.1]: 02:48:13 wsgi.1  |   File "/app/.heroku/python/lib/python3.11/site-packages/django/core/handlers/base.py", line 197, in _get_response
2025-02-14T02:48:13.733985+00:00 app[web.1]: 02:48:13 wsgi.1  |     response = wrapped_callback(request, *callback_args, **callback_kwargs)
2025-02-14T02:48:13.734022+00:00 app[web.1]: 02:48:13 wsgi.1  |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-02-14T02:48:13.734077+00:00 app[web.1]: 02:48:13 wsgi.1  |   File "/app/.heroku/python/lib/python3.11/site-packages/sentry_sdk/integrations/django/views.py", line 84, in sentry_wrapped_callback
2025-02-14T02:48:13.734097+00:00 app[web.1]: 02:48:13 wsgi.1  |     return callback(request, *args, **kwargs)
2025-02-14T02:48:13.734130+00:00 app[web.1]: 02:48:13 wsgi.1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-02-14T02:48:13.734164+00:00 app[web.1]: 02:48:13 wsgi.1  |   File "/app/.heroku/python/lib/python3.11/site-packages/django/views/generic/base.py", line 104, in view
2025-02-14T02:48:13.734206+00:00 app[web.1]: 02:48:13 wsgi.1  |     return self.dispatch(request, *args, **kwargs)
2025-02-14T02:48:13.734230+00:00 app[web.1]: 02:48:13 wsgi.1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-02-14T02:48:13.734254+00:00 app[web.1]: 02:48:13 wsgi.1  |   File "/app/tabbycat/tournaments/mixins.py", line 126, in dispatch
2025-02-14T02:48:13.734279+00:00 app[web.1]: 02:48:13 wsgi.1  |     return super().dispatch(request, *args, **kwargs)
2025-02-14T02:48:13.734304+00:00 app[web.1]: 02:48:13 wsgi.1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-02-14T02:48:13.734329+00:00 app[web.1]: 02:48:13 wsgi.1  |   File "/app/.heroku/python/lib/python3.11/site-packages/django/views/generic/base.py", line 143, in dispatch
2025-02-14T02:48:13.734353+00:00 app[web.1]: 02:48:13 wsgi.1  |     return handler(request, *args, **kwargs)
2025-02-14T02:48:13.734379+00:00 app[web.1]: 02:48:13 wsgi.1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-02-14T02:48:13.734411+00:00 app[web.1]: 02:48:13 wsgi.1  |   File "/app/tabbycat/notifications/views.py", line 200, in post
2025-02-14T02:48:13.734441+00:00 app[web.1]: 02:48:13 wsgi.1  |     timestamp = timezone.make_aware(dt, datetime.timezone.utc)
2025-02-14T02:48:13.734466+00:00 app[web.1]: 02:48:13 wsgi.1  |                                         ^^^^^^^^^^^^^^^^^
2025-02-14T02:48:13.734491+00:00 app[web.1]: 02:48:13 wsgi.1  | AttributeError: type object 'datetime.datetime' has no attribute 'timezone'
2025-02-14T02:48:13.734515+00:00 app[web.1]: 02:48:13 wsgi.1  |  - - [14/Feb/2025:11:48:13 +0900] "POST /_/admin/notifications/event-webhook/(EMAIL_STATUS_SECRET_KEY) HTTP/1.0" 500 3775 "-" "SendGrid Event API"
2025-02-14T02:48:13.734541+00:00 app[web.1]: 02:48:13 nginx.1 | measure#nginx.service=0.046 request_id=06db6166-c636-1e32-e434-f8c6df8608cd
2025-02-14T02:48:13.739160+00:00 app[web.1]: 02:48:13 wsgi.1  | 2025-02-14 11:48:13,738 - urllib3.connectionpool - DEBUG - https://o85113.ingest.sentry.io:443 "POST /api/185382/envelope/ HTTP/1.1" 200 0
2025-02-14T02:48:14.871385+00:00 heroku[router]: at=info method=POST path="/_/admin/notifications/event-webhook/(EMAIL_STATUS_SECRET_KEY)" host=(HOSTNAME).herokuapp.com request_id=b82b6aae-e767-ab13-c515-3af873c4a00d fwd="167.89.117.65" dyno=web.1 connect=0ms service=41ms status=500 bytes=3711 protocol=http1.1 tls=true tls_version=unknown
2025-02-14T02:48:14.870209+00:00 app[web.1]: 02:48:14 wsgi.1  | [2025-02-14 11:48:14,869] ERROR django.request: Internal Server Error: /_/admin/notifications/event-webhook/(EMAIL_STATUS_SECRET_KEY)
2025-02-14T02:48:14.870275+00:00 app[web.1]: 02:48:14 wsgi.1  | Traceback (most recent call last):
2025-02-14T02:48:14.870325+00:00 app[web.1]: 02:48:14 wsgi.1  |   File "/app/.heroku/python/lib/python3.11/site-packages/django/core/handlers/exception.py", line 55, in inner
2025-02-14T02:48:14.870375+00:00 app[web.1]: 02:48:14 wsgi.1  |     response = get_response(request)
2025-02-14T02:48:14.870422+00:00 app[web.1]: 02:48:14 wsgi.1  |                ^^^^^^^^^^^^^^^^^^^^^
2025-02-14T02:48:14.870470+00:00 app[web.1]: 02:48:14 wsgi.1  |   File "/app/.heroku/python/lib/python3.11/site-packages/django/core/handlers/base.py", line 197, in _get_response
2025-02-14T02:48:14.870514+00:00 app[web.1]: 02:48:14 wsgi.1  |     response = wrapped_callback(request, *callback_args, **callback_kwargs)
2025-02-14T02:48:14.870552+00:00 app[web.1]: 02:48:14 wsgi.1  |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-02-14T02:48:14.870589+00:00 app[web.1]: 02:48:14 wsgi.1  |   File "/app/.heroku/python/lib/python3.11/site-packages/sentry_sdk/integrations/django/views.py", line 84, in sentry_wrapped_callback
2025-02-14T02:48:14.870625+00:00 app[web.1]: 02:48:14 wsgi.1  |     return callback(request, *args, **kwargs)
2025-02-14T02:48:14.870660+00:00 app[web.1]: 02:48:14 wsgi.1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-02-14T02:48:14.870698+00:00 app[web.1]: 02:48:14 wsgi.1  |   File "/app/.heroku/python/lib/python3.11/site-packages/django/views/generic/base.py", line 104, in view
2025-02-14T02:48:14.870733+00:00 app[web.1]: 02:48:14 wsgi.1  |     return self.dispatch(request, *args, **kwargs)
2025-02-14T02:48:14.870766+00:00 app[web.1]: 02:48:14 wsgi.1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-02-14T02:48:14.870800+00:00 app[web.1]: 02:48:14 wsgi.1  |   File "/app/tabbycat/tournaments/mixins.py", line 126, in dispatch
2025-02-14T02:48:14.870837+00:00 app[web.1]: 02:48:14 wsgi.1  |     return super().dispatch(request, *args, **kwargs)
2025-02-14T02:48:14.870880+00:00 app[web.1]: 02:48:14 wsgi.1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-02-14T02:48:14.870923+00:00 app[web.1]: 02:48:14 wsgi.1  |   File "/app/.heroku/python/lib/python3.11/site-packages/django/views/generic/base.py", line 143, in dispatch
2025-02-14T02:48:14.870965+00:00 app[web.1]: 02:48:14 wsgi.1  |     return handler(request, *args, **kwargs)
2025-02-14T02:48:14.871007+00:00 app[web.1]: 02:48:14 wsgi.1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-02-14T02:48:14.871050+00:00 app[web.1]: 02:48:14 wsgi.1  |   File "/app/tabbycat/notifications/views.py", line 200, in post
2025-02-14T02:48:14.871094+00:00 app[web.1]: 02:48:14 wsgi.1  |     timestamp = timezone.make_aware(dt, datetime.timezone.utc)
2025-02-14T02:48:14.871137+00:00 app[web.1]: 02:48:14 wsgi.1  |                                         ^^^^^^^^^^^^^^^^^
2025-02-14T02:48:14.871178+00:00 app[web.1]: 02:48:14 wsgi.1  | AttributeError: type object 'datetime.datetime' has no attribute 'timezone'
2025-02-14T02:48:14.871220+00:00 app[web.1]: 02:48:14 wsgi.1  | 2025-02-14 11:48:14,869 - django.request - ERROR - Internal Server Error: /_/admin/notifications/event-webhook/(EMAIL_STATUS_SECRET_KEY)
2025-02-14T02:48:14.871263+00:00 app[web.1]: 02:48:14 wsgi.1  | Traceback (most recent call last):
2025-02-14T02:48:14.871306+00:00 app[web.1]: 02:48:14 wsgi.1  |   File "/app/.heroku/python/lib/python3.11/site-packages/django/core/handlers/exception.py", line 55, in inner
2025-02-14T02:48:14.871349+00:00 app[web.1]: 02:48:14 wsgi.1  |     response = get_response(request)
2025-02-14T02:48:14.871390+00:00 app[web.1]: 02:48:14 wsgi.1  |                ^^^^^^^^^^^^^^^^^^^^^
2025-02-14T02:48:14.871434+00:00 app[web.1]: 02:48:14 wsgi.1  |   File "/app/.heroku/python/lib/python3.11/site-packages/django/core/handlers/base.py", line 197, in _get_response
2025-02-14T02:48:14.871478+00:00 app[web.1]: 02:48:14 wsgi.1  |     response = wrapped_callback(request, *callback_args, **callback_kwargs)
2025-02-14T02:48:14.871515+00:00 app[web.1]: 02:48:14 wsgi.1  |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-02-14T02:48:14.871554+00:00 app[web.1]: 02:48:14 wsgi.1  |   File "/app/.heroku/python/lib/python3.11/site-packages/sentry_sdk/integrations/django/views.py", line 84, in sentry_wrapped_callback
2025-02-14T02:48:14.871594+00:00 app[web.1]: 02:48:14 wsgi.1  |     return callback(request, *args, **kwargs)
2025-02-14T02:48:14.871646+00:00 app[web.1]: 02:48:14 wsgi.1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-02-14T02:48:14.871682+00:00 app[web.1]: 02:48:14 wsgi.1  |   File "/app/.heroku/python/lib/python3.11/site-packages/django/views/generic/base.py", line 104, in view
2025-02-14T02:48:14.871727+00:00 app[web.1]: 02:48:14 wsgi.1  |     return self.dispatch(request, *args, **kwargs)
2025-02-14T02:48:14.871769+00:00 app[web.1]: 02:48:14 wsgi.1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-02-14T02:48:14.871809+00:00 app[web.1]: 02:48:14 wsgi.1  |   File "/app/tabbycat/tournaments/mixins.py", line 126, in dispatch
2025-02-14T02:48:14.871838+00:00 app[web.1]: 02:48:14 wsgi.1  |     return super().dispatch(request, *args, **kwargs)
2025-02-14T02:48:14.871865+00:00 app[web.1]: 02:48:14 wsgi.1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-02-14T02:48:14.871891+00:00 app[web.1]: 02:48:14 wsgi.1  |   File "/app/.heroku/python/lib/python3.11/site-packages/django/views/generic/base.py", line 143, in dispatch
2025-02-14T02:48:14.871916+00:00 app[web.1]: 02:48:14 wsgi.1  |     return handler(request, *args, **kwargs)
2025-02-14T02:48:14.871944+00:00 app[web.1]: 02:48:14 wsgi.1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-02-14T02:48:14.871982+00:00 app[web.1]: 02:48:14 wsgi.1  |   File "/app/tabbycat/notifications/views.py", line 200, in post
2025-02-14T02:48:14.871997+00:00 app[web.1]: 02:48:14 wsgi.1  |     timestamp = timezone.make_aware(dt, datetime.timezone.utc)
2025-02-14T02:48:14.872021+00:00 app[web.1]: 02:48:14 wsgi.1  |                                         ^^^^^^^^^^^^^^^^^
2025-02-14T02:48:14.872047+00:00 app[web.1]: 02:48:14 wsgi.1  | AttributeError: type object 'datetime.datetime' has no attribute 'timezone'
2025-02-14T02:48:14.872072+00:00 app[web.1]: 02:48:14 wsgi.1  |  - - [14/Feb/2025:11:48:14 +0900] "POST /_/admin/notifications/event-webhook/(EMAIL_STATUS_SECRET_KEY) HTTP/1.0" 500 3711 "-" "SendGrid Event API"
2025-02-14T02:48:14.872097+00:00 app[web.1]: 02:48:14 nginx.1 | measure#nginx.service=0.042 request_id=b82b6aae-e767-ab13-c515-3af873c4a00d
2025-02-14T02:48:14.876345+00:00 app[web.1]: 02:48:14 wsgi.1  | 2025-02-14 11:48:14,876 - urllib3.connectionpool - DEBUG - https://o85113.ingest.sentry.io:443 "POST /api/185382/envelope/ HTTP/1.1" 200 0
tienne-B added a commit that referenced this issue Feb 14, 2025
@tienne-B tienne-B linked a pull request Feb 14, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant