{"record":{"id":"a69150f17d14190a","repo":"hasura/graphql-engine","slug":"failed-to-get-the-matching-platform-for-plugin-s","errorCode":null,"errorMessage":"failed to get the matching platform for plugin %s: %w","messagePattern":"failed to get the matching platform for plugin (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cli/commands/plugins_list.go","lineNumber":137,"sourceCode":"\n\tvar rows [][]string\n\n\tcols := []string{\"NAME\", \"DESCRIPTION\", \"VERSION\", \"INSTALLED\"}\n\n\tfor _, name := range names {\n\t\tplugin := pluginMap[name]\n\n\t\tvar (\n\t\t\tstatus  string\n\t\t\tversion string\n\t\t)\n\n\t\tif _, ok := installed[name]; ok {\n\t\t\tstatus = \"yes\"\n\t\t} else if _, ok, err := plugins.MatchPlatform(plugin.Platforms); err != nil {\n\t\t\treturn errors.E(\n\t\t\t\top,\n\t\t\t\tfmt.Errorf(\"failed to get the matching platform for plugin %s: %w\", name, err),\n\t\t\t)\n\t\t} else if ok {\n\t\t\tstatus = \"no\"\n\t\t} else {\n\t\t\tstatus = \"unavailable on \" + runtime.GOOS\n\t\t}\n\n\t\tif status == \"yes\" {\n\t\t\tversion = installed[name]\n\t\t} else {\n\t\t\tversion = plugin.Version\n\t\t}\n\n\t\trows = append(\n\t\t\trows,\n\t\t\t[]string{name, limitString(plugin.ShortDescription, 50), version, status},\n\t\t)\n\t}","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/cli/commands/plugins_list.go#L119-L155","documentation":"While listing plugins (`hasura plugins list`), the CLI calls plugins.MatchPlatform on each plugin's declared platform list to decide its availability status. The error is wrapped into 'failed to get the matching platform for plugin %s' when MatchPlatform returns a non-nil error. In practice MatchPlatform (cli/plugins/util.go:130) matches a '{GOOS}-{GOARCH}' selector and currently always returns a nil error, so this branch is purely defensive and would only fire if MatchPlatform's signature gains real failure modes in the future.","triggerScenarios":"Running `hasura plugins list` when the plugins index is fetched/parsed and a plugin entry is processed; the code path is the run() loop in cli/commands/plugins_list.go:137 calling plugins.MatchPlatform(plugin.Platforms). Only triggers if MatchPlatform itself errors (not merely when no platform matches — that yields the 'unavailable on <GOOS>' status instead).","commonSituations":"A malformed or hand-edited plugins index with invalid platform selectors, or a CLI version where MatchPlatform performs OS/arch parsing that can fail. Most users will never see this; seeing it usually means a corrupted local plugin index cache.","solutions":["Re-run `hasura plugins list` to refresh the plugin index and rule out a transient bad cache","Clear the local plugins cache/index directory (under the hasura CLI config dir, e.g. ~/.hasura/) and retry","Check that your OS/arch (runtime.GOOS-runtime.GOARCH) is a supported combination for the CLI build","If it persists, inspect the plugin index file for malformed entries and report the issue upstream"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Check platform support before listing/depending on a plugin\nif _, ok, err := plugins.MatchPlatform(plugin.Platforms); err != nil || !ok {\n    log.Printf(\"plugin %s unavailable on %s-%s\", plugin.Name, runtime.GOOS, runtime.GOARCH)\n}","typeGuard":null,"tryCatchPattern":"// In Go: treat as non-fatal status degradation\nif _, ok, err := plugins.MatchPlatform(p.Platforms); err != nil {\n    status = \"unknown (platform lookup failed)\" // don't abort the listing\n} else if ok { status = \"no\" } else { status = \"unavailable on \" + runtime.GOOS }","preventionTips":["Keep the local plugin index fresh by running plugins list periodically","Avoid hand-editing the plugins index cache"],"tags":["plugins","platform-matching","hasura-cli","go"],"backgroundTag":"plugin-platform-unsupported","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}