How to Fix SQL Server Error 35250 (Msg 35250)
You get sql server error 35250 when the link to the primary replica fails. You fix it by opening network ports, checking service logins, and verifying endpoint status. This severity 16 error stops the database engine from running your availability group command. It appears when a secondary node cannot talk to the primary node during setup. Teams often hit this wall when adding a new database to an availability group. What causes sql server error 35250 in availability groups The official mess
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
You get sql server error 35250 when the link to the primary replica fails. You fix it by opening network ports, checking service logins, and verifying endpoint status.
This severity 16 error stops the database engine from running your availability group command. It appears when a secondary node cannot talk to the primary node during setup. Teams often hit this wall when adding a new database to an availability group.
What causes sql server error 35250 in availability groups
The official message says the connection to the primary replica is not active. Because of this broken link, the database engine cannot process your command at all. Most often, a network firewall blocks the port used by the database mirroring endpoint. Each node in the cluster must reach the endpoint port on every other node.
A stopped endpoint on the primary or secondary server will also trigger this error. Sometimes the endpoint exists, but it is not in a started state yet. Service account login problems are another frequent root cause for this replica failure.
The service account on each node needs permission to log in to the others. If the nodes run under different accounts, you must grant connect rights to each. Name resolution failures between the cluster nodes can also break the replica link. If a server cannot resolve the host name to an IP, the link drops.
How to check and fix the replica link safely
Start by checking the network path between the primary and secondary server nodes. Test that the secondary node can reach the primary node IP and endpoint port. If a firewall blocks the traffic, add a rule for the specific endpoint port. Do not open all ports between servers just to make the error go away.
Next, check the state of the mirroring endpoint on every node in the group. Make sure the endpoint is started and listening on the right TCP port. Then verify the login rights for the service accounts on each database server. A database user is the identity of a login when it connects to a database. Grant only the connect permission on the endpoint to the remote service account.
Kubernetes API Server Access + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Avoid giving full admin rights to fix a simple endpoint login or role failure. In general, the owner role can drop the database and run all maintenance tasks. Keep engineer accounts safe while they check replica health and read system state tables. Members of the data reader role can read all data from user tables. Data writer members can add, delete, or change data in all user tables.
Preventing replica failures during production changes
When engineers log in to fix replica errors, you should limit their database rights. Give them read roles for checking state, and require approval for state changes. Fixed database roles cannot have their default permissions changed on the server. All roles, including the public role, have the basic right to connect.
If a team member only needs access to one database, consider a contained user. An admin must first enable contained databases on the server and the database itself. For people who need many databases on an instance, a standard login is common. You should also protect sensitive fields like emails or phone numbers during debug work. Data masking rewrites matched fields like card numbers or national IDs in query results. This lets engineers check database tables and fix replica issues while keeping data safe.
Add runtime guardrails beside SQL Server
Role grants and network rules are needed setup for SQL Server. Still, an allowed user or agent tool can send a bad delete or read raw customer fields over a valid session. In practice, hoop.dev sits inline in the TDS protocol beside the database as a sidecar for your SQL Server. For every query an agent or human runs in production, hoop.dev decides whether to pass, mask, block, or escalate it for review.
With hoop.dev SQL Server controls, rules refuse banned statements before they run, hold risky queries for human review, and mask matched sensitive values in supported result columns in memory. Furthermore, hoop.dev holds SOC 2 Type II and generates evidence for HIPAA, PCI DSS, SOX, and GDPR audits. See the source on GitHub.
Frequently asked questions
What does severity 16 mean for sql server error 35250?
Severity 16 means the error comes from a config or user problem you fix. The database engine is still running, so you can fix the network or login.
Can a stalled data sync trigger error 35250 during database join?
Yes, if the initial backup and restore steps are not finished on the secondary. The secondary database must be in a restoring state before it joins the group.
Do I need to restart the database server to fix error 35250?
No, you do not need to restart the whole server to fix this error. Starting the endpoint, fixing the login, or opening the firewall port works right away.
Related guides
In this post