| Previous | Next |
| hrContentsExpired | hrOutOfThreads |
hrFileClose
State represented by this code
For hrFileClose, a correct handler first decides whether the value is success, warning, or failure, then examines the documented outputs. The decisive boundary is ESE could not complete the operating-system close of a database, log, temporary, or backup file.
The stored Value is 0xC8000066 (negative JET error -102; -102). The HRESULT carries failure severity, so output state must be treated according to the individual API contract. Current ESE documentation uses JET_errFileClose for the corresponding published JET condition.
The first useful distinction is that the data transfer may have succeeded even though final close failed; ignoring it can leave durability and cleanup uncertain. Start by capture the file path, handle owner, preceding I/O result, underlying Win32 error, and whether flush or remote-storage semantics delayed close. That separates a reproducible incident from a later generic cleanup or service error.
Data for a reproducible incident
Preserve the first result before retries, cleanup, service restart, or file replacement changes the evidence. The diagnostic record should identify the exact API phase and the owner of every handle or artifact involved.
- Code-specific observation: capture the file path, handle owner, preceding I/O result, underlying Win32 error, and whether flush or remote-storage semantics delayed close.
- Concurrency at first failure: record it together with this result and the timestamp of the first occurrence.
- Win32 status and file/operation: record it together with this result and the timestamp of the first occurrence.
- Thread, handle, and I/O counts: record it together with this result and the timestamp of the first occurrence.
- System commit and volume state: record it together with this result and the timestamp of the first occurrence.
Objects and state involved
| Diagnostic layer | operating-system file, thread, and asynchronous-I/O resources used by ESE |
|---|---|
| Relevant API surface | database/log file I/O, worker creation, backup reads, and background tasks |
| Code-specific boundary | ESE could not complete the operating-system close of a database, log, temporary, or backup file |
| Narrow corrective direction | treat close as part of the operation, preserve the first error, and verify the file and volume before reuse |
The first lower-level Win32 error is more useful than later cascading ESE failures., resource exhaustion should be measured at the moment of failure, before retries alter counts.
Actions that can make diagnosis worse
- do not discard a close or flush error during cleanup.
- do not create unbounded retries under resource pressure.
- do not discard the first lower-level Win32, RPC, or JET result merely because a later cleanup call returned a more familiar error.
Nearby ESE or AD backup states
It specifically means that the data transfer may have succeeded even though final close failed; ignoring it can leave durability and cleanup uncertain. Related values below can appear in the same workflow but require a different response:
hrOutOfThreads | ESE could not start a worker thread needed by the requested operation |
|---|---|
hrTooManyIO | the engine reached its outstanding-I/O throttle and refused to queue more storage work |
hrBFPageNotFound | the requested page was not present in the buffer-manager context used by the operation |
Keep the original constant and hexadecimal value in telemetry. Replacing it with “backup failed” or “database warning” removes the state information needed to select the next legal API call.
Next actions
- Record it,
0xC8000066, the API name, the current phase, and all live context or file owners. - Verify the decisive condition by capture the file path, handle owner, preceding I/O result, underlying Win32 error, and whether flush or remote-storage semantics delayed close.
- Apply only the narrow correction: treat close as part of the operation, preserve the first error, and verify the file and volume before reuse.
- After it, recreate any context invalidated by the failure; do not carry stale HBC, cursor, file, or restore-map state into the retry.
- repeat the smallest non-destructive test that reaches the same boundary, then verify both the return value and the resulting file, cursor, backup, or database state.
Acceptance criteria for a fix
Technical references
- ESE error-code table — API ordering, file semantics, warning/error interpretation, or recovery behavior relevant to it.
- ESE files
- Open-source ESE implementation
- Microsoft JET_ERR enumeration
Looking for a different code? Search another status or error code.