{"record":{"id":"504f2a716d7c70b8","repo":"hasura/graphql-engine","slug":"command-check-update-w","errorCode":null,"errorMessage":"command: check update: %w","messagePattern":"command: check update: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/commands/update-cli.go","lineNumber":100,"sourceCode":"\t}\n\n\tvar versionToBeInstalled *semver.Version\n\tif o.version != \"\" {\n\t\t// parse the version\n\t\tversionToBeInstalled, err = semver.NewVersion(o.version)\n\t\tif err != nil {\n\t\t\treturn errors.E(op, fmt.Errorf(\"unable to parse version: %w\", err))\n\t\t}\n\t} else {\n\t\to.EC.Spin(\"Checking for update... \")\n\t\thasUpdate, latestVersion, hasPreReleaseUpdate, preReleaseVersion, err := update.HasUpdate(\n\t\t\tcurrentVersion,\n\t\t\to.EC.LastUpdateCheckFile,\n\t\t)\n\t\to.EC.Spinner.Stop()\n\n\t\tif err != nil {\n\t\t\treturn errors.E(op, fmt.Errorf(\"command: check update: %w\", err))\n\t\t}\n\n\t\tec.Logger.Debugln(\n\t\t\t\"hasUpdate: \",\n\t\t\thasUpdate,\n\t\t\t\"latestVersion: \",\n\t\t\tlatestVersion,\n\t\t\t\"hasPreReleaseUpdate: \",\n\t\t\thasPreReleaseUpdate,\n\t\t\t\"preReleaseVersion: \",\n\t\t\tpreReleaseVersion,\n\t\t\t\"currentVersion:\",\n\t\t\tcurrentVersion,\n\t\t)\n\n\t\tif showPrompt {\n\t\t\tswitch {\n\t\t\tcase hasUpdate:","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/cli/commands/update-cli.go#L82-L118","documentation":"Wraps any failure of update.HasUpdate — the check against the update index (LastUpdateCheckFile / GitHub releases) used to determine whether a newer CLI version exists. It covers network errors, release-API failures, and cache-file issues during `hasura update-cli`.","triggerScenarios":"Running `hasura update-cli` with no network access, GitHub API rate-limiting/unavailability, TLS/proxy interception, or an unreadable/corrupt last-update-check cache file.","commonSituations":"Corporate proxies blocking api.github.com, CI runners without egress, rate-limited CI (shared IPs), or a corrupted file at the last-update-check path.","solutions":["Check connectivity to github.com/api.github.com (curl) and configure proxy env (HTTPS_PROXY) if needed","Retry later if GitHub API rate-limited (check rate-limit headers)","Remove the stale last-update-check cache file so a fresh check is performed","Alternatively download the desired release binary directly and skip update-cli"],"exampleFix":"# before\n$ hasura update-cli  # behind a proxy\n# after\n$ export HTTPS_PROXY=http://proxy:8080 && hasura update-cli","handlingStrategy":"retry","validationCode":"// probe update endpoints first\nclient := http.Client{Timeout: 5 * time.Second}\nif _, err := client.Head(\"https://api.github.com/repos/hasura/graphql-engine/releases/latest\"); err != nil {\n    log.Fatal(\"update check unreachable: \", err)\n}","typeGuard":null,"tryCatchPattern":"var err error\nfor attempt := 1; attempt <= 3; attempt++ {\n    if err = updateCmd.Run(); err == nil || !strings.Contains(err.Error(), \"check update\") {\n        break\n    }\n    time.Sleep(time.Duration(attempt) * 2 * time.Second)\n}","preventionTips":["Set HTTPS_PROXY in proxied environments","Cache/download release binaries directly in rate-limited CI"],"tags":["hasura","cli","update","network","github-api"],"backgroundTag":"update-check-network-failure","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}