Wednesday, September 18, 2013

SQLServerAgent could not be started (reason: Unable to connect to server '(local)'; SQLServerAgent cannot start).

SQL Server Installation is failed with Wait on the Database Engine recovery handle failed error.

I have already posted workaround for that issue, please search about that post.

After fixing the SQL Server issue, I observed SQL Server Agent is not starting, To troubleshoot the issue.

1. Connect to SSMS
2. Right click on SQL Server Agent  -- Properties
3. In General section there is path for SQL Server Agent.out error log file.
4. Open the file in notepad and verify the error, I have the following error in my agent.out file

Unable to connect to server '(local)'; SQLServerAgent cannot start
SQLServer Error: 18456, Login failed for user 'NT AUTHORITY\SYSTEM'. [SQLSTATE 28000]
Logon to server '(local)' failed (DisableAgentXPs)
SQLServerAgent terminated (normally)

5. To fix this I have added NT Authoriy\System to SQL Security,
(The cause of this error is SQL Installation is failed and it doesn't added any logins to SQL Server, so we did it manually).

No comments: