{"record":{"id":"7ae5adaff8375b24","repo":"tailscale/tailscale","slug":"res-error","errorCode":null,"errorMessage":"res.Error","messagePattern":"res\\.Error","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/local/local.go","lineNumber":754,"sourceCode":"// subject to change between releases.\nfunc (lc *Client) SetComponentDebugLogging(ctx context.Context, component string, d time.Duration) error {\n\tif !buildfeatures.HasDebug {\n\t\treturn feature.ErrUnavailable\n\t}\n\tbody, err := lc.send(ctx, \"POST\",\n\t\tfmt.Sprintf(\"/localapi/v0/component-debug-logging?component=%s&secs=%d\",\n\t\t\turl.QueryEscape(component), int64(d.Seconds())), 200, nil)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error %w: %s\", err, body)\n\t}\n\tvar res struct {\n\t\tError string\n\t}\n\tif err := json.Unmarshal(body, &res); err != nil {\n\t\treturn err\n\t}\n\tif res.Error != \"\" {\n\t\treturn errors.New(res.Error)\n\t}\n\treturn nil\n}\n\n// Status returns the Tailscale daemon's status.\nfunc Status(ctx context.Context) (*ipnstate.Status, error) {\n\treturn defaultClient.Status(ctx)\n}\n\n// Status returns the Tailscale daemon's status.\n//\n// API maturity: this is considered a stable API.\nfunc (lc *Client) Status(ctx context.Context) (*ipnstate.Status, error) {\n\treturn lc.status(ctx, \"\")\n}\n\n// StatusWithoutPeers returns the Tailscale daemon's status, without the peer info.\nfunc StatusWithoutPeers(ctx context.Context) (*ipnstate.Status, error) {","sourceCodeStart":736,"sourceCodeEnd":772,"githubUrl":"https://github.com/tailscale/tailscale/blob/cfe32b8be6a33f8e24fbc369cbfbf7c729d9e042/client/local/local.go#L736-L772","documentation":"diskutilInfo runs `diskutil info -plist <id>` for each candidate disk that diskutil list reported and is not a boot disk; this error wraps a failed exec. Typical cause: the disk disappeared between list and info (USB/SD unplugged), or diskutil refused the identifier (invalid/ambiguous id, permissions).","triggerScenarios":"During `tailscale configure flash-appliance` auto-detection: a removable drive listed by `diskutil list` is yanked out before `diskutil info` runs, causing ExitError; also seen when diskutil is missing from PATH or when the id handed to diskutil is stale.","commonSituations":"User unplugs the target USB/SD card mid-command; a flaky card reader dropping the device; disks changing while macOS re-enumerates (thunderbolt/USB hub renegotiation); running in environments where diskutil is restricted.","solutions":["Re-run the command with the device connected and stable; auto-detection re-lists disks each run.","If the device keeps dropping, try another port/cable/reader, then verify with `diskutil list` run twice and comparing output.","Pass an explicit stable target with `--disk /dev/diskN` once you've confirmed the id via `diskutil list`.","If it persists, run `diskutil info -plist diskN` manually to see diskutil's stderr and rule out system-level disk errors (check Disk Utility / system log)."],"exampleFix":"// before: card removed mid-scan\n$ tailscale configure flash-appliance\nError: diskutil info disk4: exit status 1   # disk4 vanished\n\n// after: reconnect, then re-run or be explicit\n$ diskutil list | grep external   # confirm disk4 present\n$ tailscale configure flash-appliance --disk /dev/disk4","handlingStrategy":"retry","validationCode":"// optional pre-check that the device still exists\nif _, err := exec.Command(\"diskutil\", \"info\", id).Output(); err != nil {\n    return fmt.Errorf(\"disk %s already gone; re-run discovery\", id)\n}","typeGuard":null,"tryCatchPattern":"// Go: retry transient disk-disappearance around diskutil info\nvar d diskCandidate\nfor attempt := 0; attempt < 3; attempt++ {\n    var err error\n    d, err = diskutilInfo(ctx, id)\n    if err == nil {\n        break\n    }\n    var ee *exec.ExitError\n    if !errors.As(err, &ee) {\n        return err // not a transient exec failure\n    }\n    time.Sleep(500 * time.Millisecond) // let USB re-enumerate\n}","preventionTips":["Keep the target disk plugged and idle until flashing finishes.","Re-run discovery right before each flash rather than caching disk ids.","For flaky readers, use --disk with an id you've just re-confirmed via diskutil list."],"tags":["go","tailscale","macos","diskutil","removable-media","race-condition","flash-appliance"],"backgroundTag":null,"analyzedSha":"cfe32b8be6a33f8e24fbc369cbfbf7c729d9e042","analyzedAt":"2026-08-15T19:58:31.583Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}