{"record":{"id":"3688032e001dc35f","repo":"docker/compose","slug":"failed-to-load-docker-model-plugin-w","errorCode":null,"errorMessage":"failed to load Docker Model plugin: %w","messagePattern":"failed to load Docker Model plugin: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/compose/model.go","lineNumber":90,"sourceCode":"\ntype modelAPI struct {\n\tpath    string\n\tenv     []string\n\tprepare func(ctx context.Context, cmd *exec.Cmd) error\n\tcleanup func()\n\tversion string\n}\n\nfunc (s *composeService) newModelAPI(project *types.Project) (*modelAPI, error) {\n\tdockerModel, err := manager.GetPlugin(\"model\", s.dockerCli, &cobra.Command{})\n\tif err != nil {\n\t\tif errdefs.IsNotFound(err) {\n\t\t\treturn nil, fmt.Errorf(\"'models' support requires Docker Model plugin\")\n\t\t}\n\t\treturn nil, err\n\t}\n\tif dockerModel.Err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to load Docker Model plugin: %w\", dockerModel.Err)\n\t}\n\tendpoint, cleanup, err := s.propagateDockerEndpoint()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &modelAPI{\n\t\tpath:    dockerModel.Path,\n\t\tversion: dockerModel.Version,\n\t\tprepare: func(ctx context.Context, cmd *exec.Cmd) error {\n\t\t\treturn s.prepareShellOut(ctx, project.Environment, cmd)\n\t\t},\n\t\tcleanup: cleanup,\n\t\tenv:     append(project.Environment.Values(), endpoint...),\n\t}, nil\n}\n\nfunc (m *modelAPI) Close() {\n\tm.cleanup()","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/docker/compose/blob/ddc4b044b62e9f715212ea4143fa830fac76382f/pkg/compose/model.go#L72-L108","documentation":"The model plugin executable was found by the plugin manager, but it reported a load error (dockerModel.Err). This means the plugin is registered yet broken — a different failure from the plugin being absent.","triggerScenarios":"Plugin discovery succeeds but the plugin metadata/metadata-load step errors: corrupted plugin install, wrong executable permissions, incompatible plugin build.","commonSituations":"Half-completed plugin installs, plugin updated to a version the installed CLI cannot load, filesystem permission problems on the plugin binary path.","solutions":["Run docker model version / docker model ls directly to see the plugin's own failure","Reinstall the model plugin (remove and re-add via the plugin manager / reinstall Docker Desktop component)","Check the plugin binary is executable and its path intact"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := runWithModels(ctx, project); err != nil {\n    if strings.Contains(err.Error(), \"failed to load Docker Model plugin\") {\n        // reinstall/repair the plugin, then retry once\n    }\n}","preventionTips":["Verify `docker model version` succeeds after every Docker/plugin upgrade","Reinstall the plugin cleanly rather than copying binaries around"],"tags":["models","plugin","installation"],"backgroundTag":null,"analyzedSha":"ddc4b044b62e9f715212ea4143fa830fac76382f","analyzedAt":"2026-08-15T13:31:42.319Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}