{"record":{"id":"f1ae9c2359dc0540","repo":"kubernetes/kops","slug":"validation-failed-v","errorCode":null,"errorMessage":"validation failed: %v","messagePattern":"validation failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/kops/validate_cluster.go","lineNumber":103,"sourceCode":"\to.interval = 10 * time.Second\n\to.MaxUnreadyNodes = 0\n}\n\nfunc NewCmdValidateCluster(f *util.Factory, out io.Writer) *cobra.Command {\n\toptions := &ValidateClusterOptions{}\n\toptions.InitDefaults()\n\n\tcmd := &cobra.Command{\n\t\tUse:               \"cluster [CLUSTER]\",\n\t\tShort:             validateClusterShort,\n\t\tLong:              validateClusterLong,\n\t\tExample:           validateClusterExample,\n\t\tArgs:              rootCommand.clusterNameArgs(&options.ClusterName),\n\t\tValidArgsFunction: commandutils.CompleteClusterName(f, true, false),\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tresult, err := RunValidateCluster(cmd.Context(), f, out, options)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"validation failed: %v\", err)\n\t\t\t}\n\n\t\t\t// We want the validate command to exit non-zero if validation found a problem,\n\t\t\t// even if we didn't really hit an error during validation.\n\t\t\tif len(result.Failures) != 0 {\n\t\t\t\tos.Exit(2)\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t}\n\n\tcmd.Flags().StringVarP(&options.output, \"output\", \"o\", options.output, \"Output format. One of json|yaml|table.\")\n\tcmd.RegisterFlagCompletionFunc(\"output\", func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {\n\t\treturn []string{\"json\", \"yaml\", \"table\"}, cobra.ShellCompDirectiveNoFileComp\n\t})\n\tcmd.Flags().DurationVar(&options.wait, \"wait\", options.wait, \"Amount of time to wait for the cluster to become ready\")\n\tcmd.Flags().IntVar(&options.count, \"count\", options.count, \"Number of consecutive successful validations required\")\n\tcmd.Flags().DurationVar(&options.interval, \"interval\", options.interval, \"Time in duration to wait between validation attempts\")","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/cmd/kops/validate_cluster.go#L85-L121","documentation":"Wraps the top-level validation error in the `kops validate cluster` RunE: the validator returned an error (after any retries) while checking cluster health. The %v carries the underlying validation failure describing which nodes/components are unhealthy.","triggerScenarios":"Thrown at cmd/kops/validate_cluster.go:103 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Run kubectl get nodes to see unready nodes","Inspect failing pods with kubectl get pods -A","Wait for the cluster to finish provisioning and re-validate"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}