{"record":{"id":"5ecab750fd9e504b","repo":"hasura/graphql-engine","slug":"unable-to-parse-version-w","errorCode":null,"errorMessage":"unable to parse version: %w","messagePattern":"unable to parse version: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/commands/update-cli.go","lineNumber":89,"sourceCode":"}\n\nfunc (o *updateOptions) run(showPrompt bool) (err error) {\n\tvar op errors.Op = \"commands.updateOptions.run\"\n\n\tcurrentVersion := o.EC.Version.CLISemver\n\tif currentVersion == nil {\n\t\treturn errors.E(\n\t\t\top,\n\t\t\tfmt.Errorf(\"cannot update from a non-semver version: %s\", o.EC.Version.GetCLIVersion()),\n\t\t)\n\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,","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/cli/commands/update-cli.go#L71-L107","documentation":"Thrown when an explicit version string passed to `hasura update-cli --version <v>` cannot be parsed by semver.NewVersion. The CLI accepts an optional pin version; it must be valid semver (with optional v prefix).","triggerScenarios":"`hasura update-cli --version v1.0` (missing patch), `--version 2.x`, `--version latest`, or any non-semver string.","commonSituations":"Users assuming `--version latest` works, copying a branch name or partial tag instead of a release tag, missing 'v' is fine but malformed numbers are not.","solutions":["Use a full release tag from GitHub releases, e.g. `hasura update-cli --version v2.30.0`","Omit --version entirely to update to the latest stable release"],"exampleFix":"# before\nhasura update-cli --version latest\n# after\nhasura update-cli  # or: hasura update-cli --version v2.30.0","handlingStrategy":"validation","validationCode":"// validate the pin version before passing it to update-cli\nif _, err := semver.NewVersion(flagVersion); flagVersion != \"\" && err != nil {\n    log.Fatalf(\"--version must be valid semver, e.g. v2.30.0 (got %q)\", flagVersion)\n}","typeGuard":"func isValidSemver(s string) bool {\n    _, err := semver.NewVersion(s)\n    return err == nil\n}","tryCatchPattern":null,"preventionTips":["Copy release tags exactly from GitHub releases","Omit --version to track latest stable"],"tags":["hasura","cli","update","semver","version"],"backgroundTag":"invalid-semver-version","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}