{"record":{"id":"78dabea0c5a4ca6c","repo":"hasura/graphql-engine","slug":"failed-to-create-move-path-q-w","errorCode":null,"errorMessage":"failed to create move path %q: %w","messagePattern":"failed to create move path %q: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/plugins/move.go","lineNumber":182,"sourceCode":"\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}\n\t}\n\n\treturn nil\n}\n\nfunc moveAllFiles(fromDir, toDir string, fos []FileOperation) error {\n\tvar op errors.Op = \"plugins.moveAllFiles\"\n","sourceCodeStart":164,"sourceCodeEnd":200,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/cli/plugins/move.go#L164-L200","documentation":"During moveFiles, after move targets are resolved, os.MkdirAll on the parent directory of a destination file failed. This is a plain filesystem error: permission denied, a file existing where a directory is needed, read-only filesystem, or I/O failure.","triggerScenarios":"The install destination's parent dir cannot be created: no write permission under ~/.local/share/hasura (or the configured install path), a regular file occupies an intermediate path component, or the disk/filesystem is read-only or full.","commonSituations":"Running the CLI as a different user than the one owning the plugins dir; HOME/XDG vars pointing somewhere unwritable; Docker/container read-only volume; leftover file named like the target directory after a partial install.","solutions":["Check permissions/ownership of the plugins install root (ls -la on the dir from the error message) and chown/chmod or sudo as appropriate","Verify HOME / XDG_DATA_HOME (or HASURA_* path env vars) point to a writable location","Remove any stale regular file blocking the directory path (rm the file named in the error)","Ensure the volume is writable and has space; then retry the install"],"exampleFix":"# before: regular file blocking dir path\nrm ~/.local/share/hasura/plugins/foo\n# after\nhasura plugins install foo-plugin","handlingStrategy":"try-catch","validationCode":"if err := syscall.Access(filepath.Dir(destParent), unix.W_OK); err != nil {\n    return errors.New(\"install dir not writable\")\n}","typeGuard":null,"tryCatchPattern":"if err := moveToInstallDir(...); err != nil {\n    var perr *fs.PathError\n    if errors.As(err, &perr) && os.IsPermission(perr) { /* fix perms, retry */ }\n}","preventionTips":["Ensure the plugins install root is user-writable before install","Never mix sudo and non-sudo installs","Keep intermediate path components free of regular files"],"tags":["go","filesystem","permissions","mkdir"],"backgroundTag":"mkdir-permission-denied","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}