{"record":{"id":"0975762f73d98f71","repo":"docker/compose","slug":"error-checking-docker-model-status-w","errorCode":null,"errorMessage":"error checking docker-model status: %w","messagePattern":"error checking docker-model status: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/compose/model.go","lineNumber":205,"sourceCode":"\t}\n\tevents.On(api.Resource{\n\t\tID:     config.Name,\n\t\tStatus: api.Done,\n\t\tText:   api.StatusConfigured,\n\t})\n\treturn nil\n}\n\nfunc (m *modelAPI) SetModelVariables(ctx context.Context, project *types.Project) error {\n\tcmd := exec.CommandContext(ctx, m.path, \"status\", \"--json\")\n\terr := m.prepare(ctx, cmd)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tstatusOut, err := cmd.CombinedOutput()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error checking docker-model status: %w\", err)\n\t}\n\ttype Status struct {\n\t\tEndpoint string `json:\"endpoint\"`\n\t}\n\n\tvar status Status\n\terr = json.Unmarshal(statusOut, &status)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfor _, service := range project.Services {\n\t\tfor ref, modelConfig := range service.Models {\n\t\t\tmodel := project.Models[ref]\n\t\t\tvarPrefix := strings.ReplaceAll(strings.ToUpper(ref), \"-\", \"_\")\n\t\t\tvar variable string\n\t\t\tif modelConfig != nil && modelConfig.ModelVariable != \"\" {\n\t\t\t\tvariable = modelConfig.ModelVariable","sourceCodeStart":187,"sourceCodeEnd":223,"githubUrl":"https://github.com/docker/compose/blob/ddc4b044b62e9f715212ea4143fa830fac76382f/pkg/compose/model.go#L187-L223","documentation":"Before using models, compose runs `<plugin> status --json` and parses the endpoint from its combined output. A non-zero exit from that subprocess is wrapped here. It means the model plugin binary ran but the status query itself failed.","triggerScenarios":"exec.CommandContext of `docker model status --json` exits non-zero: model backend not running, invalid DOCKER_HOST/endpoint propagation, plugin version that errors on status.","commonSituations":"DOCKER_HOST pointing at a remote/unreachable daemon; model backend service stopped; version mismatch between plugin and backend after a partial upgrade.","solutions":["Run docker model status --json by hand and read its stderr","Ensure the Docker daemon (and model backend) is up: docker info","Verify DOCKER_HOST / context is correct for the environment compose runs in","Update the model plugin to match the backend version"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// smoke-test the plugin before compose runs\nout, err := exec.CommandContext(ctx, \"docker\", \"model\", \"status\", \"--json\").CombinedOutput()\nif err != nil {\n    return fmt.Errorf(\"model backend unhealthy: %w: %s\", err, out)\n}","typeGuard":null,"tryCatchPattern":"if err := setModelVars(ctx, project); err != nil && strings.Contains(err.Error(), \"docker-model status\") {\n    // surface plugin output; start model backend; retry once\n}","preventionTips":["Ensure the daemon and model backend are up before compose commands that touch models","Keep DOCKER_HOST/context consistent between the shell and the plugin environment"],"tags":["models","plugin","exec","status"],"backgroundTag":null,"analyzedSha":"ddc4b044b62e9f715212ea4143fa830fac76382f","analyzedAt":"2026-08-15T13:31:42.319Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}