{"record":{"id":"198ea15f9471983e","repo":"larksuite/cli","slug":"check-failed-s","errorCode":null,"errorMessage":"check failed: %s","messagePattern":"check failed: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cmd/doctor/doctor.go","lineNumber":250,"sourceCode":"\treq, err := http.NewRequestWithContext(ctx, http.MethodHead, url, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\treturn err\n\t}\n\tresp.Body.Close()\n\treturn nil\n}\n\n// checkCLIUpdate actively queries the npm registry for the latest version.\n// Unlike the root-level async check, this does a synchronous fetch with timeout\n// and works regardless of build version (dev builds included).\nfunc checkCLIUpdate() []checkResult {\n\tlatest, err := fetchLatestForDoctor()\n\tif err != nil {\n\t\treturn []checkResult{warn(\"cli_update\", \"check failed: \"+err.Error(), \"\")}\n\t}\n\tcurrent := build.Version\n\tif update.IsNewer(latest, current) {\n\t\treturn []checkResult{warn(\"cli_update\",\n\t\t\tfmt.Sprintf(\"%s → %s available\", current, latest),\n\t\t\t\"run: lark-cli update\")}\n\t}\n\treturn []checkResult{pass(\"cli_update\", latest+\" (up to date)\")}\n}\n\nvar fetchLatestForDoctor = update.FetchLatest\n\nfunc finishDoctor(f *cmdutil.Factory, checks []checkResult) error {\n\tallOK := true\n\tfor _, c := range checks {\n\t\tif c.Status == \"fail\" {\n\t\t\tallOK = false\n\t\t\tbreak","sourceCodeStart":232,"sourceCodeEnd":268,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/cmd/doctor/doctor.go#L232-L268","documentation":"This is not a hard failure but a warning check result emitted by `lark-cli doctor` when the `cli_update` check cannot complete. checkCLIUpdate (cmd/doctor/doctor.go:247) calls fetchLatestForDoctor (update.FetchLatest), which queries the npm registry over HTTP with a 10-second timeout to learn the latest published CLI version. Any error from that fetch — network unreachable, DNS failure, proxy issues, or the 10s timeout — is converted into a warn result with the message \"check failed: %s\" where %s is the underlying error string. The doctor run itself still completes; this check simply cannot determine whether an update exists.","triggerScenarios":"Running `lark-cli doctor` while fetchLatestForDoctor fails: no internet connectivity, npm registry (registry.npmjs.org) unreachable, DNS resolution failure, a blocking corporate proxy/firewall, or the HTTP request exceeding the 10-second context timeout.","commonSituations":"Developers behind corporate proxies or VPNs, offline/air-gapped environments or CI runners without network egress, intermittent Wi-Fi, regional network blocks on npmjs.org, or slow networks that push the registry HEAD/GET past the 10s deadline.","solutions":["Verify network connectivity and access to the npm registry, e.g. `curl -I https://registry.npmjs.org/lark-cli`.","If behind a proxy, configure it (HTTPS_PROXY/HTTP_PROXY environment variables) so the registry is reachable.","Re-run `lark-cli doctor` once the network is stable; this is a transient check, not a configuration defect.","If you are offline intentionally, ignore this warning — all other doctor checks still report normally."],"exampleFix":"// before (offline CI, check fails)\n$ lark-cli doctor\n  cli_update: warn - check failed: Get \"https://registry.npmjs.org/...\": dial tcp: lookup registry.npmjs.org: no such host\n// after (network/proxy fixed)\n$ export HTTPS_PROXY=http://proxy.corp.internal:8080\n$ lark-cli doctor\n  cli_update: pass - 1.2.3 (up to date)","handlingStrategy":"fallback","validationCode":"// Preflight: only run the doctor update check when the registry is reachable\ncurl -sSf -m 5 -o /dev/null https://registry.npmjs.org/lark-cli && lark-cli doctor || echo \"offline: skipping cli_update check\"","typeGuard":null,"tryCatchPattern":"// Treat the warn result as non-fatal; do not gate CI on it\nresults, _ := doctorRun(...)\nfor _, r := range results {\n    if r.Check == \"cli_update\" && r.Status == \"warn\" && strings.HasPrefix(r.Message, \"check failed:\") {\n        continue // network was unavailable; not a real failure\n    }\n}","preventionTips":["Ensure HTTPS_PROXY/HTTP_PROXY are set in restricted networks before running doctor.","In offline CI, expect and tolerate this specific warn result instead of failing the pipeline.","Check registry reachability (DNS, firewall, VPN) when the message recurs."],"tags":["network","update-check","doctor","npm-registry"],"backgroundTag":"update-check-network-failure","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"}