Fix it now
Error 41131 is published as a failure to bring the availability group online because the operation timed out, with the advice to verify that the local cluster node is online and that the group’s resource exists in the cluster. Microsoft’s own documented cause is narrower and easy to miss: the NT AUTHORITY\SYSTEM login is missing or lacks the permissions health detection needs.
USE [master];
CREATE LOGIN [NT AUTHORITY\SYSTEM] FROM WINDOWS WITH DEFAULT_DATABASE=[master];
GRANT ALTER ANY AVAILABILITY GROUP TO [NT AUTHORITY\SYSTEM];
GRANT CONNECT SQL TO [NT AUTHORITY\SYSTEM];
GRANT VIEW SERVER STATE TO [NT AUTHORITY\SYSTEM];
- Run the statements above on each replica. Microsoft documents this account as the one Always On health detection uses to connect to the instance and monitor health, and health detection cannot start without it.
- Check the feature is switched on for this instance:
SELECT SERVERPROPERTY('IsHadrEnabled');. Zero means it is off. - If it is off, enable it in SQL Server Configuration Manager: SQL Server Services, right-click the instance, Properties, the Always On High Availability tab, tick Enable Always On Availability Groups. Restart the SQL Server service afterwards; the property then reads 1.
- Read the error log around the 41131 entry, and pull the cluster’s own view with
Get-ClusterLog -Destination C:\Temp -TimeSpan 15, where the time span is in minutes.
If the log shows 35222 rather than 41131, that is a different problem with its own documented fix: disable and re-enable Always On Availability Groups in Configuration Manager, restart the service, and retry.
If the group comes online, stop here. If it does not, the next section covers what has to agree between the cluster and the instance.
Why it happens
An availability group exists in two places at once. The Windows cluster owns a resource that decides which node should host the primary, and SQL Server owns the replicas and the databases. Bringing the group online is a conversation: the cluster asks the local instance to take the primary role, and the instance either confirms or does not. Error 41131 is that conversation timing out, logged from the SQL Server side.
The published text tells you to verify that the local Windows Server Failover Clustering node is online, then that the availability group resource exists in the cluster, and says that if the problem persists you might need to drop the group and create it again. That is worth reading as what it is: a timeout message with generic advice, not a diagnosis.
Microsoft publishes a specific cause for it, and it is the first thing to check because it is invisible from the cluster side. Always On health detection connects to the instance as NT AUTHORITY\SYSTEM. If that login is missing, or it lacks ALTER ANY AVAILABILITY GROUP, CONNECT SQL or VIEW SERVER STATE, health detection cannot be initiated when the primary replica comes online, and the operation times out with 41131. Hardened builds and scripted deployments remove that login routinely.
Of the codes that keep it company, only one has a published meaning. Error 35222 is published as being unable to process the operation because Always On Availability Groups does not have permissions to access the cluster, with the instruction to disable and re-enable the feature in Configuration Manager, restart the service and retry. Errors 41158 and 41142 sit inside Microsoft’s published message range for these numbers, but no accessible page gives their text, so read whatever sentence SQL Server prints next to them rather than trusting a meaning someone has attached to the number.
The health detection login is missing or under-privileged
You have this one if 41131 on a group that was working, or on one you have just created, with nothing obviously wrong in the cluster.
- Create the
[NT AUTHORITY\SYSTEM]login on every instance hosting a replica. - Grant it ALTER ANY AVAILABILITY GROUP, CONNECT SQL and VIEW SERVER STATE.
- Retry bringing the group online, and check the other replicas before you assume only one was affected.
This is a per-instance grant, so a group that works on one node and fails on another very often comes down to this.
Always On is not enabled on this instance
You have this one if A new or rebuilt node where SERVERPROPERTY('IsHadrEnabled') returns 0 while the others return 1.
- Open SQL Server Configuration Manager, SQL Server Services, the instance’s Properties, and the Always On High Availability tab.
- Confirm the Windows failover cluster name shown is the cluster you expect, then tick Enable Always On Availability Groups.
- Restart the SQL Server service, confirm the property now returns 1, and join the replica with
ALTER AVAILABILITY GROUP [AG1] JOIN;
Always On cannot reach the cluster
You have this one if Error 35222 in the log rather than, or alongside, 41131.
- Follow the documented remedy: disable Always On Availability Groups in Configuration Manager, then enable it again.
- Restart the SQL Server service.
- Retry the operation that failed, and check the cluster service is healthy on that node before repeating the cycle.
The cluster cannot keep resources online
You have this one if Several cluster resources are offline at once, not just the availability group, and node membership is incomplete.
- Bring the missing nodes back, or restore the network path between sites if this is a stretched cluster.
- Review the witness configuration so a single node or site failure does not cost you quorum again.
- Only if the outage cannot wait, and you accept the cost, start the cluster service with forced quorum on a surviving node.
Quorum problems usually come from a design with no witness, or a witness in the wrong place. Fix the design after the incident, not during it.
The cluster cannot manage the listener’s directory object
You have this one if The group comes online except for its listener, or creating the listener fails outright.
- Pre-stage a computer object for the listener in the organisational unit you use for cluster objects.
- Grant the cluster name object full control of that object, and the right to create computer objects in the organisational unit if you want it created automatically.
- Bring the listener resource online again and confirm the name resolves from a client.
Full reference
The permissions health detection needs
| Grant | Why |
|---|---|
CREATE LOGIN [NT AUTHORITY\SYSTEM] FROM WINDOWS |
The account health detection connects as |
GRANT ALTER ANY AVAILABILITY GROUP |
Lets it act on the group when the primary comes online |
GRANT CONNECT SQL |
Lets it connect at all |
GRANT VIEW SERVER STATE |
Lets it read the health it is there to monitor |
Narrowing it down before you touch the cluster
| What you find | Where the fault is |
|---|---|
IsHadrEnabled returns 0 |
The feature is not enabled for this instance |
| 35222 in the log | Always On cannot access the cluster; disable and re-enable the feature, restart, retry |
| Several unrelated resources offline | Cluster membership, not the availability group |
| Only the listener fails | The cluster’s rights on the listener’s computer object |
| 41158 or 41142 in the log | Read the sentence SQL Server printed with them; the numbers alone have no published meaning |
Evidence worth collecting before a second attempt
- Note the exact timestamp of the 41131 entry in the SQL Server error log.
- Generate the cluster’s view of the same window with
Get-ClusterLog -Destination C:\Temp -TimeSpan 15. The time span is in minutes, and the default destination is the cluster reports folder on each node. - Open the AlwaysOn_health extended events session for the same period on each replica.
- Look at the availability group resource in Failover Cluster Manager and read its recent events.
- Compare the failing node against a working one, since almost everything here is per instance.
Forcing quorum, or forcing a failover that allows data loss, tells the cluster to proceed without agreement. Both can leave replicas that disagree about what was committed. Use them only when the alternative is a longer outage you cannot accept, and reconcile the replicas afterwards.
Where the edition genuinely does bite
The edition is rarely the cause of 41131 itself, but it decides what topology you can build once the group is online. In SQL Server 2025, availability groups are listed as an Enterprise feature supporting up to eight secondary replicas, five of them synchronous. Standard offers basic availability groups, documented as two replicas with a single database, no read access on the secondary, no backups on the secondary and no participation in a distributed availability group. A basic group also cannot be upgraded in place: it has to be dropped and recreated.
Before you drop and recreate the group
- The published message suggests it, and it is genuinely sometimes the answer, but it is the last step rather than the first.
- Check the SYSTEM login on every replica first, then feature enablement, then the cluster.
- Take a note of the group’s configuration, including routing lists and backup preferences, because recreating it does not bring those back.
- Confirm the databases are in a state you can rejoin from, or you will be restoring as well as recreating.
When a licence is the actual fix
Nothing in the documented cause of 41131 is a licensing matter: a missing login, a feature that is not enabled, a cluster that has lost quorum and a listener object with the wrong rights are all free to correct. The edition question comes afterwards, when you decide what the group should look like. Full availability groups, with more than two replicas, several databases in one group and secondaries you can read or back up, are Enterprise in SQL Server 2025; the basic availability group available in Standard is deliberately narrow at two replicas and one database. Plenty of sites run happily inside those limits and should spend nothing. If yours has outgrown them, Arco supplies SQL Server 2025 Enterprise (2-core pack) licences and can work through the core counts per node before anything is ordered.
Every code this article covers
| Code | What it points at | Source |
|---|---|---|
41131 |
Failed to bring the availability group online because the operation timed out; verify the local cluster node is online and that the group’s resource exists in the cluster | Microsoft Learn |
41158 |
An Always On message logged around a failed attempt to bring a group online. No accessible Microsoft page publishes its text, so read the sentence printed with it | not published by the vendor |
35222 |
Always On Availability Groups does not have permissions to access the cluster; disable and re-enable the feature in Configuration Manager, restart the service and retry | Microsoft Learn |
41142 |
An Always On message logged around role transitions. No accessible Microsoft page publishes its text, so read the sentence printed with it | not published by the vendor |
Confirm the fix worked
SELECT SERVERPROPERTY('IsHadrEnabled');returns 1 on every replica.- The
[NT AUTHORITY\SYSTEM]login exists on every replica with the three documented grants. - The group and its listener are online in Failover Cluster Manager on the node you expect.
- A client connects through the listener and runs a query.
- A planned failover in a maintenance window brings the group online on another node.
Questions people ask about this
Should I drop and recreate the group, as the message suggests?
Eventually, perhaps. Check the NT AUTHORITY\SYSTEM login and its three grants on every replica first, then whether Always On is enabled on the instance, then the cluster. Recreating the group loses its configuration and is the step you take when those have been ruled out.
Should I try a forced failover to get the group online?
Not as a first move. A forced failover permits data loss and should follow a decision rather than a hunch. Fix the health detection login, feature enablement and quorum first.
Do all replicas need the same edition?
They should. Mixing editions leaves a group whose behaviour changes depending on which node is primary, which is hard to reason about during an incident.
Is this ever a licensing problem?
Rarely. Microsoft’s documented cause is a permissions one, and quorum, feature enablement and listener rights account for most of the rest. Edition matters for what topology you can build, not for whether the group can come online.
What do 41158 and 41142 mean?
No Microsoft page that we could reach publishes their text, so this article does not assign them one. When you see either number, read the sentence SQL Server printed next to it in the error log; that sentence is the actual message and it is authoritative.
