{"record":{"id":"1bfaca7d96d14dc0","repo":"hasura/graphql-engine","slug":"get-latest-version-w","errorCode":null,"errorMessage":"get latest version: %w","messagePattern":"get latest version: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cli/update/update.go","lineNumber":118,"sourceCode":"// HasUpdate tells us if there is a new stable or prerelease update available.\nfunc HasUpdate(\n\tcurrentVersion *semver.Version,\n\ttimeFile string,\n) (bool, *semver.Version, bool, *semver.Version, error) {\n\tvar op errors.Op = \"update.HasUpdate\"\n\n\tif timeFile != \"\" {\n\t\tdefer func() {\n\t\t\terr := writeTimeToFile(timeFile, time.Now().UTC())\n\t\t\tif err != nil {\n\t\t\t\tfmt.Fprintln(os.Stderr, \"failed writing last update check time: \", err)\n\t\t\t}\n\t\t}()\n\t}\n\n\tlatestVersion, preReleaseVersion, err := getLatestVersion()\n\tif err != nil {\n\t\treturn false, nil, false, nil, errors.E(op, fmt.Errorf(\"get latest version: %w\", err))\n\t}\n\n\treturn latestVersion.GreaterThan(\n\t\t\tcurrentVersion,\n\t\t), latestVersion, preReleaseVersion.GreaterThan(\n\t\t\tcurrentVersion,\n\t\t), preReleaseVersion, nil\n}\n\n// ApplyUpdate downloads and applies the update indicated by version v.\nfunc ApplyUpdate(v *semver.Version) error {\n\tvar op errors.Op = \"update.ApplyUpdate\"\n\t// get the current executable\n\texe, err := getExecutablePath()\n\tif err != nil {\n\t\treturn errors.E(op, fmt.Errorf(\"find executable: %w\", err))\n\t}\n","sourceCodeStart":100,"sourceCodeEnd":136,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/cli/update/update.go#L100-L136","documentation":"Returned by HasUpdate when getLatestVersion() fails, i.e. the updater could not determine the latest release version (cli/update/update.go:118). The wrapped error usually comes from querying the release metadata feed (rate-limited GitHub API, network failure, or unparsable release tags). It aborts the update check before any comparison with the current version happens.","triggerScenarios":"Invoking the CLI's update check (run -> HasUpdate) with no network access, an unreachable release metadata endpoint, GitHub API rate limiting (unauthenticated 403), or release tags that cannot be parsed as semver.","commonSituations":"CI sandboxes with blocked egress; GitHub API rate limits hit from shared NAT IPs; corporate proxies intercepting the request; the repo changed its release tag format so parsing fails.","solutions":["Check connectivity to the release metadata endpoint (curl the URL used by getLatestVersion).","If rate-limited by the GitHub API, wait or set GITHUB_TOKEN so authenticated limits apply.","Retry the command; transient DNS/network failures resolve themselves.","Verify release tags follow semantic versioning if the error mentions parsing."],"exampleFix":"// before\nhasUpdate, latest, hasPre, pre, err := update.HasUpdate(current)\nif err != nil { log.Fatal(err) }\n\n// after\nhasUpdate, latest, hasPre, pre, err := update.HasUpdate(current)\nif err != nil {\n    log.Printf(\"update check failed (continuing with current version): %v\", err)\n}","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"hasUpdate, latest, hasPre, pre, err := update.HasUpdate(cur)\nif err != nil {\n    log.Printf(\"skipping update check: %v\", err)\n    // proceed with current version\n}","preventionTips":["Treat update-check failure as non-fatal; decouple it from the main command.","Set GITHUB_TOKEN in CI to avoid API rate limits.","Cache the last known-good version to avoid repeated failing checks."],"tags":["go","self-update","github-api","network","rate-limit"],"backgroundTag":"http-request-failed","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}