Closed Bug 1746112 Opened 5 months ago Closed 5 months ago

AWS is complaining about too many failures. SNS notification format seems to have changed


( :: Email Notifications, defect, P1)





(Reporter: dkl, Assigned: dkl)


The following error is being logged since Dec 10th so the format has changed and we need to change how we check it.

Error in SES Handler: Reference {"complaint" => {"arrivalDate" => "2021-12-14T17:25:51.154Z"...} did not pass type constraint "ComplaintNotification" (in $_[1]) at /app/Bugzilla/App/ line 165 "ComplaintNotification" is a subtype of "Dict[complaint=>Dict[complainedRecipients=>ComplainedRecipients,complaintFeedbackType=>Str,slurpy Any],slurpy Any]" Reference {"complaint" => {"arrivalDate" => "2021-12-14T17:25:51.154Z"...} did not pass type constraint "Dict[complaint=>Dict[complainedRecipients=>ComplainedRecipients,complaintFeedbackType=>Str,slurpy Any],slurpy Any]" (in $_[1]) "Dict[complaint=>Dict[complainedRecipients=>ComplainedRecipients,complaintFeedbackType=>Str,slurpy Any],slurpy Any]" constrains value at key "complaint" of hash with "Dict[complainedRecipients=>ComplainedRecipients,complaintFeedbackType=>Str,slurpy Any]" Reference {"arrivalDate" => "2021-12-14T17:25:51.154Z","complainedReci...} did not pass type constraint "Dict[complainedRecipients=>ComplainedRecipients,complaintFeedbackType=>Str,slurpy Any]" (in $_[1]->{"complaint"}) "Dict[complainedRecipients=>ComplainedRecipients,complaintFeedbackType=>Str,slurpy Any]" requires key "complaintFeedbackType" to appear in hash

Once I get a hold of a full copy of the JSON that is being sent I can update our end and deploy a fix.

It doesn't appear to be a change from AWS's side.

A "Complaint Notification Without a Feedback Report" would trigger this error as it doesn't contain complaintFeedbackType:


The handling code supports this:

my $reason  = $notification->{complaint}->{complaintFeedbackType} // 'unknown';

However the strict schema verification which was added later doesn't treat complaintFeedbackType as optional.

Looks like a simple fix:

-    complaintFeedbackType => Str,
+    complaintFeedbackType => Optional [Str],
Closed: 5 months ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.