Monday, November 30, 2009

Resolved: SQL Server Agent job notifications fail with "failed to notify '(operator name)'"

Running:
- Windows Server 2003 (5.2, build 3790)
- SQL Server 2005 (9.00.4053.00)

Symptoms:
- A job in SQL Server Agent is set to have an email notification sent to an operator when it fails, but the notifications don't send.
- Running Management > Database Mail > Send Test E-Mail does work, however.
- In the job history, each failed attempt is followed by "NOTE: Failed to notify '(operator name)' via email.".
- In the SQL Agent error log, there is a message saying, "Unable to start mail session... profile name is not valid..."

Solution:
- Go to SQL Server Agent > Properties > Alert System.
- If "Enable mail profile" is unchecked, check it and restart the SQL Server Agent.
- If is checked and still doesn't work, UNcheck it, restart the SQL Server Agent, then go back in and check it again, and then restart SSA again (this fixed my issue).

Commentary:
I found a lot of posts about this issue. Most revolved around the fact that by default the SQL Server Agent comes with the mail profile disabled. But it took me a few hours to resolve this, so it sounded like a good one to post here for others.

There is also a
Microsoft HotFix for certain related problems, but if you've been keeping your system up-to-date, you probably already have installed it in a cumulative update.

You may also want to check out this:
http://msdn.microsoft.com/en-us/library/ms175984.aspx

No comments: