Troubleshooting Guide: Error 594 — fntracegettable XML Conversion Not Supported in Fiber Mode
Why This Error Happens
This error occurs because SQL Server 2025 is running in lightweight pooling mode (fiber mode), which uses Windows fibers instead of native threads to handle worker scheduling. The fn_trace_gettable function relies on internal XML parsing routines (via MSXML/SQLXML libraries) that are not thread-safe in a fiber-based scheduling context, so SQL Server blocks the conversion to prevent instability or memory corruption. This is almost always tied to the lightweight pooling server configuration option being enabled, typically as an attempted CPU optimization on high-throughput OLTP systems.
Step-by-Step Resolution Guide
Step 1: Confirm Fiber Mode Is Enabled
- Connect to the instance via SQL Server Management Studio (SSMS) or
sqlcmd. - Run the following query to check the current configuration:
SELECT name, value, value_in_use
FROM sys.configurations
WHERE name = 'lightweight pooling';
- If
value_in_usereturns1, fiber mode is active and is the root cause of the error.
Step 2: Disable Lightweight Pooling
- Execute the following T-SQL commands to turn off fiber mode:
EXEC sp_configure 'show advanced options', 1;
RECONFIGURE;
EXEC sp_configure 'lightweight pooling', 0;
RECONFIGURE;
- Note that this change requires a full restart of the SQL Server service to take effect (it is not a dynamic setting).
Step 3: Restart the SQL Server Service
- Open Services.msc on Windows Server 2025 / Windows 11.
- Locate
SQL Server (MSSQLSERVER)or your named instance (e.g.,SQL Server (SQLEXPRESS)). - Right-click and select Restart.
- Alternatively, use PowerShell for a scripted restart:
Restart-Service -Name 'MSSQLSERVER' -Force
Step 4: Re-run the Trace Query
- After the service restarts, re-attempt the query that previously failed:
SELECT * FROM fn_trace_gettable('C:\Traces\trace_log.trc', DEFAULT);
- Confirm that the XML columns (if any) in the trace output now render/convert without throwing Error 594.
Step 5: Migrate to Extended Events (Recommended Long-Term Fix)
- Since SQL Trace (
fn_trace_gettable) is a deprecated feature carried forward into SQL Server 2025, consider migrating monitoring workloads to Extended Events (XEvents). - Use the New Session Wizard in SSMS under
Management > Extended Eventsto replace legacy trace-based capturing entirely, avoiding fiber-mode conflicts permanently.
Alternative or Verification Steps
- Verify the fix: Re-run
SELECT value_in_use FROM sys.configurations WHERE name = 'lightweight pooling';and confirm it returns0. Then execute a test trace conversion query to ensure no Error 594 is thrown. - Alternative fix: If fiber mode must remain enabled for specific COM+ or legacy application dependencies, export trace data to a
.trcfile and parse it externally using SQL Server Profiler (client-side) instead offn_trace_gettable, since Profiler does not run inside the fiber-mode-affected engine thread.