What does HRESULT 0xC8000405 (hrNotInitialized) mean?

 
Previous Next
hrInvalidDatabase hrAlreadyInitialized

hrNotInitialized

Diagnostic focus

hrNotInitialized means an ESE call requiring a running instance was made before successful initialization.

This result is the legacy Directory Service backup/restore HRESULT form of the ESE condition normally written as JET_errNotInitialized. Preserve the original value 0xC8000405 when a wrapper also exposes a signed JET_ERR.

The key comparison is: hrTermInProgress means initialization once existed but shutdown has started. The first useful observation is to trace JetCreateInstance/JetSetSystemParameter/JetInit outcomes and the thread that issued the failing call. This evidence shows whether startup, normal operation, shutdown, or restore ordering is the actual boundary.

The ESE objects in play

Diagnostic layerESE instance state and call ordering
Typical API surfaceJetCreateInstance, JetSetSystemParameter, JetInit, JetTerm, and restore entry points
Code-specific boundaryan ESE call requiring a running instance was made before successful initialization
First corrective directionmake initialization success a hard prerequisite and do not publish the instance to workers early

Initialization parameters are generally established before JetInit. Handles derived from an instance are not reusable after teardown.

Evidence that resolves the ambiguity

A useful trace should preserve the first failing operation and the state of the ESE instance state and call ordering.

  • Code-specific observation: trace JetCreateInstance/JetSetSystemParameter/JetInit outcomes and the thread that issued the failing call.
  • the successful or failed JetInit/JetTerm sequence and the component that owns it; associate it with this result rather than with a later generic exception.
  • all still-live sessions and child handles at the transition.
  • the first request accepted after shutdown or before initialization completed.

Nearby results that mean something different

hrInvalidOperationthe engine state, object type, or call ordering makes the requested operation invalid
hrTermInProgressthe instance teardown boundary: new work reached ESE after termination had begun
hrFeatureNotAvailablean API or option is recognized but absent from the engine build or operating mode in use

A disciplined correction path

  1. Freeze the failing request context and record 0xC8000405, the Jet API name, and the current instance/session ownership.
  2. Verify the code-specific precondition: trace JetCreateInstance/JetSetSystemParameter/JetInit outcomes and the thread that issued the failing call.
  3. Apply the targeted fix: make initialization success a hard prerequisite and do not publish the instance to workers early.
  4. Before retrying the operation, reconcile instance state, admission control, and child-handle cleanup.
  5. Add a regression test that reproduces the old failure and proves cleanup leaves no stale handles; then repeat the smallest read-only or disposable test that exercises the corrected precondition.

Actions that can hide or worsen the problem

  • Do not reuse instance-derived handles after the lifecycle transition.
  • Do not start a second initializer to work around an ordering defect.

Developer-facing acceptance test

Build a focused test that reproduces it at the ESE instance state and call ordering layer. The corrected test should change only the decisive condition—an ESE call requiring a running instance was made before successful initialization—and should prove that cleanup is safe if the call still fails.

Technical references


Looking for a different code? Search another status or error code.