larksuite/cli · warning

check failed: %s

Error message

check failed: %s

What it means

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.

Source

Thrown at cmd/doctor/doctor.go:250

	req, err := http.NewRequestWithContext(ctx, http.MethodHead, url, nil)
	if err != nil {
		return err
	}
	resp, err := client.Do(req)
	if err != nil {
		return err
	}
	resp.Body.Close()
	return nil
}

// checkCLIUpdate actively queries the npm registry for the latest version.
// Unlike the root-level async check, this does a synchronous fetch with timeout
// and works regardless of build version (dev builds included).
func checkCLIUpdate() []checkResult {
	latest, err := fetchLatestForDoctor()
	if err != nil {
		return []checkResult{warn("cli_update", "check failed: "+err.Error(), "")}
	}
	current := build.Version
	if update.IsNewer(latest, current) {
		return []checkResult{warn("cli_update",
			fmt.Sprintf("%s → %s available", current, latest),
			"run: lark-cli update")}
	}
	return []checkResult{pass("cli_update", latest+" (up to date)")}
}

var fetchLatestForDoctor = update.FetchLatest

func finishDoctor(f *cmdutil.Factory, checks []checkResult) error {
	allOK := true
	for _, c := range checks {
		if c.Status == "fail" {
			allOK = false
			break

View on GitHub (pinned to 7fd6ef3c07)

Solutions

  1. Verify network connectivity and access to the npm registry, e.g. `curl -I https://registry.npmjs.org/lark-cli`.
  2. If behind a proxy, configure it (HTTPS_PROXY/HTTP_PROXY environment variables) so the registry is reachable.
  3. Re-run `lark-cli doctor` once the network is stable; this is a transient check, not a configuration defect.
  4. If you are offline intentionally, ignore this warning — all other doctor checks still report normally.

Example fix

// before (offline CI, check fails)
$ lark-cli doctor
  cli_update: warn - check failed: Get "https://registry.npmjs.org/...": dial tcp: lookup registry.npmjs.org: no such host
// after (network/proxy fixed)
$ export HTTPS_PROXY=http://proxy.corp.internal:8080
$ lark-cli doctor
  cli_update: pass - 1.2.3 (up to date)
Defensive patterns

Strategy: fallback

Validate before calling

// Preflight: only run the doctor update check when the registry is reachable
curl -sSf -m 5 -o /dev/null https://registry.npmjs.org/lark-cli && lark-cli doctor || echo "offline: skipping cli_update check"

Try / catch

// Treat the warn result as non-fatal; do not gate CI on it
results, _ := doctorRun(...)
for _, r := range results {
    if r.Check == "cli_update" && r.Status == "warn" && strings.HasPrefix(r.Message, "check failed:") {
        continue // network was unavailable; not a real failure
    }
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of larksuite/cli@7fd6ef3c07 (2026-09-04). Data as JSON: /api/errors/198ea15f9471983e. Report an issue: GitHub.