{"record":{"id":"51b5f6bc92ca824d","repo":"larksuite/cli","slug":"binary-verification-timed-out-after-s","errorCode":null,"errorMessage":"binary verification timed out after %s","messagePattern":"binary verification timed out after (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/selfupdate/updater.go","lineNumber":449,"sourceCode":"\tif u.VerifyOverride != nil {\n\t\treturn u.VerifyOverride(expectedVersion)\n\t}\n\t// Prefer PATH resolution so npm global bin symlinks pick up the newly\n\t// installed binary (#836). If `lark-cli` is not on PATH (e.g. the user\n\t// invoked this process by absolute path), fall back to the running\n\t// executable — same as the pre-#836 secondary resolution path.\n\texe, err := execLookPath(\"lark-cli\")\n\tif err != nil {\n\t\texe, err = vfs.Executable()\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"cannot locate binary: %w\", err)\n\t\t}\n\t}\n\tctx, cancel := context.WithTimeout(context.Background(), verifyTimeout)\n\tdefer cancel()\n\tout, err := exec.CommandContext(ctx, exe, \"--version\").Output()\n\tif ctx.Err() == context.DeadlineExceeded {\n\t\treturn fmt.Errorf(\"binary verification timed out after %s\", verifyTimeout)\n\t}\n\tif err != nil {\n\t\treturn fmt.Errorf(\"binary not executable: %w\", err)\n\t}\n\tfields := strings.Fields(strings.TrimSpace(string(out)))\n\tif len(fields) == 0 {\n\t\treturn fmt.Errorf(\"empty version output\")\n\t}\n\tactual := strings.TrimPrefix(fields[len(fields)-1], \"v\")\n\texpected := strings.TrimPrefix(expectedVersion, \"v\")\n\tif actual != expected {\n\t\treturn fmt.Errorf(\"expected version %s, got %q\", expectedVersion, actual)\n\t}\n\treturn nil\n}\n\n// Truncate returns the last maxLen runes of s.\nfunc Truncate(s string, maxLen int) string {","sourceCodeStart":431,"sourceCodeEnd":467,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/internal/selfupdate/updater.go#L431-L467","documentation":"VerifyBinary runs `lark-cli --version` with a context bounded by verifyTimeout. If the child process does not exit before the deadline, the context cancels it and this error is returned to signal that binary verification timed out.","triggerScenarios":"Calling Updater.VerifyBinary (from doAutoUpdate) when the spawned `lark-cli --version` process exceeds verifyTimeout, i.e. ctx.Err() == context.DeadlineExceeded after cmd.Output().","commonSituations":"A stale or corrupted installed binary that hangs on startup instead of printing a version; the shell wrapper/shim on PATH blocking on something (e.g. nvm init, a locked filesystem); extremely slow disk or a broken install where the new binary deadlocks.","solutions":["Run `lark-cli --version` manually to see whether the binary hangs and diagnose its startup","Reinstall the binary (`npm install -g @larksuite/cli@latest` or `pnpm add -g @larksuite/cli@latest`) if it is corrupted","Check PATH for shims/wrappers (nvm, version managers) that may block startup and bypass them","Retry the update on a healthier environment (faster disk, no stale locks)"],"exampleFix":"// diagnose instead of failing silently\nres := doAutoUpdate()\nif strings.Contains(fmt.Sprint(res), \"binary verification timed out\") {\n\tout, err := exec.Command(\"lark-cli\", \"--version\").CombinedOutput() // run manually to see hang\n\tlog.Printf(\"manual version check: out=%s err=%v\", out, err)\n}","handlingStrategy":"try-catch","validationCode":"// sanity: current binary should respond quickly\nout, err := exec.Command(\"lark-cli\", \"--version\").Output()\nif err != nil { /* hanging/corrupt binary; reinstall before VerifyBinary */ }","typeGuard":null,"tryCatchPattern":"if err := updater.VerifyBinary(expectedVersion); err != nil {\n\tif strings.Contains(err.Error(), \"verification timed out\") {\n\t\t// hung binary: reinstall manually and re-verify\n\t} else {\n\t\treturn err\n\t}\n}","preventionTips":["Ensure no startup hooks/shims (nvm etc.) block the binary's startup path","Reinstall immediately if `lark-cli --version` ever hangs","Keep the install directory on fast, unlocked storage","Treat repeated verification timeouts as a corrupted install, not a transient error"],"tags":["timeout","selfupdate","verification","binary"],"backgroundTag":"process-execution-timeout","analyzedSha":"7fd6ef3c07182257ce776cdc5a614e122d5bd4b3","analyzedAt":"2026-09-04T21:17:44.649Z","contentChangedAt":"2026-09-04T21:17:44.649Z","schemaVersion":2},"datasetVersion":"2026-09-12T02:17:10.037Z"}