Skip to content

[TRI-4669] Run alerts don't send if the run error message has a newline character in it #1745

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

Closed
matt-aitken opened this issue Mar 1, 2025 · 0 comments
Assignees

Comments

@matt-aitken
Copy link
Member

matt-aitken commented Mar 1, 2025

We put the error.message in Run failed alert email subjects:

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:

TRI-4669

@matt-aitken 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
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

No branches or pull requests

2 participants