Windows ยท Event Log ยท SRUM
Tens of thousands of ESENT errors a day, quietly shredding your
Application log โ and why the fix most people are given is worse than the problem.
Your Windows Application event log fills with ESENT errors logged by
svchost as SRUJet. Usually one of these four:
| Event | Message |
|---|---|
| 483 | An attempt to create the folder "C:\Windows\system32\SRU\" failed with system error 5 (0x00000005): "Access is denied." |
| 488 | An attempt to create the file "C:\Windows\system32\SRU\SRUtmp.log" failed with system error 5 (0x00000005): "Access is denied." |
| 413 | Unable to create a new logfile because the database cannot write to the log drive. Error -1032. |
| 490 | An attempt to open the file "C:\Windows\system32\SRU\SRUDB.dat" for read / write access failed with system error 5. |
Each ID marks a different stage of the same failure, and ESENT is a shared
provider โ not every ESENT error is SRUM. The
ESENT SRUJet error reference covers what each one
means, how to tell SRUM apart from Windows Update and Search, and how to count them.
On the machine this was written from, the fault produced 40,899 errors in four days โ one roughly every eight seconds.
The Application log is circular and capped at 20 MB by default. At that rate it rolls over in days. On the reference machine the Application log retained just 5 days of history while the System log still held 11 months. Every application crash record older than that was gone.
That is the real damage. SRUM itself โ the System Resource Usage Monitor โ only backs Task Manager's App History tab and per-app network usage stats. Nothing important depends on it. The flood is the problem, not the missing feature.
C:\Windows\System32\SRU is either missing, or exists with only
inherited permissions from System32.
Inherited System32 rights give BUILTIN\Users read-only access. The
Diagnostic Policy Service (DPS) runs as
NT AUTHORITY\LocalService, which falls under Users โ so it cannot write its
database. DPS retries every eight seconds, and that retry loop is the flood.
There is a second wrinkle. sc qsidtype DPS reports RESTRICTED,
meaning the service's token is access-checked against its service SID.
Granting LocalService is not sufficient โ the grant has to name DPS itself.
The most widely circulated advice for these errors is to take ownership of
C:\Windows as the group Everyone, applied to all
subcontainers and objects.
Don't. It hands every account on the machine control of your Windows directory. It is a serious security hole, awkward to reverse, and completely unnecessary. It was challenged on Microsoft's own Q&A with "Are you seriously advising to give ownership to group Everyone here?!" โ and that objection is right.
Grant the DPS service SID inheritable full control on one folder:
icacls C:\Windows\System32\SRU /grant "*S-1-5-80-2970612574-78537857-698502321-558674196-1451644582:(OI)(CI)F"
Service SIDs are derived deterministically from the service name, so that literal is the
same on every Windows install. Using the SID rather than NT SERVICE\DPS also
makes it locale-proof โ the friendly form is translated on non-English Windows.
It mirrors what Windows already does for other service-owned data folders. Look at the event log's own directory:
C:\Windows\System32\winevt\Logs NT SERVICE\EventLog:(OI)(CI)(F)
NT AUTHORITY\SYSTEM:(OI)(CI)(F)
BUILTIN\Administrators:(OI)(CI)(F)
The EventLog service also runs as LocalService, yet Windows
grants its service SID โ not LocalService โ inheritable full control on
its own data folder. This fix follows that convention rather than inventing one.
Do not verify with a fixed lookback window such as "errors in the last hour". That window spans the moment you applied the fix, so it is still full of pre-fix events and will report a successful repair as a failure.
Anchor instead to when the repair actually took effect. SRUDB.dat's creation
time is the precise answer: DPS cannot create that file until permissions are right, so its
birth is the success. On the reference machine:
last SRUJet error 01:08:55
SRUDB.dat created 01:08:56
Two further details worth knowing:
Get-WinEvent -StartTime truncates to whole seconds, so
anchoring exactly on a creation timestamp sweeps in retries logged milliseconds
before it. A two-second guard fixes this.SRUM only flushes SRUDB.dat every 30โ60 minutes. An empty
folder shortly after the repair is inconclusive, not failed โ don't undo a working fix
because the database hasn't appeared yet.
Nine files in C:\Windows\System32\SRU: SRUDB.dat,
SRUDB.jfm, SRU.chk, SRU.log,
SRU00001.log, SRUtmp.log, SRUres00001.jrs,
SRUres00002.jrs, tmp.edb.
Repair-SrumDatabase.ps1 does all of the above โ diagnosis, repair, and
anchored verification. It is read-only by default; -Fix and
-Revert are opt-in and require elevation.
# Read-only diagnosis. Changes nothing.
.\Repair-SrumDatabase.ps1
# Diagnose, repair, verify. Requires elevation.
.\Repair-SrumDatabase.ps1 -Fix
# Undo the permission grant.
.\Repair-SrumDatabase.ps1 -Revert
System32\SRU. The grant is reasoned from
how Windows treats comparable service-owned folders, plus the RESTRICTED
service SID type. It is minimal in scope and reversible.The default 20 MB Application log is small for any busy machine. Whatever you decide about SRUM, this is worth doing:
wevtutil sl Application /ms:209715200 # 200 MB