{"record":{"id":"98bd40b4e1852b37","repo":"hasura/graphql-engine","slug":"failed-while-moving-files-to-the-installation-dire","errorCode":null,"errorMessage":"failed while moving files to the installation directory: %w","messagePattern":"failed while moving files to the installation directory: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/plugins/plugins.go","lineNumber":313,"sourceCode":"\t\tdefer func() {\n\t\t\tc.Logger.Debugf(\"Deleting the download staging directory %s\", downloadStagingDir)\n\n\t\t\terr := os.RemoveAll(downloadStagingDir)\n\t\t\tif err != nil {\n\t\t\t\tc.Logger.Debugf(\"failed to clean up download staging directory: %s\", err)\n\t\t\t}\n\t\t}()\n\n\t\terr = downloadAndExtract(downloadStagingDir, platform.URI, platform.Sha256)\n\t\tif err != nil {\n\t\t\treturn errors.E(op, fmt.Errorf(\"failed to unpack into staging dir: %w\", err))\n\t\t}\n\n\t\terr = moveToInstallDir(downloadStagingDir, installDir, platform.Files)\n\t\tif err != nil {\n\t\t\treturn errors.E(\n\t\t\t\top,\n\t\t\t\tfmt.Errorf(\"failed while moving files to the installation directory: %w\", err),\n\t\t\t)\n\t\t}\n\t}\n\n\tsubPathAbs, err := filepath.Abs(installDir)\n\tif err != nil {\n\t\treturn errors.E(\n\t\t\top,\n\t\t\tfmt.Errorf(\"failed to get the absolute fullPath of %q: %w\", installDir, err),\n\t\t)\n\t}\n\n\tfullPath := filepath.Join(installDir, filepath.FromSlash(platform.Bin))\n\n\tpathAbs, err := filepath.Abs(fullPath)\n\tif err != nil {\n\t\treturn errors.E(\n\t\t\top,","sourceCodeStart":295,"sourceCodeEnd":331,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/cli/plugins/plugins.go#L295-L331","documentation":"After a successful download, installPlugin() moves the declared files from the staging directory into the versioned install directory (PluginVersionInstallPath) via moveToInstallDir. This error wraps any failure during that move/copy — typically a missing declared file in the archive, or a filesystem error creating or writing into the install directory.","triggerScenarios":"moveToInstallDir failing because a path listed in platform.Files does not exist in the extracted archive, the install directory cannot be created (permissions, disk full), or a cross-device move with a copy fallback hitting a write error.","commonSituations":"Plugin manifest's Files list references paths that do not match the archive's internal layout (author renamed binaries); archive layout changed between versions while the manifest was hand-pinned; install dir unwritable after mixed sudo usage; disk full during copy.","solutions":["Extract the downloaded artifact manually and compare its contents against platform.Files in the plugin manifest; fix the manifest (or use a plugin version where they match)","Verify the install directory path can be created and written by the current user; fix ownership if a previous privileged install left root-owned dirs","Free disk space if the copy fails with ENOSPC","Clear both the staging and install directories and retry to eliminate partial-state issues"],"exampleFix":"// before: manifest lists a file the archive doesn't contain\n\"files\": { \"myplugin-linux-amd64\": \"myplugin\" }\n// after: match the archive's real layout\n\"files\": { \"bin/myplugin\": \"myplugin\" }","handlingStrategy":"validation","validationCode":"// sanity-check that declared files can plausibly exist in the artifact\nfor declared := range platform.Files {\n\tif strings.Contains(declared, \"..\") || declared == \"\" {\n\t\t// reject suspicious manifest before install\n\t}\n}","typeGuard":null,"tryCatchPattern":"if err := cfg.Install(plugin); err != nil && strings.Contains(err.Error(), \"moving files to the installation directory\") {\n\t// likely a Files/archive layout mismatch: extract the artifact and align the manifest\n}","preventionTips":["Keep platform.Files entries in sync with the archive layout every release","Test installs in CI for each published platform artifact","Ensure the install target directory is writable and the disk has space before installing"],"tags":["plugins","install","filesystem","manifest"],"backgroundTag":"file-move-to-install-dir-failed","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}