hasura/graphql-engine · error

could not get files using a glob string: %w

Error message

could not get files using a glob string: %w

What it means

Raised in findMoveTargets when filepath.Glob fails to evaluate the glob pattern built from the plugin's FileOperation 'From' field joined with the source directory. The Go stdlib glob only errors on malformed patterns (ErrBadPattern), not on zero matches, so this indicates the plugin manifest specified an invalid glob expression.

Source

Thrown at cli/plugins/move.go:66

	if err != nil {
		return nil, errors.E(op, fmt.Errorf("failed to detect single move operation: %w", err))
	} else if ok {
		return []move{m}, nil
	}

	newDir, err := filepath.Abs(filepath.Join(filepath.FromSlash(toDir), filepath.FromSlash(fo.To)))
	if err != nil {
		return nil, errors.E(
			op,
			fmt.Errorf("could not get the relative path for the move dst: %w", err),
		)
	}

	gl, err := filepath.Glob(
		filepath.Join(filepath.FromSlash(fromDir), filepath.FromSlash(fo.From)),
	)
	if err != nil {
		return nil, errors.E(op, fmt.Errorf("could not get files using a glob string: %w", err))
	}

	if len(gl) == 0 {
		return nil, errors.E(
			op,
			fmt.Errorf("no files in the plugin archive matched the glob pattern=%s", fo.From),
		)
	}

	moves := make([]move, 0, len(gl))
	for _, v := range gl {
		newPath := filepath.Join(newDir, filepath.Base(filepath.FromSlash(v)))
		// Check secure path
		m := move{from: v, to: newPath}
		if !isMoveAllowed(fromDir, toDir, m) {
			return nil, errors.E(
				op,
				fmt.Errorf(

View on GitHub (pinned to 724551b9ae)

Solutions

  1. Inspect the plugin manifest's FileOperations[].From field printed in the error context and fix the glob syntax (use '*' wildcards, escape or avoid '[' ']' if not intended)
  2. Replace backslash-separated paths with forward slashes, since filepath.FromSlash is applied but raw '\' is treated as an escape on Unix
  3. Reinstall/refresh the plugin index after correcting the manifest
  4. If the pattern is literal and contains glob metacharacters, bracket-escape them per filepath.Match rules

Example fix

// before
From: "bin\\plugin[.exe"
// after
From: "bin/plugin.exe"
Defensive patterns

Strategy: validation

Validate before calling

if _, err := filepath.Match(filepath.FromSlash(fo.From), ""); err != nil {
    return fmt.Errorf("invalid glob in manifest: %w", err)
}

Try / catch

if err := moveToInstallDir(src, dst, fos); err != nil {
    if strings.Contains(err.Error(), "could not get files using a glob string") {
        // fix manifest From field, re-validate before retrying
    }
}

Prevention

When it happens

Trigger: A plugin manifest (plugin.yaml) FileOperations entry whose From field contains invalid glob syntax (e.g. unbalanced '[' or ']', or characters like '\' on Windows) that survives filepath.Join and is rejected by filepath.Glob.

Common situations: Hand-editing a plugin index/manifest with a broken glob; copy-pasting Windows-style paths with backslashes into From; plugin authors writing bracket expressions incorrectly.

Related errors


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