{"record":{"id":"3c40baab94cd00ab","repo":"hashicorp/nomad","slug":"unsupported-plugin-type-q","errorCode":null,"errorMessage":"unsupported plugin type %q","messagePattern":"unsupported plugin type %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"helper/pluginutils/loader/init.go","lineNumber":189,"sourceCode":"// version or an error if the plugins response is malformed. If there is no\n// overlap, an empty string is returned.\nfunc (l *PluginLoader) selectApiVersion(i *base.PluginInfoResponse) (string, error) {\n\tif i == nil {\n\t\treturn \"\", fmt.Errorf(\"nil plugin info given\")\n\t}\n\tif len(i.PluginApiVersions) == 0 {\n\t\treturn \"\", fmt.Errorf(\"plugin provided no compatible API versions\")\n\t}\n\n\tpluginVersions, err := convertVersions(i.PluginApiVersions)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"plugin provided invalid versions: %v\", err)\n\t}\n\n\t// Lookup the supported versions. These will be sorted highest to lowest\n\tsupportedVersions, ok := l.supportedVersions[i.Type]\n\tif !ok {\n\t\treturn \"\", fmt.Errorf(\"unsupported plugin type %q\", i.Type)\n\t}\n\n\tfor _, sv := range supportedVersions {\n\t\tfor _, pv := range pluginVersions {\n\t\t\tif sv.Equal(pv) {\n\t\t\t\treturn pv.Original(), nil\n\t\t\t}\n\t\t}\n\t}\n\n\treturn \"\", nil\n}\n\n// convertVersions takes a list of string versions and returns a sorted list of\n// versions from highest to lowest.\nfunc convertVersions(in []string) ([]*version.Version, error) {\n\tconverted := make([]*version.Version, len(in))\n\tfor i, v := range in {","sourceCodeStart":171,"sourceCodeEnd":207,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/helper/pluginutils/loader/init.go#L171-L207","documentation":"Negotiation looks up the loader's supportedVersions table keyed by the plugin type reported by the plugin. If the type is not registered (no supported API versions known for it), selectApiVersion returns this error and the plugin is skipped.","triggerScenarios":"PluginInfoResponse.Type is empty, custom, or misspelled, so l.supportedVersions[i.Type] lookup fails during initInternal/fingerprint/dispense.","commonSituations":"Plugin built with a plugin type this Nomad build doesn't know (e.g. a new plugin type added upstream); typo'd type string in a custom plugin.","solutions":["Set the plugin's Type to a supported type constant (base.PluginTypeCSI, base.PluginTypeDevice, base.PluginTypeDriver, etc.)","Upgrade Nomad if the plugin uses a newer plugin type this version doesn't support","Fix the type string if it was misspelled or left empty"],"exampleFix":"// before\n&base.PluginInfoResponse{Type: \"csi-driver\", ...}\n// after\n&base.PluginInfoResponse{Type: base.PluginTypeCSI, ...}","handlingStrategy":"validation","validationCode":"switch info.Type {\ncase base.PluginTypeCSI, base.PluginTypeDevice, base.PluginTypeDriver:\n    // ok\ndefault:\n    return fmt.Errorf(\"unsupported plugin type %q\", info.Type)\n}","typeGuard":"func typeSupported(t string) bool {\n    switch t {\n    case base.PluginTypeCSI, base.PluginTypeDevice, base.PluginTypeDriver:\n        return true\n    }\n    return false\n}","tryCatchPattern":"if err := loader.Init(...); err != nil {\n    if strings.Contains(err.Error(), \"unsupported plugin type\") {\n        // plugin's Type isn't in this Nomad build's supportedVersions\n    }\n}","preventionTips":["Use the exported base.PluginType* constants, never raw strings","Keep plugin and Nomad versions in sync when new plugin types are introduced","Check supportedVersions for the target Nomad release before registering a new type"],"tags":["go","plugin-loader","plugin-type","nomad"],"backgroundTag":"unsupported-plugin-type","analyzedSha":"482b49bf1aec006f089bcfc7e632d8f6ac303e5e","analyzedAt":"2026-09-04T07:54:14.808Z","contentChangedAt":"2026-09-04T07:54:14.808Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}