{"record":{"id":"d4b8c7d57f157e32","repo":"docker/compose","slug":"error-checking-available-models-w","errorCode":null,"errorMessage":"error checking available models: %w","messagePattern":"error checking available models: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/compose/model.go","lineNumber":262,"sourceCode":"\tConfig  struct {\n\t\tFormat       string `json:\"format\"`\n\t\tQuantization string `json:\"quantization\"`\n\t\tParameters   string `json:\"parameters\"`\n\t\tArchitecture string `json:\"architecture\"`\n\t\tSize         string `json:\"size\"`\n\t} `json:\"config\"`\n}\n\nfunc (m *modelAPI) ListModels(ctx context.Context) ([]string, error) {\n\tcmd := exec.CommandContext(ctx, m.path, \"ls\", \"--json\")\n\terr := m.prepare(ctx, cmd)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\toutput, err := cmd.CombinedOutput()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error checking available models: %w\", err)\n\t}\n\n\ttype AvailableModel struct {\n\t\tId      string   `json:\"id\"`\n\t\tTags    []string `json:\"tags\"`\n\t\tCreated int      `json:\"created\"`\n\t}\n\n\tmodels := []AvailableModel{}\n\terr = json.Unmarshal(output, &models)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error unmarshalling available models: %w\", err)\n\t}\n\tvar availableModels []string\n\tfor _, model := range models {\n\t\tavailableModels = append(availableModels, model.Tags...)\n\t}\n\treturn availableModels, nil","sourceCodeStart":244,"sourceCodeEnd":280,"githubUrl":"https://github.com/docker/compose/blob/ddc4b044b62e9f715212ea4143fa830fac76382f/pkg/compose/model.go#L244-L280","documentation":"To validate model references in a compose file, compose executes `<plugin> ls --json` to enumerate available models. If the subprocess exits non-zero, the failure is wrapped with this message — the plugin ran but could not list models.","triggerScenarios":"docker model ls --json exiting non-zero during compose commands that touch models (up with a models section, model validation): backend down, plugin internal error, no model catalog reachable.","commonSituations":"Offline machines where the catalog fetch fails; model backend not started; plugin/auth misconfiguration after environment changes.","solutions":["Run docker model ls --json manually to see the underlying error","Start/verify the Docker model backend (docker desktop / engine restart if applicable)","Check network access for the model catalog; retry once online","Update the model plugin if the output indicates an unsupported flag"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"if _, err := exec.Command(\"docker\", \"model\", \"ls\", \"--json\").Output(); err != nil {\n    return errors.New(\"model catalog unavailable; check plugin/backend before running compose\")\n}","typeGuard":null,"tryCatchPattern":"if err := listModels(ctx); err != nil && strings.Contains(err.Error(), \"error checking available models\") {\n    // transient catalog failures: back off and retry once\n}","preventionTips":["Warm the model catalog once (docker model ls) before batch compose operations","Treat catalog errors as retriable in automation; do not fail pipelines on first attempt"],"tags":["models","plugin","exec","catalog"],"backgroundTag":null,"analyzedSha":"ddc4b044b62e9f715212ea4143fa830fac76382f","analyzedAt":"2026-08-15T13:31:42.319Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}