Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 043bebb

Browse files
blinkagent[bot]blink-so[bot]matifalinickvigilantemdanter
authored
docs: add Coder Desktop stale-tunnel recovery and improve macOS log capture (#26735)
## What Adds a **Recovering from a stale tunnel** section to the Coder Desktop user guide, with separate macOS and Windows procedures, and tightens the existing macOS log-collection instructions. ## Why Users in the field have hit a state where Coder Desktop's menu bar / tray shows **Coder Connect** as enabled but the embedded tunnel is no longer working: * `workspace.coder` fails to resolve (`No such host`), or * DNS returns stale `fd60:627a:a42b::/48` addresses that no longer route, causing `coder ssh`, file sync, and the directory picker to hang. Related issues: * #26669 — `ExistsViaCoderConnect` false positives when Coder Desktop has stale DNS * coder/coder-desktop-windows#171 — Tray reports Coder Connect as healthy while tunnel/DNS is broken Until the underlying state-management gap is fixed in the apps, the docs should give users (and support) a safe, repeatable way to recover without rebooting. ## Changes `docs/user-guides/desktop/index.md`: 1. **New "Recovering from a stale tunnel" section** under Troubleshooting: * **macOS:** stop the VPN configuration with `scutil --nc stop`, quit the app via `osascript`, restart the helper daemon in place with `launchctl kickstart -k system/com.coder.Coder-Desktop.Helper`, flush DNS caches, then relaunch. * Includes a warning to **not** use `launchctl bootout`, which removes the daemon from launchd's system domain entirely and is not re-bootstrapped on app relaunch. * Includes a verification step using the built-in sentinel hostname `is.coder--connect--enabled--right--now.coder` (defined in `tailnet/conn.go` as `IsCoderConnectEnabledFmtString`) so users don't need a workspace name to confirm the tunnel is healthy. * Uses `dig @fD60:627a:a42b::53` (explicit server) and `dscacheutil -q host -a name` because plain `dig` does not respect the macOS system resolver. * **Windows:** stop the app and `Coder Desktop` service, flush DNS, restart, then verify the NRPT rule and Wintun adapter. Notes that `ipconfig /flushdns` does not reset the embedded resolver and that filtering agents (e.g., Zscaler) may still shadow `.coder` lookups. 2. **macOS log-collection improvements:** * Switch the predicate from `subsystem == "com.coder.Coder-Desktop"` to `subsystem BEGINSWITH "com.coder.Coder-Desktop"` so the export captures the app, helper daemon, and network extension (which all log under prefixed subsystems). * Add a `log stream` example for live tailing while reproducing an issue. ## Verification * `npx markdownlint-cli2 docs/user-guides/desktop/index.md` — 0 errors. * macOS recovery steps were validated end-to-end on a real install (the `kickstart -k` form, in particular, was confirmed to restart the helper without breaking the install, unlike `bootout`). --- Created on behalf of @mdanter --------- Co-authored-by: blink-so[bot] <211532188+blink-so[bot]@users.noreply.github.com> Co-authored-by: Atif Ali <[email protected]> Co-authored-by: Nick Vigilante <[email protected]> Co-authored-by: Matyas Danter <[email protected]>
1 parent 57dc47d commit 043bebb

1 file changed

Lines changed: 130 additions & 3 deletions

File tree

docs/user-guides/desktop/index.md

Lines changed: 130 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,121 @@ You can also configure a `Updater:ForcedChannel` string value to lock users to a
169169
- Check system permissions for network extensions
170170
- Ensure only one copy of Coder Desktop is installed
171171

172-
### Collecting Logs
172+
### Recover from a stale tunnel
173+
174+
If the menu bar or tray shows **Coder Connect** as enabled but workspaces are
175+
unreachable (SSH hangs, `workspace.coder` fails to resolve, or file sync cannot
176+
list the workspace directory), the embedded tunnel may be in a stale state.
177+
Restart the helper components first.
178+
If that doesn't resolve the issue, reboot your computer.
179+
180+
<div class="tabs">
181+
182+
#### macOS
183+
184+
Run the following commands in a terminal.
185+
These steps leave the app and helper daemon installed.
186+
They only restart the running tunnel and flush DNS caches.
187+
188+
1. Stop the Coder VPN configuration:
189+
190+
```shell
191+
vpn_name=$(scutil --nc list | grep "com.coder.Coder-Desktop" | awk -F'"' '{print $2}' | tail -n1)
192+
if [ -n "$vpn_name" ]; then scutil --nc stop "$vpn_name"; fi
193+
```
194+
195+
2. Quit the Coder Desktop app:
196+
197+
```shell
198+
osascript -e 'tell application id "com.coder.Coder-Desktop" to quit'
199+
```
200+
201+
3. Restart the helper daemon in place:
202+
203+
```shell
204+
sudo launchctl kickstart -k system/com.coder.Coder-Desktop.Helper
205+
```
206+
207+
> [!WARNING]
208+
> Do not use `launchctl bootout` here. `bootout` removes the daemon from
209+
> launchd's system domain entirely, and relaunching the app does not
210+
> re-bootstrap it. Use `kickstart -k` to restart it in place.
211+
212+
4. Flush DNS caches:
213+
214+
```shell
215+
sudo dscacheutil -flushcache
216+
sudo killall -HUP mDNSResponder
217+
```
218+
219+
5. Confirm the stale tunnel is gone (the command should print nothing):
220+
221+
```shell
222+
scutil --nc list | grep "com.coder.Coder-Desktop"
223+
```
224+
225+
6. Relaunch **Coder Desktop** from your `/Applications` folder and toggle **Coder Connect** back on.
226+
227+
To verify the tunnel is healthy after relaunching, query the built-in sentinel
228+
hostname against Coder Desktop's embedded DNS server:
229+
230+
```shell
231+
dig @fd60:627a:a42b::53 AAAA is.coder--connect--enabled--right--now.coder +short
232+
dscacheutil -q host -a name is.coder--connect--enabled--right--now.coder
233+
```
234+
235+
Both commands should return an `fd60:627a:a42b::/48` address.
236+
If `dig` returns nothing or `dscacheutil` reports no entries, Coder Connect is not publishing DNS.
237+
[Collect logs](#collect-logs) and file an issue.
238+
239+
#### Windows
240+
241+
Run the following in an **elevated PowerShell** session.
242+
The service restart clears the embedded DNS state.
243+
The NRPT and adapter checks confirm the system routing policy is intact.
244+
245+
1. Stop the app and the VPN service:
246+
247+
```ps1
248+
Get-Process -Name "Coder Desktop" -ErrorAction SilentlyContinue | Stop-Process -Force
249+
Stop-Service -Name "Coder Desktop" -Force
250+
```
251+
252+
2. Flush DNS caches:
253+
254+
```ps1
255+
ipconfig /flushdns
256+
Clear-DnsClientCache
257+
```
258+
259+
3. Start the service again and relaunch the app:
260+
261+
```ps1
262+
Start-Service -Name "Coder Desktop"
263+
Start-Process "C:\Program Files\Coder Desktop\CoderDesktop.exe"
264+
```
265+
266+
4. After re-enabling Coder Connect in the tray, verify the NRPT rule and the Wintun adapter exist:
267+
268+
```ps1
269+
Get-DnsClientNrptRule | Where-Object { $_.Namespace -like "*.coder" }
270+
Get-NetAdapter | Where-Object { $_.InterfaceDescription -like "*Wintun*" }
271+
```
272+
273+
If either command returns nothing while Coder Connect shows as enabled,
274+
the tunnel did not finish coming up. Disable and re-enable the toggle, or
275+
repeat the steps above.
276+
277+
> [!NOTE]
278+
> `ipconfig /flushdns` does not reset Coder Desktop's embedded DNS resolver;
279+
> restarting the service is what clears its internal cache. If you are running
280+
> a network filtering agent (for example, Zscaler), it may shadow `.coder`
281+
> lookups even after the tunnel comes back. Check with your IT team if DNS
282+
> still fails after a clean restart.
283+
284+
</div>
285+
286+
### Collect logs
173287
174288
When reporting an issue, attach the relevant log files so we can diagnose it faster.
175289
@@ -182,11 +296,24 @@ Coder Desktop and its network extension write to the Apple [unified logging syst
182296
1. Export the unified logs for the last hour with the `log` command:
183297
184298
```sh
185-
log show --predicate 'subsystem == "com.coder.Coder-Desktop"' \
299+
log show --predicate 'subsystem BEGINSWITH "com.coder.Coder-Desktop"' \
186300
--info --debug --last 1h > ~/Desktop/coder-desktop.log
187301
```
188302
189-
Adjust `--last` (e.g. `30m`, `2h`, `1d`) to cover the time the issue occurred. You can also view the same logs interactively in **Console.app** by filtering on the `com.coder.Coder-Desktop` subsystem.
303+
The `BEGINSWITH` predicate captures the app, the helper daemon, and the
304+
network extension, which all log under subsystems prefixed with
305+
`com.coder.Coder-Desktop`. Adjust `--last` (e.g. `30m`, `2h`, `1d`) to
306+
cover the time the issue occurred.
307+
308+
You can stream the logs live while reproducing an issue:
309+
310+
```shell
311+
log stream --predicate 'subsystem BEGINSWITH "com.coder.Coder-Desktop"' --info --debug
312+
```
313+
314+
You can also view the same logs interactively in **Console.app** by
315+
filtering on `subsystem:com.coder.Coder-Desktop` with Info and Debug
316+
messages enabled.
190317
191318
2. If you're using file sync, also collect the Mutagen daemon log:
192319

0 commit comments

Comments
 (0)