You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using courier with delivery_strategy: http on kratos v.1.0.0 and configs for SendGrid API, kratos is sending the email and SendGrid response has a status code of 202, causing to trigger the message_retries, so for example if I send a verification email with a message_retries: 5, it ends sending me 6 emails in total.
SendGrid returns a 202 in success cases on their API https://docs.sendgrid.com/api-reference/mail-send/mail-send
Reproducing the bug
Setup kratos v1.0.0 with settings in courier to use delivery_strategy: http and configure for SendGrid API, then send an email in a flow like verification flow, then Kratos will send multiple emails depending of how many retries are configured. Ej.message_retries: 5
Relevant log output
{"audience":"application","file":"/go/pkg/mod/github.com/ory/x@v0.0.562/logrusx/helper.go:125","func":"github.com/ory/x/logrusx.(*Logger).Logf","level":"info","msg":"[DEBUG] POST https://api.sendgrid.com/v3/mail/send","service_name":"Ory Kratos","service_version":"v1.0.0","time":"2023-07-26T22:56:11.2612334Z"}
{"audience":"application","error":{"message":"unable to dispatch mail delivery because upstream server replied with status code 202","stack_trace":"stack trace could not be recovered from error type *errors.errorString"},"file":"/project/courier/http.go:81","func":"github.com/ory/kratos/courier.(*courier).dispatchMailerEmail","level":"error","message_id":"fcaff15e-709e-49a4-a712-0f10082efd0f","message_subject":"Test Subject","message_template_type":"verification_code_valid","message_type":"email","msg":"sending mail via HTTP failed.","service_name":"Ory Kratos","service_version":"v1.0.0","time":"2023-07-26T22:56:11.866128Z"}
{"audience":"application","file":"/go/pkg/mod/github.com/ory/x@v0.0.562/logrusx/helper.go:125","func":"github.com/ory/x/logrusx.(*Logger).Logf","level":"info","msg":"[DEBUG] POST https://api.sendgrid.com/v3/mail/send","service_name":"Ory Kratos","service_version":"v1.0.0","time":"2023-07-26T22:56:12.6117559Z"}
{"audience":"application","error":{"message":"unable to dispatch mail delivery because upstream server replied with status code 202","stack_trace":"stack trace could not be recovered from error type *errors.errorString"},"file":"/project/courier/http.go:81","func":"github.com/ory/kratos/courier.(*courier).dispatchMailerEmail","level":"error","message_id":"fcaff15e-709e-49a4-a712-0f10082efd0f","message_subject":"Test subject","message_template_type":"verification_code_valid","message_type":"email","msg":"sending mail via HTTP failed.","service_name":"Ory Kratos","service_version":"v1.0.0","time":"2023-07-26T22:56:12.701756Z"}
{"audience":"application","file":"/go/pkg/mod/github.com/ory/x@v0.0.562/logrusx/helper.go:125","func":"github.com/ory/x/logrusx.(*Logger).Logf","level":"warning","message_id":"fcaff15e-709e-49a4-a712-0f10082efd0f","message_nid":"e6bf53a3-9805-4617-9ccf-2be4787cc10e","msg":"Message was abandoned because it did not deliver after 2 attempts","service_name":"Ory Kratos","service_version":"v1.0.0","time":"2023-07-26T22:56:13.4521965Z"}
Preflight checklist
Describe the bug
Using courier with
delivery_strategy: http
on kratos v.1.0.0 and configs for SendGrid API, kratos is sending the email and SendGrid response has a status code of 202, causing to trigger themessage_retries
, so for example if I send a verification email with amessage_retries: 5
, it ends sending me 6 emails in total.SendGrid returns a 202 in success cases on their API https://docs.sendgrid.com/api-reference/mail-send/mail-send
Reproducing the bug
Setup kratos v1.0.0 with settings in
courier
to usedelivery_strategy: http
and configure for SendGrid API, then send an email in a flow like verification flow, then Kratos will send multiple emails depending of how many retries are configured. Ej.message_retries: 5
Relevant log output
Relevant configuration
Version
v1.0.0
On which operating system are you observing this issue?
Windows
In which environment are you deploying?
Kubernetes with Helm
Additional Context
No response
The text was updated successfully, but these errors were encountered: