| Previous | Next |
| QUERY_E_INVALID_OUTPUT_COLUMN | QUERY_E_DIR_ON_REMOVABLE_DRIVE |
QUERY_E_INVALID_DIRECTORY
The directory query scope is invalid
QUERY_E_INVALID_DIRECTORY is the failure HRESULT 0x8004160A (-2147215862 signed; 2147751434 unsigned). Its severity bit is 1, facility is 4 (FACILITY_ITF), and code is 0x160A. AllStat describes it as “Invalid directory name.”
Exact contract boundary
This result belongs to legacy Windows query execution and is returned while converting a caller path, URL or virtual scope into a searchable catalog location. The exact condition is: a malformed, unresolvable or out-of-catalog directory identifier. This stage matters because converting the result to a generic COM failure removes the information needed to choose the owner and retry policy.
This value belongs to the legacy Indexing Service query-execution contract. It can surface through the Indexing Service OLE DB provider or related query interfaces, but it should not be presented as a generic result from every modern Windows Search API. Current Windows Search SQL documentation can clarify related clause concepts, but it does not establish that every current search API returns this legacy query-execution constant.
Input or state defects
- This result can appear when original scope disagrees with the state expected while converting a caller path, URL or virtual scope into a searchable catalog location.
- a stale or transformed normalized scope can make the component observe that a malformed, unresolvable or out-of-catalog directory identifier.
- an incomplete path type hides the distinction needed to separate this HRESULT from a later catalog or service failure.
- changes in catalog roots between validation and execution can reproduce the result even when the user-visible input looks unchanged.
- Retrying this result with the same resolved volume identity leaves the decisive contract violation intact.
The strongest hypothesis for this HRESULT must account for the operation—converting a caller path, URL or virtual scope into a searchable catalog location—and the documented condition. A failed command or empty rowset is only the visible symptom; it does not identify which restriction, projection, sort, scope, timeout or catalog state violated the query contract.
Incident record
- preserve original scope before objects or work items are released.
- associate normalized scope with the exact UTC timestamp and correlation identifier.
- compare failing and known-good values for path type under the same provider or handler version.
- record the source and normalization path of catalog roots, not only its display form.
- use resolved volume identity to test whether the failure belongs to parsing, execution, indexing or capability negotiation.
- preserve provider command text and dialect before objects or work items are released.
Evidence for this HRESULT should reflect what the component actually received. Redact private literals if necessary, but keep clause boundaries, canonical properties, parameter types, dialect and parser or provider offsets.
How to isolate the cause
- Capture original scope and normalized scope at the call boundary that returns this result.
- confirm the operation reached converting a caller path, URL or virtual scope into a searchable catalog location with the intended path type.
- perform the decisive check: record original and normalized forms, determine the API-required scope format and confirm catalog membership.
- reduce the case until changing catalog roots alone changes the HRESULT or proves it irrelevant.
- apply the recovery only after verifying resolved volume identity; preserve the original result for comparison.
A useful control for this HRESULT changes one dimension at a time. Begin with a known-good minimal command against the same catalog and restore projection, restriction, sorting, grouping and scope one component at a time.
Restoration strategy
Correct canonicalization or catalog configuration before retrying. Retry it only after the responsible input or state changes and the previous operation has completed or been cancelled. Backoff helps only with measured transient load or timeout; it cannot repair invalid clauses, projection metadata, scopes or command state.
Scope of the result
It does not by itself prove catalog corruption, service outage, access denial or absence of matches; the query stage and provider records must identify the failing clause or state. Without code-specific evidence for this HRESULT, the value also cannot identify which wrapper, configuration, handler or service transition introduced the condition.
Comparison with adjacent codes
QUTIL_E_CANT_CONVERT_VROOT is specifically virtual-root conversion; QUERY_E_DIR_ON_REMOVABLE_DRIVE is media policy. Keep the symbolic HRESULT beside the stage name in telemetry because nearby constants may require different owners, user messages and retry rules despite the same visible symptom.
Developer and administrator guidance
Retain final command text, dialect, catalog generation, parameter values, timeout, cancellation state and chained OLE DB error records. Do not log credentials or unrestricted document content. Before rebuilding the catalog or restarting the provider for this HRESULT, reproduce the minimal command and preserve its chained errors.
Example from a search pipeline
A web application sends `/docs` where a configured virtual or physical scope is required. Logging both forms reveals the missing translation. A regression test for this HRESULT should assert the decisive evidence, change only the responsible condition, and include one neighboring HRESULT so future code cannot collapse distinct failures into a generic message.
Official Microsoft references
- Microsoft: Indexing Service query-execution values
- Microsoft: Windows Search WHERE clause
- Microsoft: OLE DB provider for Indexing Service
- Microsoft: ISearchQueryHelper
Looking for a different code? Search another status or error code.