docker/compose · error
error checking available models: %w
Error message
error checking available models: %w
What it means
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.
Source
Thrown at pkg/compose/model.go:262
Config struct {
Format string `json:"format"`
Quantization string `json:"quantization"`
Parameters string `json:"parameters"`
Architecture string `json:"architecture"`
Size string `json:"size"`
} `json:"config"`
}
func (m *modelAPI) ListModels(ctx context.Context) ([]string, error) {
cmd := exec.CommandContext(ctx, m.path, "ls", "--json")
err := m.prepare(ctx, cmd)
if err != nil {
return nil, err
}
output, err := cmd.CombinedOutput()
if err != nil {
return nil, fmt.Errorf("error checking available models: %w", err)
}
type AvailableModel struct {
Id string `json:"id"`
Tags []string `json:"tags"`
Created int `json:"created"`
}
models := []AvailableModel{}
err = json.Unmarshal(output, &models)
if err != nil {
return nil, fmt.Errorf("error unmarshalling available models: %w", err)
}
var availableModels []string
for _, model := range models {
availableModels = append(availableModels, model.Tags...)
}
return availableModels, nilView on GitHub (pinned to ddc4b044b6)
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
Defensive patterns
Strategy: retry
Validate before calling
if _, err := exec.Command("docker", "model", "ls", "--json").Output(); err != nil {
return errors.New("model catalog unavailable; check plugin/backend before running compose")
} Try / catch
if err := listModels(ctx); err != nil && strings.Contains(err.Error(), "error checking available models") {
// transient catalog failures: back off and retry once
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: Offline machines where the catalog fetch fails; model backend not started; plugin/auth misconfiguration after environment changes.
Related errors
- error checking docker-model status: %w
- 'models' support requires Docker Model plugin
- failed to load Docker Model plugin: %w
- error unmarshalling available models: %w
- process still running
AI-assisted analysis of docker/compose@ddc4b044b6 (2026-08-15).
Data as JSON: /api/errors/d4b8c7d57f157e32.
Report an issue: GitHub.