hasura/graphql-engine · warning

failed to get the matching platform for plugin %s: %w

Error message

failed to get the matching platform for plugin %s: %w

What it means

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.

Source

Thrown at cli/commands/plugins_list.go:137

	var rows [][]string

	cols := []string{"NAME", "DESCRIPTION", "VERSION", "INSTALLED"}

	for _, name := range names {
		plugin := pluginMap[name]

		var (
			status  string
			version string
		)

		if _, ok := installed[name]; ok {
			status = "yes"
		} else if _, ok, err := plugins.MatchPlatform(plugin.Platforms); err != nil {
			return errors.E(
				op,
				fmt.Errorf("failed to get the matching platform for plugin %s: %w", name, err),
			)
		} else if ok {
			status = "no"
		} else {
			status = "unavailable on " + runtime.GOOS
		}

		if status == "yes" {
			version = installed[name]
		} else {
			version = plugin.Version
		}

		rows = append(
			rows,
			[]string{name, limitString(plugin.ShortDescription, 50), version, status},
		)
	}

View on GitHub (pinned to 724551b9ae)

Solutions

  1. Re-run `hasura plugins list` to refresh the plugin index and rule out a transient bad cache
  2. Clear the local plugins cache/index directory (under the hasura CLI config dir, e.g. ~/.hasura/) and retry
  3. Check that your OS/arch (runtime.GOOS-runtime.GOARCH) is a supported combination for the CLI build
  4. If it persists, inspect the plugin index file for malformed entries and report the issue upstream
Defensive patterns

Strategy: try-catch

Validate before calling

// Check platform support before listing/depending on a plugin
if _, ok, err := plugins.MatchPlatform(plugin.Platforms); err != nil || !ok {
    log.Printf("plugin %s unavailable on %s-%s", plugin.Name, runtime.GOOS, runtime.GOARCH)
}

Try / catch

// In Go: treat as non-fatal status degradation
if _, ok, err := plugins.MatchPlatform(p.Platforms); err != nil {
    status = "unknown (platform lookup failed)" // don't abort the listing
} else if ok { status = "no" } else { status = "unavailable on " + runtime.GOOS }

Prevention

When it happens

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

Common situations: 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.

Related errors


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