{"record":{"id":"34fa0ef4b9e848f5","repo":"kubernetes/kops","slug":"error-loading-cluster-q-v","errorCode":null,"errorMessage":"error loading Cluster %q: %v","messagePattern":"error loading Cluster %q: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/kops/get_cluster.go","lineNumber":292,"sourceCode":"\t\t}\n\t\tif err := marshalToWriter(obj, marshalYaml, out); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc fullClusterSpecs(ctx context.Context, vfsContext *vfs.VFSContext, clusters []*kopsapi.Cluster) ([]*kopsapi.Cluster, error) {\n\tvar fullSpecs []*kopsapi.Cluster\n\tfor _, cluster := range clusters {\n\t\tconfigBase, err := registry.ConfigBase(vfsContext, cluster)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error reading full cluster spec for %q: %v\", cluster.ObjectMeta.Name, err)\n\t\t}\n\t\tconfigPath := configBase.Join(registry.PathClusterCompleted)\n\t\tb, err := configPath.ReadFile(ctx)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error loading Cluster %q: %v\", configPath, err)\n\t\t}\n\n\t\to, _, err := kopscodecs.Decode(b, nil)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error parsing Cluster %q: %v\", configPath, err)\n\t\t}\n\t\tif fullSpec, ok := o.(*kopsapi.Cluster); ok {\n\t\t\tfullSpecs = append(fullSpecs, fullSpec)\n\t\t} else {\n\t\t\treturn nil, fmt.Errorf(\"unexpected object type for Cluster %q: %T\", configPath, o)\n\t\t}\n\t}\n\treturn fullSpecs, nil\n}\n","sourceCodeStart":274,"sourceCodeEnd":307,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/cmd/kops/get_cluster.go#L274-L307","documentation":"Also in fullClusterSpecs (--full output): after resolving ConfigBase, kops reads the completed cluster manifest at <configBase>/cluster-completed.spec. If the read fails (object missing, access denied, connectivity), the error is wrapped as 'error loading Cluster %q: %v' with the full config path. This means the cluster's normalized spec file is absent or unreadable in the state store.","triggerScenarios":"`kops get cluster X --full` where cluster-completed.spec does not exist yet (cluster created but never updated/fully provisioned), the S3/GCS object was deleted, or credentials block the read.","commonSituations":"Freshly created clusters whose `kops update` hasn't produced the completed spec; manually deleted state-store objects; IAM/storage permissions changed after creation; network outage to the object store.","solutions":["Check the object exists: `aws s3 ls s3://<bucket>/<cluster>/cluster-completed.spec`.","Run `kops update cluster <name> --yes` (or re-export/refresh state) so the completed spec is written, if the cluster was never fully provisioned.","Verify read permissions on the state store bucket/prefix for your credentials.","Inspect the wrapped error for 404 vs 403 vs network to pick between missing object, permissions, and connectivity fixes."],"exampleFix":"// before\naws s3 rm s3://bucket/mycluster.example.com/cluster-completed.spec  # then kops get --full\n// after\naws s3 cp cluster-completed.spec s3://bucket/mycluster.example.com/cluster-completed.spec  # or kops update cluster mycluster.example.com","handlingStrategy":"retry","validationCode":"# verify the completed spec object exists before --full\nprefix=$(aws s3 ls \"$KOPS_STATE_STORE/\" | awk '/\\//{print $NF}' | head -1)\naws s3 ls \"${KOPS_STATE_STORE%/}/${prefix}cluster-completed.spec\" >/dev/null \\\n  || { echo \"cluster-completed.spec missing; run kops update cluster first\" >&2; exit 1; }","typeGuard":"null","tryCatchPattern":"for i in 1 2 3; do\n  kops get cluster \"$CLUSTER\" --full && break\n  sleep $((i*2))   # transient S3/GCS errors\n\ndone","preventionTips":["Never delete cluster-completed.spec from the state store; it is what --full reads.","Ensure `kops update cluster --yes` has completed before using --full on a new cluster.","Retry on transient object-store errors; distinguish 404 (missing spec) from 403 (permissions)."],"tags":["state-store","cluster-spec","kops-get-full"],"backgroundTag":"state-store-object-missing","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"}