{"record":{"id":"a7e35e99d9713157","repo":"kubernetes/kops","slug":"error-reading-full-cluster-spec-for-q-v","errorCode":null,"errorMessage":"error reading full cluster spec for %q: %v","messagePattern":"error reading full cluster spec for %q: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/kops/get_cluster.go","lineNumber":287,"sourceCode":"\tfor i, obj := range args {\n\t\tif i != 0 {\n\t\t\tif err := writeYAMLSep(out); err != nil {\n\t\t\t\treturn fmt.Errorf(\"error writing to stdout: %v\", err)\n\t\t\t}\n\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","sourceCodeStart":269,"sourceCodeEnd":305,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/cmd/kops/get_cluster.go#L269-L305","documentation":"fullClusterSpecs is used by `kops get --full` to load the completed cluster spec from the state store. registry.ConfigBase resolves the state-store path for the cluster; if that resolution fails (invalid state store config, bad VFS path), the error is wrapped as 'error reading full cluster spec for %q'. It aborts the whole listing because a partial --full output would be misleading.","triggerScenarios":"`kops get cluster X --full` where the cluster's state store location cannot be resolved — e.g. KOPS_STATE_STORE unset/invalid, malformed s3:// URL, or missing permissions to determine the base path.","commonSituations":"Missing KOPS_STATE_STORE env var; state store URL typos; VFS context misconfigured for the cluster's origin (cluster created with a different store).","solutions":["Set/verify KOPS_STATE_STORE (or --state) to the correct store: `kops get cluster X --full --state s3://my-bucket`.","Validate the state store URL scheme (s3://, gs://, etc.) and that you have read credentials for it.","Confirm the cluster name matches one listed by `kops get clusters`."],"exampleFix":"// before\nkops get cluster mycluster.example.com --full   # KOPS_STATE_STORE unset\n// after\nKOPS_STATE_STORE=s3://my-kops-bucket kops get cluster mycluster.example.com --full","handlingStrategy":"validation","validationCode":"[ -n \"$KOPS_STATE_STORE\" ] || { echo \"KOPS_STATE_STORE is not set\" >&2; exit 1; }\nkops get cluster \"$CLUSTER\" >/dev/null || exit 1  # resolves config base\nkops get cluster \"$CLUSTER\" --full","typeGuard":"null","tryCatchPattern":"if ! kops get cluster \"$CLUSTER\" --full 2>err.txt; then\n  grep -q 'error reading full cluster spec' err.txt && \\\n    echo \"check KOPS_STATE_STORE=$KOPS_STATE_STORE and credentials\" || cat err.txt\nfi","preventionTips":["Assert KOPS_STATE_STORE is set before any kops call in scripts.","Keep cloud credentials for the state store valid and scoped for read access.","Run plain `kops get cluster <name>` before --full to isolate state-store resolution issues."],"tags":["state-store","vfs","kops-get-full"],"backgroundTag":"state-store-unavailable","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"}