Troubleshooting Guide: SQL Server Error 2386 – Facet Value Outside Allowed Range
Why This Error Happens
Error 2386 occurs when a Policy-Based Management (PBM) policy evaluates a property (facet) against a condition whose value falls outside the permissible range defined by SQL Server’s internal metadata or the SMO (SQL Management Objects) facet definition. This is typically caused by a misconfigured policy condition, a manually edited policy XML with an invalid numeric value, or a mismatch between the facet property’s expected data type and the value supplied during evaluation. It can also surface after an in-place upgrade to SQL Server 2025 if legacy policies reference facets whose valid ranges changed between versions.
Step-by-Step Resolution Guide
Step 1: Identify the Offending Policy or Condition
- Open SQL Server Management Studio (SSMS) and connect to the instance.
- Navigate to Management > Policy Management > Policies.
- Check the SQL Server Agent Job history or Event Viewer (Windows Logs > Application) for the full error text, which includes the facet name (e.g.,
MaxDegreeOfParallelism,FillFactor,NumberOfLogFiles). - Note the exact policy name tied to Error 2386 in the Policy Management history.
Step 2: Inspect and Correct the Condition Value
- Right-click the identified policy and select Properties.
- Click the linked Condition and review the Field/Operator/Value expression.
- Compare the entered value against the facet’s documented valid range in Microsoft Docs (e.g.,
FillFactormust be between 0–100;MaxDegreeOfParallelismmust be between 0–32767). - Correct the out-of-range value, then click OK to save.
Step 3: Validate Policy XML for Manual Edits
- If the policy was imported via script, open the
.xmlexport file in a text editor. - Search for
<Value>tags under the relevant<Condition>node. - Ensure numeric values are not negative, null, or exceeding
Int32/Int16boundaries depending on the facet’s underlying SMO property type. - Re-import the corrected policy using:
EXEC msdb.dbo.sp_syspolicy_add_policy @policy_stream = N'C:\Policies\corrected_policy.xml';
Step 4: Clear Cached Policy Metadata
- Restart the SQL Server Agent service via Services.msc (Windows Server 2025/Windows 11) to flush cached PBM evaluation data.
- Alternatively, run:
EXEC msdb.dbo.sp_syspolicy_purge_history @policy_id = NULL;
- This clears stale policy history entries that may reference the invalid facet value.
Step 5: Re-run Policy Evaluation
- Right-click the corrected policy in SSMS and select Evaluate.
- Confirm no errors are thrown and the policy returns a Pass/Fail result instead of Error 2386.
Alternative or Verification Steps
- Run
EXEC msdb.dbo.sp_syspolicy_get_conditions;to manually confirm the condition values are now within SMO-documented ranges before re-enabling automated policy execution. - If the error persists, drop and recreate the policy from scratch via the Policy Management Wizard instead of reusing an imported XML file, as this guarantees SMO populates valid default ranges.