Troubleshooting Guide: Error 2819 – Plan Cache Hydration Login Failure
Why This Error Happens
This error occurs because the Plan Cache Hydration subsystem in SQL Server 2025 attempts to establish an internal application login using a replay mechanism that is gated behind the PlanCacheHydrationReplay feature switch. When this switch is left in its default disabled state, the internal service account cannot authenticate against the plan cache store, causing the login handshake to fail with Error 2819. This is typically caused by an incomplete post-upgrade configuration step or a Policy-Based Management template that did not propagate the new SQL Server 2025 feature flags during setup.
Step-by-Step Resolution Guide
Step 1: Verify the Feature Switch Status
- Open a new query window in SQL Server Management Studio (SSMS) connected via the Dedicated Admin Connection (DAC).
- Run
SELECT * FROM sys.dm_server_feature_switches WHERE name = 'PlanCacheHydrationReplay';to confirm the current state (0 = disabled, 1 = enabled). - Check the SQL Server Error Log located at
C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOGfor corroborating entries around the timestamp of the failure.
Step 2: Enable the Feature Switch via Configuration
- Open an elevated PowerShell session on the Windows Server 2025 / Windows 11 host.
- Execute the following command to enable the switch at the instance level:
Set-SqlServerFeatureSwitch -InstanceName "MSSQLSERVER" -FeatureName "PlanCacheHydrationReplay" -Enabled $true - Alternatively, update the registry manually under
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQLServer\FeatureSwitchesby setting thePlanCacheHydrationReplayDWORD value to1.
Step 3: Restart the SQL Server Service
- Open
services.mscor useRestart-Service -Name 'MSSQLSERVER' -Forcein PowerShell to apply the configuration change. - Ensure the SQL Server Agent service is also cycled if Plan Cache Hydration jobs are scheduled through the Agent.
- Monitor the ERRORLOG during startup to confirm the Plan Cache Hydration module initializes without the previous authentication error.
Step 4: Validate Service Account Permissions
- Confirm the service account running the SQL Server instance has the
CONNECT SQLpermission and is a member of the##MS_PlanCacheHydrationLogin##internal login group. - Use
SELECT * FROM sys.server_principals WHERE name LIKE '%PlanCacheHydration%';to verify the internal login exists and is enabled.
Alternative or Verification Steps
- To verify the fix, run
SELECT * FROM sys.dm_server_feature_switches WHERE name = 'PlanCacheHydrationReplay';again and confirm the value returns1, then check that Error 2819 no longer appears in the ERRORLOG after a service restart. - If the issue persists, as a fallback, disable Plan Cache Hydration entirely via
EXEC sp_configure 'plan cache hydration', 0; RECONFIGURE;to stop the login attempts until a full feature rollout can be scheduled.