none
SQLServerAgent cannot start

    Question

  • I have successfully installed SQL 2005 on W2K3 Cluster.
    The problem is that SQL Server Agent won't start.
    Below are the lines from SQLAGENT.OUT:

    2007-03-15 09:40:02 - ! [298] SQLServer Error: 2, Named Pipes Provider: Could not open a connection to SQL Server [2]. [SQLSTATE 08001]
    2007-03-15 09:40:02 - ! [165] ODBC Error: 0, Login timeout expired [SQLSTATE HYT00]
    2007-03-15 09:40:02 - ! [298] SQLServer Error: 2, An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. [SQLSTATE 08001]
    2007-03-15 09:40:02 - ! [000] Unable to connect to server '(local)'; SQLServerAgent cannot start
    2007-03-15 09:40:07 - ! [298] SQLServer Error: 2, Named Pipes Provider: Could not open a connection to SQL Server [2]. [SQLSTATE 08001]
    2007-03-15 09:40:07 - ! [165] ODBC Error: 0, Login timeout expired [SQLSTATE HYT00]
    2007-03-15 09:40:07 - ! [298] SQLServer Error: 2, An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. [SQLSTATE 08001]
    2007-03-15 09:40:07 - ! [382] Logon to server '(local)' failed (DisableAgentXPs)
    2007-03-15 09:40:08 - ? [098] SQLServerAgent terminated (normally)

    I have tried starting Agent with Domain Admin account. No luck. SQL Server is started.

    Regards,   Iztok
    Thursday, March 15, 2007 9:03 AM

Answers

  • Problem solved thanks to excelent Microsoft's Support.

     

    Have added virtual server's name as value in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.1\SQLServerAgent\ServerHost.

     

    Regards,   Iztok

     

    Friday, March 30, 2007 9:57 AM

All replies

  • go to SQL Server configuration manager and check the protocols

    madhu

    Thursday, March 15, 2007 5:11 PM
    Moderator
  • See the screencast on my site for more information about enabling the protocols.

    Jens K. Suessmeyer.

    ---
    http://www.sqlserver2005.de
    ---

    Friday, March 16, 2007 5:35 PM
    Moderator
  • I have checked the protocols and change them. But the problem remains.

    I have changed Local and Remote connections to Using TCP/IP only but lines in log are still the same.

    2007-03-19 10:36:36 - ! [298] SQLServer Error: 2, Named Pipes Provider: Could not open a connection to SQL Server [2]. [SQLSTATE 08001]
    2007-03-19 10:36:36 - ! [165] ODBC Error: 0, Login timeout expired [SQLSTATE HYT00]
    2007-03-19 10:36:36 - ! [298] SQLServer Error: 2, An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. [SQLSTATE 08001]
    2007-03-19 10:36:36 - ! [000] Unable to connect to server '(local)'; SQLServerAgent cannot start
    2007-03-19 10:36:42 - ! [298] SQLServer Error: 2, Named Pipes Provider: Could not open a connection to SQL Server [2]. [SQLSTATE 08001]
    2007-03-19 10:36:42 - ! [165] ODBC Error: 0, Login timeout expired [SQLSTATE HYT00]
    2007-03-19 10:36:42 - ! [298] SQLServer Error: 2, An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. [SQLSTATE 08001]
    2007-03-19 10:36:42 - ! [382] Logon to server '(local)' failed (DisableAgentXPs)
    2007-03-19 10:36:42 - ? [098] SQLServerAgent terminated (normall

    Do you have any other idea?

    Regards,  Iztok

     

    Monday, March 19, 2007 9:41 AM
  • I have checked the protocols and change them. But the problem remains.

    Nice idea those Screencasts.

    Regards,  Iztok

    Monday, March 19, 2007 9:43 AM
  • Additional info:

    When I change Log on account in SQL Server Configuration Manager i get

    WMI Provider Error. The server threw an exception. [0x80010105]

    I was already searching if there are additional steps when SQL Server is installed on domain controller but didn't find any.

    Any help would be very helpful.

     

    Regards,  Iztok

     

     

     

     

    Monday, March 19, 2007 9:55 AM
  • Problem solved thanks to excelent Microsoft's Support.

     

    Have added virtual server's name as value in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.1\SQLServerAgent\ServerHost.

     

    Regards,   Iztok

     

    Friday, March 30, 2007 9:57 AM
  • I have been perusing the Internet for this solution and it worked on our Cluster install.  Man this was a lifesaver
    Thursday, May 10, 2007 7:56 PM
  • I had this same issue. I did not change the registry. The "SQL Server Agent Properties" had a wrong "Alias local host server". I removed the wrong entry and left it empty. Restarted the cluster sql instance and worked just fine.

     

    -Mani

    Monday, November 12, 2007 10:10 PM
  • Adding the value to the registry setting worked for me...thanks mate...
    Wednesday, February 04, 2009 6:36 AM
  • This work for me, I added my computer name.  I replaced the name Local and added my computer name and it worked like a charm.  Thanks.
    Tuesday, July 27, 2010 5:25 PM
  • This fixed my issue as well.

    As Mandan stated above, you do not need to change the Registry.  The correct way to fix the setting is to change: SQL Server Agent -> Properties ->Connection->Alias local host server

    And make sure it is empty.

    Also, the server I had trouble with was never a cluster.  I beleive that the server was renamed shortly after SQL Server was installed, and I would guess that is what caused the issue.

    Friday, December 10, 2010 7:37 PM
  • This fixed my issue as well.

    As Mandan stated above, you do not need to change the Registry.  The correct way to fix the setting is to change: SQL Server Agent -> Properties ->Connection->Alias local host server

    And make sure it is empty.

    Also, the server I had trouble with was never a cluster.  I beleive that the server was renamed shortly after SQL Server was installed, and I would guess that is what caused the issue.


    I did a similar fix (standalone, not clustered), a name change that happened at some point was causing the following in the SQLAGENT.OUT:

    2010-12-23 17:19:11 - ! [000] Unable to connect to server '(local)'; SQLServerAgent cannot start
    2010-12-23 17:19:11 - ! [298] SQLServer Error: 18452, Login failed. The login is from an untrusted domain and cannot be used with Windows authentication. [SQLSTATE 28000] 
    2010-12-23 17:19:11 - ! [382] Logon to server '(local)' failed (DisableAgentXPs)
    2010-12-23 17:19:12 - ? [098] SQLServerAgent terminated (normally)
    
    Went into Microsoft SQL Server Management Studio, right-click SQL Server Agent->Properties->Connection and the field was blank.  I added the new server name and then the service was able to start.

     

    Friday, December 24, 2010 12:33 AM
  • FYI this is the same registry key update in the Agent's properties. In SSMS right click the agent, select properties, and go to the connection tab. The "alias" field is what populates that registry key.
    Chuck
    Thursday, September 01, 2011 2:52 PM
  • run the following command:
    C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Binn>SQLAGENT -C -V


    Output:

    Microsoft (R) SQLServerAgent 10.50.1600.1
    Copyright (C) Microsoft Corporation.

    2012-01-26 08:56:08 - ! [246] Startup error: Unable to read SQLServerAgent regis
    try settings (from

    Software\Microsoft\Microsoft SQL Server\MSSQL10_50.MSSQLSERVE
    R\SQLServerAgent)
    2012-01-26 08:56:09 - ? [098] SQLServerAgent terminated (normally)

    C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Binn>


    Solution:

    Goto open the Registry- > HKLM\Software\Microsoft\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\SQLServerAgent>

    Add the virtual server name as host name


    Hema
    • Proposed as answer by Reesedwalker Tuesday, August 07, 2012 4:00 PM
    Thursday, January 26, 2012 3:03 PM
  • I have the same problem in my cluster but Im not sure what and where I should type in the virtual server name.

    I tried to type in the cluster name in the ServerHost in registry, didn't work. Then I typed in the server name in the ServerHost, and now I can start SQL and the agent manually.

    But what name should be in "Alias local host server"? Clusername, server name? ....actually Im not sure what the virtual server's name is. The name of the server or the cluster or what?

    We still cant bring our cluster up.
    Error 1069:
    Cluster resource 'SQL Server' in clustered service or application 'SQL Server (MSSQLSERVER)' failed.

    Tuesday, March 20, 2012 2:50 PM
  • I have same problem, but to me helps add in registry true permission to read/write for : 

     HKLM\Software\Microsoft\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\SQLServerAgent

    Permission name: SQLServerSQLAgentUser$<hostname>$<servicename>

    Andris J.

    Wednesday, June 27, 2012 10:32 AM
  • The key information to hone in on is: "! [000] Unable to connect to server '(local)'; SQLServerAgent cannot start"

    So yes, there are a few ways to remedy this and thus help the SQL Agent obtain its proper connection.
    Two solutions already provided, modify the registry, or update the Alias Host name in the SQLAgent properties.

    The third the solution is to add an alias in the SQL Configuration manager as follows:
    Alias Name:  (local)
    Then select the appropriate information for your particular installation with regards to [Port Number] and [Server], (assuming you are using th TCP/IP protocol for that Alias).

    Marlon

    • Proposed as answer by mesco88 Sunday, February 10, 2013 6:00 PM
    Sunday, February 10, 2013 5:59 PM
  • Problem solved thanks to excelent Microsoft's Support.

     

    Have added virtual server's name as value in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.1\SQLServerAgent\ServerHost.

     

    Regards,   Iztok

     


    Just stopped by to say thanks.  This helped me out with the problem we have been having.  Thanks again!!
    Thursday, August 08, 2013 11:44 PM
  • I had the same issue on a newly installed server.

    I enabled Agent Xp's and queried the configuration, all were fine.

    I tried starting the service again and checked the SQL Agent Log (C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Log\SQLAgent.OUT) file and saw that it was permissions issues:

    SQLServer Error: 18456, Login failed for user 'xxx\zzzzzz'. [SQLSTATE 28000]

    I added the service account the agent was running under and started the agent successfully.

    Wednesday, March 12, 2014 1:04 PM