Cause 1: Broken Custom View or Filter with a Stray Character
This one catches most people. You're in Event Viewer, you create a custom view or apply a filter—maybe you typed a semicolon where a comma should go, or the XML got corrupted. Windows Event Viewer uses a specific query language (based on XPath, but not exactly the same). If you screw up a single brace or quote, you get EVENT_E_QUERYSYNTAX (0x80040203).
I've seen this happen when someone pastes a filter from a forum post that includes invisible Unicode characters, or a non-breaking space where a regular space belongs. Also common: adding extra whitespace inside an attribute value—Event Viewer's parser is strict.
How to fix it
- Open Event Viewer (press Win + R, type
eventvwr.exe, hit Enter). - Find the custom view that's broken. It'll either show the error when you click it, or it won't appear at all.
- Delete it: Right-click the view under Custom Views → Delete.
- Recreate the view from scratch—don't reuse the old query text verbatim. Use the built-in filters (by Event Level, by Log, by Event ID).
Why this works: The broken XML is stored in a hidden file under %SystemRoot%\System32\winevt\CustomViews. Deleting through the UI removes that file. Recreating fresh ensures the syntax is auto-generated correctly.
If you need to keep the view, export it first: right-click → Export Custom View.... Then open the .xml in Notepad++ with syntax highlighting. Look for unclosed brackets, missing slashes, or odd characters (like a curly quote instead of straight). Fix those, then import it back. But honestly, recreating is safer.
Cause 2: Corrupted Event Log Cache or Log File
Less common but more annoying: the error pops up when you try to view any log, not just a custom view. That means the query syntax error isn't in your query—it's in Windows' internal attempt to parse the log metadata itself.
What's actually happening here is the event log service (running as EventLog under svchost.exe) caches XML schemas for logs. If that cache gets corrupted—say, after a failed Windows update or a hard shutdown while Event Viewer was open—the cache holds bad syntax. The next time you try to enumerate events, it fails.
How to fix it
- Open Task Manager → Services tab.
- Find EventLog. Right-click → Stop.
- Open File Explorer and go to:
%SystemRoot%\System32\winevt\Logs
Don't delete any .evtx files—those are the actual logs. Instead, delete the hidden cache files in:
%SystemRoot%\System32\winevt\
Look for files named *.CHK or *.TMP. If you see a WepLiveBackup.log or WepCache.ini, delete those too. They'll be recreated when the service starts.
- Go back to Task Manager → Start the EventLog service.
- Try opening Event Viewer again. If the error's gone, the cache was the problem.
The reason step 3 works: Windows Event Log service regenerates the cache files from scratch on startup. The old corrupt cache is gone, and the new one picks up the correct schema from the .evtx files directly. This is a safe operation—you're not losing any actual events.
Cause 3: XML Structure Mismatch in Event Forwarding or Subscriptions
This is specific to advanced setups: you've configured event forwarding from remote machines, or you're using Event Viewer Subscriptions (a feature under Subscriptions in the left pane). Error 0x80040203 shows up when trying to view the collected events or when the subscription fails.
The root cause is usually a mismatch between the query XML that the collector expects and what the source computer sends. For example, you set a query filter on Security logs with Event ID 4625, but the source computer uses a different log name (like Security-System in some domain configurations).
How to fix it
- Open Event Viewer → Subscriptions.
- Right-click the broken subscription → Properties.
- Click Select Events → Edit query manually (the XML view).
- Check the XPath query. A real example that broke on my domain:
<QueryList>
<Query Id="0" Path="Security">
<Select Path="Security">*[System[(EventID=4625)]]</Select>
</Query>
</QueryList>
The issue: the Path attribute in the Select element must match the Path in the Query element. If they differ (e.g., Path="Security" vs Path="Security-System"), Event Viewer throws 0x80040203. Make them identical.
- Also check for escaped characters: HTML entities like
&instead of plain&. The query expects raw XML, not HTML. - Click OK, restart the subscription (right-click → Enable if disabled).
If you're not using subscriptions and still seeing this error, check the Forwarded Events log under Windows Logs. If it shows corrupt entries, clear it: right-click Forwarded Events → Clear Log.... That forces the next incoming event to be parsed cleanly.
Quick-Reference Summary Table
| Causes | Critical Fix | Tools Needed |
|---|---|---|
| Broken custom view / filter (stray chars) | Delete custom view, recreate fresh | Event Viewer UI |
| Corrupted event log cache (service restart) | Stop EventLog, delete *.CHK / *.TMP cache files, restart service | Task Manager, File Explorer |
| XML path mismatch in subscriptions / forwarding | Edit subscription query XML — ensure Path attributes match exactly | Event Viewer subscription properties |
One last thing: if none of this works, run wevtutil el from an admin command prompt. That lists all registered event logs. If you get a syntax error there too, Windows' event log configuration is damaged—run sfc /scannow and consider a repair install. But 99% of the time, it's one of the three above.