What does Windows error code 1051 (ERROR_DEPENDENT_SERVICES_RUNNING) mean?

 
Previous Next
ERROR_NOTIFY_ENUM_DIR ERROR_INVALID_SERVICE_CONTROL

ERROR_DEPENDENT_SERVICES_RUNNING

Running dependent services prevent the requested stop

Service dependencies affect both startup ordering and stop operations. The Service Control Manager can enumerate services that depend on a target service. ERROR_DEPENDENT_SERVICES_RUNNING means a stop request reached a service that still has running dependents, so taking the target down would violate that dependency chain.

Enumerate active dependents and stop them in dependency order before retrying the target. Do not confuse dependent services with services on which the target itself depends; the direction matters. Automation should also handle state transitions rather than assuming that a successful stop request makes a service immediately stopped. Query each dependent state and wait for STOP_PENDING to complete. If an unexpected service appears in the chain, inspect its configured dependencies in the SCM database rather than forcing termination of the shared process.

What to inspect

  • Use EnumDependentServices to identify active dependents of the target.
  • Stop leaf dependents first and wait for pending transitions to finish.
  • Review configured dependency names when the chain differs from deployment expectations.

References


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