Cannot create SQL Always on Availabilty Group

Disco Pymp 1 Reputation point

TITLE: Microsoft SQL Server Management Studio


Create failed for Availability Group 'DSQLTESTAG'. (Microsoft.SqlServer.Management.HadrModel)

For help, click:



An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)


Failed to add a node to the possible owner list of a Windows Server Failover Clustering (WSFC) resource (Error code 5079). The WSFC service may not be running or may not be accessible in its current state, or the specified cluster resource or node handle is invalid. For information about this error code, see "System Error Codes" in the Windows Development documentation.
Failed to designate the local availability replica of availability group 'DSQLTESTAG' as the primary replica. The operation encountered SQL Server error 41017 and has been terminated. Check the preceding error and the SQL Server error log for more details about the error and corrective actions.
Failed to create availability group 'DSQLTESTAG'. The operation encountered SQL Server error 41160 and has been rolled back. Check the SQL Server error log for more details. When the cause of the error has been resolved, retry CREATE AVAILABILITY GROUP command. (Microsoft SQL Server, Error: 41017)

For help, click:





SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,654 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Disco Pymp 1 Reputation point

    Exact same issue as below. no resolve on that issue.

    I also see this in the cluster log -

    [Verbose] 00001a08.00001f08::2021/07/07-17:10:00.959 DBG [RHS] s_RhsRpcCreateResType(SQL Server Availability Group, hadrres.dll)
    [Verbose] 00001a08.00001f08::2021/07/07-17:10:00.961 ERR [RHS] s_RhsRpcCreateResType: (126)' because of 'Error loading resource DLL hadrres.dll.'

    0 comments No comments

  2. Disco Pymp 1 Reputation point

    Oh .... SQL Version below -

    Microsoft SQL Server 2014 (SP3-CU4-GDR) (KB4583462) - 12.0.6433.1 (X64) Oct 31 2020 02:54:45 Copyright (c) Microsoft Corporation Developer Edition (64-bit) on Windows NT 6.3 <X64> (Build 17763: ) (Hypervisor)

    0 comments No comments

  3. CathyJi-MSFT 21,081 Reputation points Microsoft Vendor

    Hi @Disco Pymp ,

    Did the replicas that will add to SQL AG are just stand alone SQL server instance, not in SQL Failover cluster instance environment?

    Did you check the windows cluster states and the states of the replicas that you will be add in AG as below screenshot.


    Please share us more message from SQL server error log. And more information from Cluster log.