| Previous | Next |
| hrInvalidRecips | hrRestoreMapExists |
hrCouldNotConnect
Interpretation in the backup state machine
For hrCouldNotConnect, a correct handler first decides whether the value is success, warning, or failure, then examines the documented outputs. The decisive boundary is the backup client could not establish the required session with the selected server or running Directory Service.
The stored Value is 0xC7FF0007 (facility-specific HRESULT). The HRESULT carries failure severity, so output state must be treated according to the individual API contract. The legacy this result name comes from the Windows Directory Service backup/restore message header.
The first useful distinction is that hrCommunicationError means an established local backup exchange failed; this code can occur before a usable backup context exists. Start by record the resolved server name, local/remote expectation, DsIsNTDSOnline result, RPC status, service state, credentials, and firewall path. That separates a reproducible incident from a later generic cleanup or service error.
Start with these observations
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: record the resolved server name, local/remote expectation, DsIsNTDSOnline result, RPC status, service state, credentials, and firewall path.
- RPC and Win32 status: record it together with this result and the timestamp of the first occurrence.
- Security context and privilege: record it together with this result and the timestamp of the first occurrence.
- Last completed file boundary: record it together with this result and the timestamp of the first occurrence.
- Server resolution and service state: record it together with it and the timestamp of the first occurrence.
Use hashes, lengths, IDs, generation numbers, and redacted samples instead of copying directory contents or sensitive database values into routine logs. For this it investigation, a complete provenance chain is often more useful than a second automatic retry.
Objects and state involved
| Diagnostic layer | Directory Service state, RPC connectivity, authentication, and the HBC transport |
|---|---|
| Relevant API surface | DsIsNTDSOnline, DsSetAuthIdentity, DsBackupPrepare, and subsequent file transfer calls |
| Code-specific boundary | the backup client could not establish the required session with the selected server or running Directory Service |
| Narrow corrective direction | restore service and RPC reachability, then create a new backup context rather than reusing the failed one |
The legacy API requires the directory service to be running for backup and offline for restore., transport failure can invalidate the context and make partial file data unusable as a set.
Recovery or retry plan
- Record it,
0xC7FF0007, the API name, the current phase, and all live context or file owners. - Verify the decisive condition by record the resolved server name, local/remote expectation, DsIsNTDSOnline result, RPC status, service state, credentials, and firewall path.
- Apply only the narrow correction: restore service and RPC reachability, then create a new backup context rather than reusing the failed one.
- 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.
Not the same as
It specifically means that hrCommunicationError means an established local backup exchange failed; this code can occur before a usable backup context exists. Related values below can appear in the same workflow but require a different response:
hrCommunicationError | the local backup protocol failed after the operation began exchanging control or file data |
|---|---|
hrNoFullRestore | an incremental restore was requested before a full backup had established the destination database baseline |
hrDatabaseAttached | the database was already attached to the instance when another attach operation was requested |
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.
Actions that can make diagnosis worse
- do not report a connectivity problem as database corruption.
- do not resume in the middle of a file without a protocol guarantee.
- do not discard the first lower-level Win32, RPC, or JET result merely because a later cleanup call returned a more familiar error.
Acceptance criteria for a fix
A useful regression test for this HRESULT should force the condition “the backup client could not establish the required session with the selected server or running Directory Service”, call one documented API transition, and assert the exact HRESULT. The corrected the case should change only the decisive precondition and should verify cleanup as well as the primary output. For the result backup or restore path, also prove that the resulting set can be enumerated and that no file handle or context remains active after finalization.
Technical references
- AD backup walkthrough — API ordering, file semantics, warning/error interpretation, or recovery behavior relevant to it.
- DsBackupPrepare contract
- AD backup errors
Looking for a different code? Search another status or error code.