That ERROR_BROKEN_PIPE message is frustrating — you're in the middle of something and suddenly the connection drops. Let's get it fixed fast.
The Most Likely Fix: Restart the Service or App
In 9 out of 10 cases, this error happens because the program on the other end of the pipe closed or crashed. The pipe itself is fine, but your app doesn't know the other side disconnected.
- Press Ctrl + Shift + Esc to open Task Manager.
- In the Processes tab, look for the application that's showing the error. Common culprits:
sqlservr.exe,ssh.exe,cmd.exe, or any app that uses named pipes. - Right-click the process and choose End task. You'll see the window close.
- Wait 10 seconds — the system needs a moment to release the pipe handle.
- Restart the application fresh. So if it was a command prompt, open a new one. If it was SQL Server Management Studio, launch it again.
After you restart, try the same action that originally triggered the error. For example, if you were running a query, run it again. If the error doesn't come back, you're done. The fix took under a minute.
What to expect
When you end the task, the program closes immediately — no warning. That's fine. When you reopen it, it should connect to the pipe fresh. The broken pipe state is cleared when the process exits.
If That Doesn't Work: Restart the Service That Owns the Pipe
Some pipes are owned by Windows services, not by your running app. For instance, SQL Server uses named pipes for local connections. Restart the service instead.
- Press Win + R, type
services.msc, hit Enter. - Find the service that matches your app. For SQL Server, it's SQL Server (MSSQLSERVER) or SQL Server (YOURINSTANCE). For SSH, it's OpenSSH SSH Server.
- Right-click the service and choose Restart. A small spinning icon appears while it restarts.
- After the status says Running, try your app again.
This works because restarting the service kills any orphaned pipe instances. It's like hanging up a dead phone line and dialing again.
Why This Error Happens
The error code 0X0000006D (which is decimal 109) means the pipe connection was terminated before your program finished reading or writing. Windows gives you this error when:
- The remote program crashed or closed without notice — for example, an SSH server that timed out.
- A network cable got unplugged while a pipe transfer was active.
- The local program ran out of memory or was killed by Task Manager.
- A firewall or antivirus tool blocked the pipe traffic mid-stream.
Pipes are just like telephone conversations. If the other person hangs up while you're still talking, you get silence on your end. Windows reports that silence as ERROR_BROKEN_PIPE.
Less Common Variations
1. SQL Server Named Pipes Error
If you see this error when connecting to SQL Server using Named Pipes protocol, the fix is often different. Open SQL Server Configuration Manager, go to SQL Server Network Configuration > Protocols for MSSQLSERVER. Right-click Named Pipes, choose Enable if it's disabled, then restart the SQL Server service. After you enable it and restart, try the connection again. You should see it succeed.
2. SSH Broken Pipe
With SSH, this error usually happens because your session timed out. Open ~/.ssh/config (or create it) and add these lines:
Host *
ServerAliveInterval 60
ServerAliveCountMax 5
This tells your SSH client to send a keep-alive packet every 60 seconds. After saving the file, reconnect. The error should stop appearing on long idle connections.
3. Command Prompt or PowerShell Pipe
If you're piping output from one command to another — like dir | find "txt" — and the source command finishes before the receiver reads all data, you get this error. The fix: use a temporary file instead. Run dir > temp.txt then find "txt" < temp.txt. This separates the two processes so they don't share a live pipe.
How to Prevent It From Coming Back
You can't prevent every broken pipe — sometimes the remote side just crashes. But you can reduce how often you see it.
- Set timeouts properly. If your app has a timeout setting for named pipes, set it to at least 30 seconds. This gives the remote side time to respond before Windows kills the pipe.
- Keep your network stable. Use wired connections for critical tasks. Wi-Fi drops can trigger this error.
- Update your drivers. Old network drivers can cause pipes to drop unexpectedly. Check your motherboard or NIC manufacturer's site for the latest driver.
- Disable IPv6 if you don't need it. Some apps get confused with IPv6 pipe naming. Go to Control Panel > Network and Sharing Center > Change adapter settings, right-click your adapter, uncheck Internet Protocol Version 6 (TCP/IPv6), then click OK. This has fixed the error for several of my clients.
One last thing: if you're a developer and your own app sends this error, check your code for unclosed pipe handles. Every CreateNamedPipe or CreateFile call on a pipe needs a matching CloseHandle. Leaking handles leads to broken pipes on the next operation.
That's it. For most people, the restart fixes it. For the rest, the service restart or SSH config change does the trick. You shouldn't see this error again unless something else breaks.