Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

SQL Server Error 567: Fix "Not a Recognizable Trace File

· 7 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Error 567 means SQL Server tried to open a trace file that is truncated, corrupted, empty, or not actually a trace file at all — usually because the profiler trace, server-side trace, or default trace was interrupted mid-write, was copied while still in use, or the path points at the wrong file. The quickest way out is to find the offending file, stop whatever is writing to it, and either point the trace at a new file or repair the existing one with the steps below. First, confirm which trace is failing: the default trace, a server-side trace you created with sp_trace_create, or a Profiler trace you are trying to replay or load.

What You'll Need

  • SQL Server Management Studio (SSMS) or another client that can run T-SQL, with sysadmin rights on the instance.
  • The full path of the .trc file SQL Server is complaining about. Error messages and the SQL Server error log usually give it to you.
  • Read access to the folder holding the trace file (the SQL Server service account owns the default trace location).
  • A maintenance window if the fix involves stopping or restarting a trace that other people are relying on.
  • Optional: a copy of the file in a scratch folder, so you can experiment without touching the original.

Step-by-Step

  1. Identify the file in the error. Run this to list every running trace and where it writes:

SELECT * FROM sys.traces;

Match the path column to the file named in the error. If the file is in a folder ending in \Log\ with a name like log_*.trc, it is very likely the default trace.

  1. Check the file actually exists and has size. In File Explorer or with DIR in a command prompt, confirm the file is present, is not 0 bytes, and looks like a recent write. A 0-byte file is treated as unreadable. Also confirm the extension is .trc, not .trn (transaction log backup), .ldf, or a log file renamed by mistake.
  2. Stop whatever is writing to it before you touch it. Copying or opening a trace file that a running trace still has open is the single most common cause of half-written, unreadable files. For a server-side trace, stop it with:

EXEC sp_trace_setstatus @traceid = <id>, @status = 0;

then close it with @status = 2. For the default trace, you can stop it with sp_configure on the default trace enabled option (set to 0), then back to 1 when you are done.

  1. Try to read the file you already have. In SSMS, use File > Open > File, choose the .trc file, and see whether SQL Server opens it. If it opens, the file is fine and the error came from a different path — go back to step 1. If it fails with error 567, the file is damaged or was never a valid trace. Labels in SSMS can differ slightly by version and language, but the File > Open > File route is stable.
  2. Check for a truncated tail. Truncation usually happens when the disk filled, the service was killed, or the file was copied while in use. If you have a backup or an archived copy from before the crash, use that as your starting point and replay or read it instead of the broken file.
  3. Recreate the trace output cleanly. If the file cannot be recovered, that is usually the right answer — a trace is diagnostic output, not a source of truth, so you can regenerate it. For a server-side trace, create a new one with a fresh path:

DECLARE @id int; EXEC sp_trace_create @id OUTPUT, 0, N'C:\Traces\newtrace';

Add your events and columns with sp_trace_setevent, then start it with sp_trace_setstatus @id, 1. Default trace data is recreated automatically once you re-enable the default trace (set default trace enabled back to 1 and restart the service if required). Your new file starts empty — you lose the old diagnostic window, so note the time you made the switch.

  1. Verify the new trace is writing. Re-run SELECT * FROM sys.traces; and check the status column shows the trace running. Then confirm the file size grows over a few minutes. If it stays at zero, the service account cannot write to the folder — fix permissions on the target folder, preferably a dedicated folder outside the data and log directories.
  2. Clean up old trace files. Traces that were never stopped leave files behind and can max out a drive. Stop unused traces with sp_trace_setstatus and delete the orphaned files only after you are sure no trace points at them. Deleting a file a running trace is still writing to produces the same error again.

Common Mistakes

  • Copying the .trc while the trace is running. The copy captures a partial header and cannot be read. Always stop the trace first, or copy a file the trace has already rolled away from.
  • Confusing the trace file with the rollover files. A server-side trace with a maximum file size closes its current file and starts a new numbered one. The newest rollover file may be the one in use, while an older one is fine to read.
  • Passing a path instead of a trace ID. sp_trace_setstatus needs the integer trace ID from sys.traces, not a file path or a trace name.
  • Assuming the error is about the default trace. The message names a file; check that exact path rather than toggling the default trace off and on by reflex.
  • Renaming a file to .trc. Changing the extension does not make a text or XML file a valid trace file. SQL Server reads the binary header and rejects anything that does not match.
  • Leaving the default trace off after testing. It quietly collects useful information about configuration changes; turn it back on when you are finished.

Tips

  • Give traces their own folder with generous free space, and keep trace output off the drive holding your database files.
  • Set a maximum file size when you create a server-side trace so a runaway trace cannot fill the disk.
  • Name traces and files descriptively, with a date, so you can tell the live file from an archived one at a glance.
  • If you only need event data once, run a session in Extended Events instead of a legacy trace — the output is easier to schedule and survives interruption better.
  • Keep a short note of trace IDs and paths in your runbook; when the error appears later, you will know which trace to stop.

Troubleshooting

The file opens but shows no events. The trace was created but no events were added, or the filter matched nothing. Recreate it and add events with sp_trace_setevent before starting it.

The same error returns after you recreate the trace. Something is still pointing at the old path or file. Check scheduled jobs, startup procedures, and monitoring tools that create traces, and confirm no script recreates the broken file.

The new trace file stays at 0 bytes. The SQL Server service account lacks write permission on the folder, or the drive is full. Grant write permission on a dedicated folder and check free space.

You cannot stop the trace. Confirm the ID from sys.traces and that you have ALTER TRACE permission. If a client session crashed and left the trace running, restarting the SQL Server service stops all server-side traces — do this in a maintenance window, since it disconnects users.

The error names a file on a network share. SQL Server writing traces to a UNC path is fragile and permission-sensitive. Move the trace to a local folder the service account owns.

Frequently Asked Questions

Is error 567 caused by data corruption?

No. It concerns the trace file itself, not your databases. Your data files and transaction logs are unaffected, and the fix is to replace or regenerate the trace output.

Can I repair a damaged trace file?

There is no supported repair tool for .trc files. If you have a good earlier copy or a rollover file, use that; otherwise recreate the trace and accept the loss of the old window.

Does this error affect the default trace only?

No. Any trace file SQL Server tries to open can trigger it, including Profiler traces saved to disk and traces you load into SSMS, not just the default trace.

Will stopping the default trace break anything?

The instance keeps running, but you lose the automatic record of configuration changes and some diagnostic events. Re-enable it as soon as your file issue is resolved.

Why did this start after a restart?

A restart can interrupt a file write, leaving a truncated tail, or a startup procedure can point at a file path that no longer exists. Check sys.traces and the error log for the path being opened.