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
subject: `[${data.organization}] Run ${data.runId} failed for ${data.taskIdentifier} [${data.version}.${data.environment}] ${data.error.message}`,
If the error.message has a newline in it email APIs reject it and we end up with this error in the queue we use to send them:
{"visibilityTimeoutMs":60000,"item":{"alertId":"cmxxxxxxxxxxxxxxx"},"attempt":2,"errorMessage":"The `\\n` is not allowed in the `subject` field.","job":"v3.deliverAlert"}
It will try again multiple times but ultimately fail because the subject will always be invalid.
Solution
We need to strip out investigate what characters are invalid and then strip them all out of email subjects. It would probably be best to do this at a level in the code where future developers won't have to think about this problem.
My recommendation is to do the string replacements on the subject here:
The text was updated successfully, but these errors were encountered:
matt-aitken
changed the title
Run alerts don't send if the run error message has a newline character in it
[TRI-4669] Run alerts don't send if the run error message has a newline character in it
Mar 1, 2025
We put the error.message in Run failed alert email subjects:
trigger.dev/internal-packages/emails/src/index.tsx
Line 112 in e024181
If the error.message has a newline in it email APIs reject it and we end up with this error in the queue we use to send them:
It will try again multiple times but ultimately fail because the subject will always be invalid.
Solution
We need to strip out investigate what characters are invalid and then strip them all out of email subjects. It would probably be best to do this at a level in the code where future developers won't have to think about this problem.
My recommendation is to do the string replacements on the
subject
here:trigger.dev/internal-packages/emails/src/index.tsx
Line 66 in e024181
TRI-4669
The text was updated successfully, but these errors were encountered: