Thursday 17 July 2014

Error: The Server Instance Witness Rejected Configure Request

Hey everyone out there! Welcome back to SQL Something!

Today we look at an interesting problem. I'm not sure as to the root cause of it, but we will look at how to solve it.

(P.S. If anyone out there knows why this occurred, please feel free to contribute in the comments below)

The error in question is:
The server instance Witness rejected configure request; read its error log file for more information. The reason 1427, and state 31, can be of use for diagnostics by Microsoft. This is a transient error hence retrying the request is likely to succeed. Correct the cause if any and retry.
Fig. 1: So it begins.

I discovered this error repeating continuously in the Application Log in the Windows Event Viewer.

Naturally I checked all the databases currently being mirrored, however all seemed to be in order (both the Principals as well as the Mirrors). So how can we find out more about the issue and how can we fix it?

Easily it seems. We just have to query sys.database_mirroring.


Sys.database_mirroring can give you a wealth of information on current Mirrored DBs. A number of the fields available to us are outlined in the link above, but for our purposes we'll only look at a few of them.

Run the following query on your MIRROR instance:
SELECT db_name (database_id) AS 'Database_Name'
, mirroring_role_desc AS 'Database_Role'
, mirroring_partner_instance AS 'Partner_Instance'
, mirroring_state_desc AS 'Mirroring_State'
, mirroring_connection_timeout 'Mirroring_Connection_Timeout_(secs)'
, mirroring_witness_name AS 'Witness_Instance_Name'
, mirroring_witness_state_desc AS 'Witness_State'
FROM master.sys.database_mirroring
WHERE mirroring_guid IS NOT NULL;
Pay close attention to 'Witness_State':

Fig. 2: Something is not quite like the others.

As we can see in the above, one of my Witness States was indicating that it is DISCONNECTED. This is the cause of the error.

To fix the error, we can do one of two things:
Apply a T-SQL fix to remove/reconnect the witness. OR
Remove/Redo Mirroring

The T-SQL involves running the following on your PRINCIPAL instance:

ALTER DATABASE [YourDatabaseName] SET WITNESS OFF
GO
ALTER DATABASE [YourDatabaseName]
GO

What the above does is fully disconnects the witness, then reconnects it. That should hopefully make it sort itself out (Please note that the above T-SQL step can be done in Management Studio as outlined here).

If that doesn't work, you may then need to redo Mirroring.

Rerun the initial checking query on your MIRROR instance to ensure that the Witness has been reconnected.

DISCLAIMER: As stated, I’m not an expert so please, PLEASE feel free to politely correct or comment as you see fit. Your feedback is always welcomed. :-)

No comments:

Post a Comment