wagoodman/dive · error

failed evaluation

Error message

failed evaluation

What it means

Set on the progress monitor (mon.SetError) when the rule evaluator concludes eval.Pass == false. Unlike error [0] (which turns this into a process exit code), this one only marks the 'Evaluating image' task as failed in the terminal task list — the full eval report is still emitted via bus.Report and the eval result is returned to the caller. It represents the same condition: one or more CI rules failed against the analysis.

Source

Thrown at cmd/dive/cli/internal/command/adapter/evaluator.go:44

func (c evaluationActionObserver) Evaluate(ctx context.Context, analysis *image.Analysis) ci.Evaluation {
	log.WithFields("image", analysis.Image).Infof("evaluating image")
	mon := bus.StartTask(payload.GenericTask{
		Title: payload.Title{
			Default:      "Evaluating image",
			WhileRunning: "Evaluating image",
			OnSuccess:    "Evaluated image",
		},
		HideOnSuccess:      false,
		HideStageOnSuccess: false,
		ID:                 analysis.Image,
		Context:            fmt.Sprintf("[rules: %d]", len(c.Rules)),
	})
	eval := c.Evaluator.Evaluate(ctx, analysis)
	if eval.Pass {
		mon.SetCompleted()
	} else {
		mon.SetError(fmt.Errorf("failed evaluation"))
	}
	bus.Report(eval.Report)
	return eval
}

View on GitHub (pinned to d6c691947f)

Solutions

  1. Inspect the printed evaluation report to identify the failing rule and margin
  2. Reduce wasted space in the image (combine add/remove layers, clean package caches)
  3. Adjust or disable the offending rule in the CI rules config
  4. If the failure is marginal and acceptable, document a new threshold and commit the config change alongside the image change

Example fix

# .dive-ci
# before
rules:
  lowestEfficiencyThreshold: 0.9
  highestWastedBytes: 1MB

# after (realistic for the current image)
rules:
  lowestEfficiencyThreshold: 0.8
  highestWastedBytes: 50MB
Defensive patterns

Strategy: validation

Try / catch

eval := adapter.NewEvaluator(rules).Evaluate(ctx, analysis)
if !eval.Pass {
    for _, r := range eval.Report {
        // log rule key + expected/actual for actionable CI output
    }
    return errors.New("failed evaluation")
}

Prevention

When it happens

Trigger: adapter.NewEvaluator(rules).Evaluate(ctx, analysis) running under --ci with at least one rule (lowestEfficiencyThreshold, highestWastedBytes, highestUserWastedPercent) evaluating to RuleFailed against the analyzed image.

Common situations: CI pipelines gating image builds on size/efficiency; a base-image update (e.g. new ubuntu tag) suddenly pushes wasted bytes over the configured threshold without any Dockerfile change.

Related errors


AI-assisted analysis of wagoodman/dive@d6c691947f (2026-08-15). Data as JSON: /api/errors/5a1f38b8e906d53d. Report an issue: GitHub.