{"record":{"id":"a313747d721b5676","repo":"istio/istio","slug":"invalid-version-v-expected-format-like-1-0","errorCode":null,"errorMessage":"invalid version %v, expected format like '1.0'","messagePattern":"invalid version (.+?), expected format like '1\\.0'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"istioctl/pkg/precheck/precheck.go","lineNumber":135,"sourceCode":"\tcmd.PersistentFlags().BoolVar(&skipControlPlane, \"skip-controlplane\", false, \"skip checking the control plane\")\n\tcmd.PersistentFlags().Var(&outputThreshold, \"output-threshold\",\n\t\tfmt.Sprintf(\"The severity level of precheck at which to display messages. Valid values: %v\", diag.GetAllLevelStrings()))\n\tcmd.PersistentFlags().StringVarP(&msgOutputFormat, \"output\", \"o\", formatting.LogFormat,\n\t\tfmt.Sprintf(\"Output format: one of %v\", formatting.MsgOutputFormatKeys))\n\tcmd.PersistentFlags().StringVarP(&fromCompatibilityVersion, \"from-version\", \"f\", \"\",\n\t\t\"check changes since the provided version\")\n\topts.AttachControlPlaneFlags(cmd)\n\treturn cmd\n}\n\nfunc checkFromVersion(ctx cli.Context, revision, version string) (diag.Messages, error) {\n\tcli, err := ctx.CLIClientWithRevision(ctx.RevisionOrDefault(revision))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tmajor, minors, ok := strings.Cut(version, \".\")\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"invalid version %v, expected format like '1.0'\", version)\n\t}\n\tif major != \"1\" {\n\t\treturn nil, fmt.Errorf(\"expected major version 1, got %v\", version)\n\t}\n\tminor, err := strconv.Atoi(minors)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"minor version is not a number: %v\", minors)\n\t}\n\n\tvar messages diag.Messages = make([]diag.Message, 0)\n\n\tif minor <= 21 {\n\t\tif err := checkTracing(cli, &messages); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn messages, nil\n}","sourceCodeStart":117,"sourceCodeEnd":153,"githubUrl":"https://github.com/istio/istio/blob/8dc789c5cf17517c64e3c36cb3288230f149dfae/istioctl/pkg/precheck/precheck.go#L117-L153","documentation":"Error \"invalid version %v, expected format like '1.0'\" thrown in istio/istio.","triggerScenarios":"Thrown at istioctl/pkg/precheck/precheck.go:135 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8dc789c5cf17517c64e3c36cb3288230f149dfae","analyzedAt":"2026-08-15T15:16:55.434Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}