{"record":{"id":"7bf15acc68ac6c3a","repo":"kubernetes/kops","slug":"error-getting-cluster-q-v","errorCode":null,"errorMessage":"error getting cluster: %q: %v","messagePattern":"error getting cluster: %q: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/kops/create_instancegroup.go","lineNumber":172,"sourceCode":"\tcmd.RegisterFlagCompletionFunc(\"subnet\", completeClusterSubnet(f, &options.Subnets))\n\n\tcmd.Flags().StringSliceVar(&options.Zones, \"zone\", options.Zones, \"Zones in which to create instance group. One of Availability Zone like eu-west-1a or a comma-separated list of multiple Availability Zones.\")\n\n\t// DryRun mode that will print YAML or JSON\n\tcmd.Flags().BoolVar(&options.DryRun, \"dry-run\", options.DryRun, \"Only print the object that would be created, without created it. This flag can be used to create an instance group YAML or JSON manifest.\")\n\tcmd.Flags().StringVarP(&options.Output, \"output\", \"o\", options.Output, \"Output format. One of json or yaml\")\n\tcmd.RegisterFlagCompletionFunc(\"output\", func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {\n\t\treturn []string{\"json\", \"yaml\"}, cobra.ShellCompDirectiveNoFileComp\n\t})\n\tcmd.Flags().BoolVar(&options.Edit, \"edit\", options.Edit, \"Open an editor to edit default values\")\n\n\treturn cmd\n}\n\nfunc RunCreateInstanceGroup(ctx context.Context, f *util.Factory, out io.Writer, options *CreateInstanceGroupOptions) error {\n\tcluster, err := GetCluster(ctx, f, options.ClusterName)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error getting cluster: %q: %v\", options.ClusterName, err)\n\t}\n\n\tclientset, err := f.KopsClient()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tchannel, err := cloudup.ChannelForCluster(clientset.VFSContext(), cluster)\n\tif err != nil {\n\t\tklog.Warningf(\"%v\", err)\n\t}\n\n\texisting, err := clientset.InstanceGroupsFor(cluster).Get(ctx, options.InstanceGroupName, metav1.GetOptions{})\n\tif err != nil {\n\t\t// We expect a NotFound error when creating the instance group\n\t\tif !errors.IsNotFound(err) {\n\t\t\treturn err\n\t\t}","sourceCodeStart":154,"sourceCodeEnd":190,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/cmd/kops/create_instancegroup.go#L154-L190","documentation":"RunCreateInstanceGroup loads the target cluster (e.g. via GetCluster) before building the IG spec; this wraps that lookup failing - typically the cluster does not exist, the state store is unreachable, or permissions are lacking.","triggerScenarios":"Thrown at cmd/kops/create_instancegroup.go:172 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the cluster name and that it exists in the state store","Check state store (S3/GCS) access and credentials","Create the cluster first if it does not yet exist"],"exampleFix":null,"handlingStrategy":"try-catch","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-12T12:17:11.808Z"}