hasura/graphql-engine · error

failed moving files: %w

Error message

failed moving files: %w

What it means

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).

Source

Thrown at cli/plugins/move.go:204

		err = renameOrCopy(m.from, m.to)
		if err != nil {
			return errors.E(
				op,
				fmt.Errorf("could not rename/copy file from %q to %q: %w", m.from, m.to, err),
			)
		}
	}

	return nil
}

func moveAllFiles(fromDir, toDir string, fos []FileOperation) error {
	var op errors.Op = "plugins.moveAllFiles"

	for _, fo := range fos {
		err := moveFiles(fromDir, toDir, fo)
		if err != nil {
			return errors.E(op, fmt.Errorf("failed moving files: %w", err))
		}
	}

	return nil
}

// moveToInstallDir moves plugins from srcDir to dstDir (created in this method) with given FileOperation.
func moveToInstallDir(srcDir, installDir string, fos []FileOperation) error {
	var op errors.Op = "plugins.moveToInstallDir"

	installationDir := filepath.Dir(installDir)

	err := os.MkdirAll(installationDir, 0o755)
	if err != nil {
		return errors.E(op, fmt.Errorf("error creating directory at %q: %w", installationDir, err))
	}

	tmp, err := os.MkdirTemp("", "hasura-temp-move")

View on GitHub (pinned to 724551b9ae)

Solutions

  1. Unwrap the error to find which FileOperation and which underlying step failed, then fix that (see 400–409)
  2. Remove or correct the offending FileOperations entry in the manifest
  3. Retry after fixing permissions/disk issues
  4. Reinstall from a refreshed plugin index
Defensive patterns

Strategy: try-catch

Validate before calling

for _, fo := range fos {
    if !validFileOperation(fo) { return fmt.Errorf("bad FileOperation %v", fo) }
}

Try / catch

if err := moveAllFiles(src, tmp, fos); err != nil {
    // unwrap to find failing entry index/log each fo before retry
}

Prevention

When it happens

Trigger: 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.

Common situations: One bad entry in a multi-file manifest breaking the whole install; environment permission issues on the plugins dir; archive/manifest drift.

Related errors


AI-assisted analysis of hasura/graphql-engine@724551b9ae (2026-08-28). Data as JSON: /api/errors/a1034b15435aec03. Report an issue: GitHub.