0X0000138B

How to Fix ERROR_DEPENDENCY_ALREADY_EXISTS (0X0000138B) on Windows Server

This server error means a service dependency is already registered. I'll show you how to find the culprit and clear it in the registry or with PowerShell.

When You'll See This Error

You're setting up a new service on Windows Server 2019 or 2022—maybe a third-party backup agent or a custom Windows service you wrote in-house. You run sc create with a depend= flag pointing to an existing service like LanmanServer. Suddenly you get:

ERROR_DEPENDENCY_ALREADY_EXISTS 0X0000138B

This also happens when you try to add a dependency through the Service Control Manager GUI (services.msc) and the dependency string already exists in the registry. I've seen it most often when someone tries to make Service A depend on Service B twice—either manually or via a script that ran twice.

What's Actually Going On

The dependency list for a service is a single REG_MULTI_SZ value stored under HKLM\SYSTEM\CurrentControlSet\Services\[YourService]\DependOnService. Each dependency is one string entry. If you add a dependency that's already in that list, Windows throws 0X0000138B instead of silently ignoring it. No duplicates allowed.

The root cause is almost always a script or configuration management tool (Ansible, Puppet, SCCM) that runs the same dependency command twice. Or you manually edited the registry and accidentally double-entered a service name. Either way, the solution is to clean up that list and remove the duplicate.

The Fix: Remove the Duplicate Dependency

I'll give you two methods. Use the PowerShell one unless you're stuck on a very old server. The registry method works everywhere but is riskier if you've never edited the registry.

Method 1: PowerShell (Recommended)

  1. Open PowerShell as Administrator.
  2. Identify your service name. Let's say it's MyBackupSvc.
  3. Run this command to see current dependencies:
    Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\MyBackupSvc" -Name DependOnService
    You'll see a list like LanmanServer, RpcSs, LanmanServer — the duplicate is obvious.
  4. Remove duplicates with this one-liner:
    $deps = (Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\MyBackupSvc" -Name DependOnService).DependOnService
    $unique = $deps | Select-Object -Unique
    Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\MyBackupSvc" -Name DependOnService -Value $unique
  5. Confirm the fix:
    Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\MyBackupSvc" -Name DependOnService
    Should show no duplicates.
  6. Restart the service:
    Restart-Service MyBackupSvc -Force

Method 2: Registry Editor (Legacy)

  1. Open Regedit as Administrator.
  2. Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MyBackupSvc.
  3. Double-click DependOnService on the right pane.
  4. You'll see each dependency on its own line. Delete any duplicate lines—one copy per service name. Don't remove the whole thing unless you want no dependencies.
  5. Click OK, close Regedit.
  6. Restart the service from services.msc or net start MyBackupSvc from an admin command prompt.

When sc config Fails

If you try sc config MyBackupSvc depend= LanmanServer and still get the same error, it means the duplicate is already baked into the registry. The sc command won't overwrite duplicates—it just errors out. That's why you need to edit the registry or use PowerShell first. After that, sc config will work fine.

Still Broken? Check These

  • Service name misspelled? If the dependency name doesn't match an existing service, Windows won't error on the sc create but it'll fail to start later. Verify with Get-Service.
  • Permissions issue? The account running the service might not have rights to start the dependency. Check the service logon account.
  • Circular dependency? Service A depends on B and B depends on A? That's a different error (0X0000138C usually), but I've seen people confuse the two. Break the chain.
  • Reboot needed? If you've edited the registry and the service still won't start, a reboot forces Windows to re-read the service tree. Annoying but reliable.

I know this error tripped me up the first time I saw it—I thought my script was broken. But once you understand it's just a duplicate check, it's a two-minute fix. You've got this.

Related Errors in Server & Cloud
Server disk full from log files – quick fix & stop it coming back Hosting Account Suspended? Stop Overusing CPU 0X000013D7 Cluster Restype Not Supported (0x000013D7) – 3 Fixes 0X000006AC Fix 0X000006AC No Endpoint Found in 5 Steps

Was this solution helpful?

EP
Erropedia Team
Tech Support Editors
The Erropedia editorial team researches and documents real-world tech errors from across Windows, Linux, macOS, networking, databases, cloud platforms, and more. Every solution is reviewed for accuracy and updated as software and systems evolve.