{"record":{"id":"a1034b15435aec03","repo":"hasura/graphql-engine","slug":"failed-moving-files-w","errorCode":null,"errorMessage":"failed moving files: %w","messagePattern":"failed moving files: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/plugins/move.go","lineNumber":204,"sourceCode":"\t\terr = renameOrCopy(m.from, m.to)\n\t\tif err != nil {\n\t\t\treturn errors.E(\n\t\t\t\top,\n\t\t\t\tfmt.Errorf(\"could not rename/copy file from %q to %q: %w\", m.from, m.to, err),\n\t\t\t)\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc moveAllFiles(fromDir, toDir string, fos []FileOperation) error {\n\tvar op errors.Op = \"plugins.moveAllFiles\"\n\n\tfor _, fo := range fos {\n\t\terr := moveFiles(fromDir, toDir, fo)\n\t\tif err != nil {\n\t\t\treturn errors.E(op, fmt.Errorf(\"failed moving files: %w\", err))\n\t\t}\n\t}\n\n\treturn nil\n}\n\n// moveToInstallDir moves plugins from srcDir to dstDir (created in this method) with given FileOperation.\nfunc moveToInstallDir(srcDir, installDir string, fos []FileOperation) error {\n\tvar op errors.Op = \"plugins.moveToInstallDir\"\n\n\tinstallationDir := filepath.Dir(installDir)\n\n\terr := os.MkdirAll(installationDir, 0o755)\n\tif err != nil {\n\t\treturn errors.E(op, fmt.Errorf(\"error creating directory at %q: %w\", installationDir, err))\n\t}\n\n\ttmp, err := os.MkdirTemp(\"\", \"hasura-temp-move\")","sourceCodeStart":186,"sourceCodeEnd":222,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/cli/plugins/move.go#L186-L222","documentation":"moveAllFiles iterates the plugin's FileOperation list and wraps any per-operation moveFiles failure as 'failed moving files'. It is a pure aggregation wrapper; the actionable cause is in the wrapped error (any of 407–409 for one FileOperation).","triggerScenarios":"At least one FileOperations entry in the plugin manifest fails during install — bad glob, blocked path, mkdir failure, or rename failure — while moving files from the extracted archive into the temp staging dir.","commonSituations":"One bad entry in a multi-file manifest breaking the whole install; environment permission issues on the plugins dir; archive/manifest drift.","solutions":["Unwrap the error to find which FileOperation and which underlying step failed, then fix that (see 400–409)","Remove or correct the offending FileOperations entry in the manifest","Retry after fixing permissions/disk issues","Reinstall from a refreshed plugin index"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"for _, fo := range fos {\n    if !validFileOperation(fo) { return fmt.Errorf(\"bad FileOperation %v\", fo) }\n}","typeGuard":null,"tryCatchPattern":"if err := moveAllFiles(src, tmp, fos); err != nil {\n    // unwrap to find failing entry index/log each fo before retry\n}","preventionTips":["Validate every FileOperations entry up front","Fail fast on first bad entry to avoid partial staging"],"tags":["go","wrapper","plugin-install"],"backgroundTag":"plugin-file-move-failed","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}