hasura/graphql-engine · error

could not find move targets: %w

Error message

could not find move targets: %w

What it means

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.

Source

Thrown at cli/plugins/move.go:174

		)
	}

	return m, true, nil
}

func isMoveAllowed(fromBase, toBase string, m move) bool {
	_, okFrom := IsSubPath(fromBase, m.from)
	_, okTo := IsSubPath(toBase, m.to)

	return okFrom && okTo
}

func moveFiles(fromDir, toDir string, fo FileOperation) error {
	var op errors.Op = "plugins.moveFiles"

	moves, err := findMoveTargets(fromDir, toDir, fo)
	if err != nil {
		return errors.E(op, fmt.Errorf("could not find move targets: %w", err))
	}

	for _, m := range moves {
		err := os.MkdirAll(filepath.Dir(m.to), 0o755)
		if err != nil {
			return errors.E(
				op,
				fmt.Errorf("failed to create move path %q: %w", filepath.Dir(m.to), err),
			)
		}

		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),
			)
		}

View on GitHub (pinned to 724551b9ae)

Solutions

  1. Read the wrapped error (%w chain) to identify which underlying failure (400–406) occurred and apply its fix
  2. Validate the plugin manifest's FileOperations against the actual archive contents before install
  3. Refresh the plugin index and retry
  4. If embedding the package, pre-validate From/To with IsSubPath and filepath.Glob
Defensive patterns

Strategy: try-catch

Try / catch

if err := moveFiles(fromDir, toDir, fo); err != nil {
    var inner = errors.Unwrap(err)
    for inner != nil { log.Println(inner); inner = errors.Unwrap(inner) }
    // branch on the root cause (glob, no-match, subpath, abs) before retrying
}

Prevention

When it happens

Trigger: Any of: invalid From glob, no glob matches, filepath.Abs/getcwd failure, or a move rejected by isMoveAllowed during a plugin install/move operation.

Common situations: Plugin install failing due to a mismatched manifest; changed archive layout between plugin versions; path traversal guard tripping on a hand-written manifest.

Related errors


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