{"record":{"id":"4653a3a136f31a2d","repo":"kubernetes/kops","slug":"error-copying-file-q-v","errorCode":null,"errorMessage":"error copying file %q: %v","messagePattern":"error copying file %q: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/nodeup/nodetasks/file.go","lineNumber":292,"sourceCode":"\tcase FileType_Directory:\n\t\tif a == nil {\n\t\t\tparent := filepath.Dir(strings.TrimSuffix(e.Path, \"/\"))\n\t\t\terr := os.MkdirAll(parent, dirMode)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"error creating parent directories %q: %v\", parent, err)\n\t\t\t}\n\n\t\t\terr = os.MkdirAll(e.Path, fileMode)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"error creating directory %q: %v\", e.Path, err)\n\t\t\t}\n\t\t\tchanged = true\n\t\t}\n\tcase FileType_File:\n\t\tif changes.Contents != nil {\n\t\t\terr = fi.WriteFile(e.Path, e.Contents, fileMode, dirMode, fi.ValueOf(e.Owner), fi.ValueOf(e.Group))\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"error copying file %q: %v\", e.Path, err)\n\t\t\t}\n\t\t\tchanged = true\n\t\t}\n\tdefault:\n\t\treturn fmt.Errorf(\"File type=%q not valid/supported\", e.Type)\n\t}\n\n\tif changes.Mode != nil {\n\t\tmodeChanged, err := fi.EnsureFileMode(e.Path, fileMode)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error changing mode on %q: %v\", e.Path, err)\n\t\t}\n\t\tchanged = changed || modeChanged\n\t}\n\n\tif changes.Owner != nil || changes.Group != nil {\n\t\townerChanged, err := fi.EnsureFileOwner(e.Path, fi.ValueOf(e.Owner), fi.ValueOf(e.Group))\n\t\tif err != nil {","sourceCodeStart":274,"sourceCodeEnd":310,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/nodeup/nodetasks/file.go#L274-L310","documentation":"Error \"error copying file %q: %v\" thrown in kubernetes/kops.","triggerScenarios":"Thrown at upup/pkg/fi/nodeup/nodetasks/file.go:292 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"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"}