Skip to content

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

Closed
@matt-aitken

Description

@matt-aitken

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions