{"record":{"id":"f8234fb5c1750a43","repo":"docker/cli","slug":"plugin-schemaversion-q-is-not-supported-must-be","errorCode":null,"errorMessage":"plugin SchemaVersion %q is not supported: must be lower than 2.0.0","messagePattern":"plugin SchemaVersion %q is not supported: must be lower than 2\\.0\\.0","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cli-plugins/manager/plugin.go","lineNumber":151,"sourceCode":"// The current schema-version is \"0.1.0\", but we don't want to break compatibility\n// until v2.0.0 of the schema version. Check for the major version to be < 2.0.0.\n//\n// Note that CLI versions before 28.4.1 may not support these versions as they were\n// hard-coded to only accept \"0.1.0\".\nfunc validateSchemaVersion(version string) error {\n\tif version == \"0.1.0\" {\n\t\treturn nil\n\t}\n\tif version == \"\" {\n\t\treturn errors.New(\"plugin SchemaVersion version cannot be empty\")\n\t}\n\tmajor, _, ok := strings.Cut(version, \".\")\n\tmajorVersion, err := strconv.Atoi(major)\n\tif !ok || err != nil {\n\t\treturn fmt.Errorf(\"plugin SchemaVersion %q has wrong format: must be <major>.<minor>.<patch>\", version)\n\t}\n\tif majorVersion > 1 {\n\t\treturn fmt.Errorf(\"plugin SchemaVersion %q is not supported: must be lower than 2.0.0\", version)\n\t}\n\treturn nil\n}\n\n// RunHook executes the plugin's hooks command\n// and returns its unprocessed output.\nfunc (p *Plugin) RunHook(ctx context.Context, hookData hooks.Request) ([]byte, error) {\n\thDataBytes, err := json.Marshal(hookData)\n\tif err != nil {\n\t\treturn nil, wrapAsPluginError(err, \"failed to marshall hook data\")\n\t}\n\n\tpCmd := exec.CommandContext(ctx, p.Path, p.Name, metadata.HookSubcommandName, string(hDataBytes)) // #nosec G204 -- ignore \"Subprocess launched with a potential tainted input or cmd arguments\"\n\tpCmd.Env = os.Environ()\n\tpCmd.Env = append(pCmd.Env, metadata.ReexecEnvvar+\"=\"+os.Args[0])\n\n\tout, err := pCmd.Output()\n\tif err != nil {","sourceCodeStart":133,"sourceCodeEnd":169,"githubUrl":"https://github.com/docker/cli/blob/4f84911bfe8811e9b028e4b1fee8e7510be79387/cli-plugins/manager/plugin.go#L133-L169","documentation":"Returned by validateSchemaVersion when the parsed major version is >= 2, i.e. the plugin uses a schema newer than this CLI supports. The CLI accepts major 0 and 1 only; 2.0.0 and above are rejected as unsupported, preserving forward compatibility.","triggerScenarios":"A plugin built against a future schema version (2.x.y) run by an older CLI that only knows schemas < 2.0.0.","commonSituations":"Mixing a newer plugin with an older Docker CLI, where the plugin adopted a not-yet-supported schema.","solutions":["Upgrade the Docker CLI to a version that supports the plugin's schema.","Pin/use a plugin version that targets schema 0.1.0 or 1.x with the current CLI.","If authoring the plugin, target schema 0.1.0 or 1.x for broad compatibility."],"exampleFix":"// before\nSchemaVersion: \"2.0.0\"\n// after\nSchemaVersion: \"1.0.0\"","handlingStrategy":"validation","validationCode":"major, _, _ := strings.Cut(version, \".\")\nm, _ := strconv.Atoi(major)\nif m >= 2 {\n    return fmt.Errorf(\"schema %s unsupported; upgrade CLI or pin plugin to schema < 2.0.0\", version)\n}","typeGuard":null,"tryCatchPattern":"if err := validateSchemaVersion(v); err != nil {\n    // mark plugin invalid but do not crash\n}","preventionTips":["Match plugin schema version to CLI capabilities.","Pin plugins to schema 0.1.0 or 1.x for broad compatibility.","Upgrade the CLI when adopting schema 2.x plugins."],"tags":["cli-plugins","plugins","schema-version","version-compat"],"backgroundTag":null,"analyzedSha":"4f84911bfe8811e9b028e4b1fee8e7510be79387","analyzedAt":"2026-08-07T12:15:29.814Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}