Graylog2 / graylog2-server

Free and open log management
https://www.graylog.org
Other
7.43k stars 1.07k forks source link

Error message needs more detail - An error occurred while trying to send an email #3333

Closed omercnet closed 4 years ago

omercnet commented 7 years ago

When there's an email trigger that fails for some reason, this error is displayed in the system overview screen

An error occurred while trying to send an email! (triggered X hours ago)
The Graylog server encountered an error while trying to send an email. This is the detailed error message: com.floreysoft.jmte.message.ParseException: Error while parsing 'end' at location (7:3): Unmatched end

Expected Behavior

The error should point out the specific alert that generated this failure so we can fix it

Current Behavior

There's no detail about the alert that generated the error so alerts are not being sent

Possible Solution

Include the name of the alert, a link would be perfect

Steps to Reproduce (for bugs)

I can't explain exactly how to reproduce because I don't know what alert is causing this error :)

Your Environment

joschi commented 7 years ago

I can't explain exactly how to reproduce because I don't know what alert is causing this error :)

Check your alarm callbacks. It's an email alarm callback which contains an invalid email template (JMTE is the template engine being used).

omercnet commented 7 years ago

We have dozens of alarms, that's the issue.. I don't know where to look for the bad template

edmundoa commented 7 years ago

Hi @omercnet,

You are right, the notification message should include some information to help you identify the broken alarm callback. Unfortunately, this is not easily doable in the current implementation for alarm callbacks without some refactoring, which would also affect (and break) existing plugins.

In Graylog 2.2, this situation will at least be logged in the Graylog logs, including the alarm callback name, so it would be easy to identify the culprit.

As you are running 2.1.2, my recommendation is to check the Graylog logs for the error Stream [stream information] has alert receivers and is triggered, but sending emails failed. That will at least give you the stream associated to the broken alarm callback.

omercnet commented 7 years ago

thanks @edmundoa found the bad alert and fixed it

2017-01-13 17:53:11,069 ERROR: org.graylog2.alarmcallbacks.EmailAlarmCallback - Stream [581f0398884de800011ccbeb: "Random-looking DNS"] has alert receivers and is triggered, but sending emails failed

Including this exception detail in the overview screen would be perfect

bernd commented 4 years ago

We improved the logging in the new notification system in 3.2. Closing this issue.