{"record":{"id":"0d6cdc4d8bfcaac9","repo":"hasura/graphql-engine","slug":"could-not-get-files-using-a-glob-string-w","errorCode":null,"errorMessage":"could not get files using a glob string: %w","messagePattern":"could not get files using a glob string: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/plugins/move.go","lineNumber":66,"sourceCode":"\tif err != nil {\n\t\treturn nil, errors.E(op, fmt.Errorf(\"failed to detect single move operation: %w\", err))\n\t} else if ok {\n\t\treturn []move{m}, nil\n\t}\n\n\tnewDir, err := filepath.Abs(filepath.Join(filepath.FromSlash(toDir), filepath.FromSlash(fo.To)))\n\tif err != nil {\n\t\treturn nil, errors.E(\n\t\t\top,\n\t\t\tfmt.Errorf(\"could not get the relative path for the move dst: %w\", err),\n\t\t)\n\t}\n\n\tgl, err := filepath.Glob(\n\t\tfilepath.Join(filepath.FromSlash(fromDir), filepath.FromSlash(fo.From)),\n\t)\n\tif err != nil {\n\t\treturn nil, errors.E(op, fmt.Errorf(\"could not get files using a glob string: %w\", err))\n\t}\n\n\tif len(gl) == 0 {\n\t\treturn nil, errors.E(\n\t\t\top,\n\t\t\tfmt.Errorf(\"no files in the plugin archive matched the glob pattern=%s\", fo.From),\n\t\t)\n\t}\n\n\tmoves := make([]move, 0, len(gl))\n\tfor _, v := range gl {\n\t\tnewPath := filepath.Join(newDir, filepath.Base(filepath.FromSlash(v)))\n\t\t// Check secure path\n\t\tm := move{from: v, to: newPath}\n\t\tif !isMoveAllowed(fromDir, toDir, m) {\n\t\t\treturn nil, errors.E(\n\t\t\t\top,\n\t\t\t\tfmt.Errorf(","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/cli/plugins/move.go#L48-L84","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["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)","Replace backslash-separated paths with forward slashes, since filepath.FromSlash is applied but raw '\\' is treated as an escape on Unix","Reinstall/refresh the plugin index after correcting the manifest","If the pattern is literal and contains glob metacharacters, bracket-escape them per filepath.Match rules"],"exampleFix":"// before\nFrom: \"bin\\\\plugin[.exe\"\n// after\nFrom: \"bin/plugin.exe\"","handlingStrategy":"validation","validationCode":"if _, err := filepath.Match(filepath.FromSlash(fo.From), \"\"); err != nil {\n    return fmt.Errorf(\"invalid glob in manifest: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"if err := moveToInstallDir(src, dst, fos); err != nil {\n    if strings.Contains(err.Error(), \"could not get files using a glob string\") {\n        // fix manifest From field, re-validate before retrying\n    }\n}","preventionTips":["Validate FileOperations globs with filepath.Match before publishing a plugin manifest","Use forward slashes and simple '*' patterns in From","Add manifest linting to plugin CI"],"tags":["go","filesystem","glob","plugin-install"],"backgroundTag":"invalid-glob-pattern","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}