{"record":{"id":"f9414cd6ebda5c51","repo":"kubernetes/kops","slug":"you-might-have-not-staged-your-files-correctly-pl","errorCode":null,"errorMessage":"you might have not staged your files correctly, please execute 'kops get assets --copy'","messagePattern":"you might have not staged your files correctly, please execute 'kops get assets --copy'","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/assets/builder.go","lineNumber":442,"sourceCode":"\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\thash, err := hashing.FromString(fields[0])\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\n\t\t\t\tdownloadedFileHashes.Store(u.String(), hash)\n\n\t\t\t\treturn hash, nil\n\t\t\t}\n\t\t\tif ext == \".sha256\" {\n\t\t\t\tklog.V(2).Infof(\"Unable to read new sha256 hash file (is this an older/unsupported kubernetes release?)\")\n\t\t\t}\n\t\t}\n\t}\n\n\tif a.assetsLocation != nil && a.assetsLocation.FileRepository != nil {\n\t\treturn nil, fmt.Errorf(\"you might have not staged your files correctly, please execute 'kops get assets --copy'\")\n\t}\n\treturn nil, fmt.Errorf(\"cannot determine hash for %q (have you specified a valid file location?)\", u)\n}\n\nfunc (a *AssetBuilder) remapURL(canonicalURL *url.URL) (*url.URL, error) {\n\tf := \"\"\n\tif a.assetsLocation != nil {\n\t\tf = values.StringValue(a.assetsLocation.FileRepository)\n\t}\n\tif f == \"\" {\n\t\treturn nil, fmt.Errorf(\"assetsLocation.fileRepository must be set to remap asset %v\", canonicalURL)\n\t}\n\n\tfileRepo, err := url.Parse(f)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to parse assetsLocation.fileRepository %q: %v\", f, err)\n\t}\n","sourceCodeStart":424,"sourceCodeEnd":460,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/assets/builder.go#L424-L460","documentation":"findHash failed to determine the file's SHA256 hash by any means (well-known hashes, .sha256 sidecar file, or download), while an explicit FileRepository (asset staging location) is configured. Because assets are supposed to be pre-staged there, a missing hash usually means the staging copy is incomplete, so kops points the user at 'kops get assets --copy'.","triggerScenarios":"Using --set fileRepository (assetsLocation.FileRepository) and calling RemapFile for a file whose hash cannot be resolved from the staged repository or downloaded sources.","commonSituations":"Ran 'kops get assets' without --copy (or the copy was interrupted); the file is new/kind-specific and missing from the file repository; wrong FileRepository configured; offline environment where the download fallback fails.","solutions":["Run 'kops get assets --copy' to stage all required file assets into the file repository, then retry.","Verify assetsLocation.FileRepository points at the repository actually populated with the staged files.","Check the target file exists in the repository with its .sha256 hash file.","If not using a mirror, unset FileRepository so kops reports the generic 'cannot determine hash' error instead."],"exampleFix":"// before\nkops create cluster ... --set fileRepository=https://files.example.com/kops # repo empty\n// after\nkops get assets --copy --asset-file-repository https://files.example.com/kops\nkops create cluster ... --set fileRepository=https://files.example.com/kops","handlingStrategy":"validation","validationCode":"// before building, confirm the staged repo serves the file and its hash\nfor _, f := range requiredFiles {\n\th, err := fetchHashFor(fileRepository + \"/\" + f)\n\tif err != nil { return fmt.Errorf(\"file %s not staged in %s: run 'kops get assets --copy'\", f, fileRepository) }\n\t_ = h\n}","typeGuard":null,"tryCatchPattern":"fileAsset, err := assetBuilder.RemapFile(u, knownHash)\nif err != nil {\n\tif strings.Contains(err.Error(), \"kops get assets --copy\") {\n\t\treturn fmt.Errorf(\"staged file assets incomplete: run 'kops get assets --copy' with fileRepository %s\", fileRepository)\n\t}\n\treturn err\n}","preventionTips":["Always run 'kops get assets --copy' after changing assets/fileRepository config.","Verify the file repository URL is correct and reachable.","Check that each staged file has its accompanying .sha256 hash file.","Re-run staging after Kubernetes version upgrades."],"tags":["assets","staging","hashing","file-repository"],"backgroundTag":"unstaged-file-assets","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"}