{"record":{"id":"800a94be500de7ba","repo":"hasura/graphql-engine","slug":"could-not-find-move-targets-w","errorCode":null,"errorMessage":"could not find move targets: %w","messagePattern":"could not find move targets: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/plugins/move.go","lineNumber":174,"sourceCode":"\t\t)\n\t}\n\n\treturn m, true, nil\n}\n\nfunc isMoveAllowed(fromBase, toBase string, m move) bool {\n\t_, okFrom := IsSubPath(fromBase, m.from)\n\t_, okTo := IsSubPath(toBase, m.to)\n\n\treturn okFrom && okTo\n}\n\nfunc moveFiles(fromDir, toDir string, fo FileOperation) error {\n\tvar op errors.Op = \"plugins.moveFiles\"\n\n\tmoves, err := findMoveTargets(fromDir, toDir, fo)\n\tif err != nil {\n\t\treturn errors.E(op, fmt.Errorf(\"could not find move targets: %w\", err))\n\t}\n\n\tfor _, m := range moves {\n\t\terr := os.MkdirAll(filepath.Dir(m.to), 0o755)\n\t\tif err != nil {\n\t\t\treturn errors.E(\n\t\t\t\top,\n\t\t\t\tfmt.Errorf(\"failed to create move path %q: %w\", filepath.Dir(m.to), err),\n\t\t\t)\n\t\t}\n\n\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}","sourceCodeStart":156,"sourceCodeEnd":192,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/cli/plugins/move.go#L156-L192","documentation":"moveFiles wraps any failure of findMoveTargets: glob evaluation errors, zero glob matches, path-resolution failures, or disallowed moves (errors 400–406). It is a pure wrapper adding the 'could not find move targets' context, so the real cause is in the wrapped error chain.","triggerScenarios":"Any of: invalid From glob, no glob matches, filepath.Abs/getcwd failure, or a move rejected by isMoveAllowed during a plugin install/move operation.","commonSituations":"Plugin install failing due to a mismatched manifest; changed archive layout between plugin versions; path traversal guard tripping on a hand-written manifest.","solutions":["Read the wrapped error (%w chain) to identify which underlying failure (400–406) occurred and apply its fix","Validate the plugin manifest's FileOperations against the actual archive contents before install","Refresh the plugin index and retry","If embedding the package, pre-validate From/To with IsSubPath and filepath.Glob"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := moveFiles(fromDir, toDir, fo); err != nil {\n    var inner = errors.Unwrap(err)\n    for inner != nil { log.Println(inner); inner = errors.Unwrap(inner) }\n    // branch on the root cause (glob, no-match, subpath, abs) before retrying\n}","preventionTips":["Always log the full unwrapped chain for this wrapper","Pre-validate globs and subpaths (see 400/401/402/406) before install"],"tags":["go","wrapper","plugin-install","filesystem"],"backgroundTag":"plugin-file-move-failed","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}