{"record":{"id":"54e68d3b92d792d3","repo":"wagoodman/dive","slug":"evaluation-failed","errorCode":null,"errorMessage":"evaluation failed","messagePattern":"evaluation failed","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/dive/cli/internal/command/root.go","lineNumber":91,"sourceCode":"\nfunc run(ctx context.Context, opts options.Application, img *image.Image, content image.ContentReader) error {\n\tanalysis, err := adapter.NewAnalyzer().Analyze(ctx, img)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"cannot analyze image: %w\", err)\n\t}\n\n\tif opts.Export.JsonPath != \"\" {\n\t\tif err := adapter.NewExporter(afero.NewOsFs()).ExportTo(ctx, analysis, opts.Export.JsonPath); err != nil {\n\t\t\treturn fmt.Errorf(\"cannot export analysis: %w\", err)\n\t\t}\n\t\treturn nil\n\t}\n\n\tif opts.CI.Enabled {\n\t\teval := adapter.NewEvaluator(opts.CI.Rules.List).Evaluate(ctx, analysis)\n\n\t\tif !eval.Pass {\n\t\t\treturn errors.New(\"evaluation failed\")\n\t\t}\n\t\treturn nil\n\t}\n\n\tbus.ExploreAnalysis(*analysis, content)\n\n\treturn nil\n}\n","sourceCodeStart":73,"sourceCodeEnd":100,"githubUrl":"https://github.com/wagoodman/dive/blob/d6c691947f8fda635c952a17ee3b7555379d58f0/cmd/dive/cli/internal/command/root.go#L73-L100","documentation":"Thrown at the end of a `dive --ci` run when the configured CI rules evaluated against the image analysis did not all pass (eval.Pass == false). It is not an internal failure: the analysis completed, the report was already published via bus.Report, and this error exists purely to make the dive process exit non-zero so CI pipelines fail. The detailed per-rule results (which thresholds were breached) are printed to the report output before the error is returned.","triggerScenarios":"Running `dive <image> --ci` (or with ci.enabled in config) where at least one of lowestEfficiencyThreshold, highestWastedBytes, or highestUserWastedPercent rules fails: e.g. image efficiency below 0.9, wasted bytes above 1GB, or user-wasted percent above 0.1 with defaults enabled.","commonSituations":"A Dockerfile regression adds duplicated files across layers (apt caches left behind, COPY of files later deleted), dropping image efficiency below the configured threshold in a CI gate; or a team tightens thresholds in .dive-ci without rebuilding base images that never met them.","solutions":["Read the CI report output above the error to see which rule(s) failed and by how much","Fix the Dockerfile: merge RUN steps that add and remove files in the same layer, drop caches (rm -rf /var/lib/apt/lists/*), remove duplicated files across layers","If the threshold is intentionally strict for new images, tune the rule values in the CI config file (e.g. .dive-ci) to realistic levels","Disable a rule you do not want enforced by setting its config value to the disabled sentinel instead of deleting analysis steps"],"exampleFix":"# before\nFROM ubuntu\nRUN apt-get update && apt-get install -y curl\nRUN rm -rf /var/lib/apt/lists/*\n\n# after (add/remove in one layer, no wasted bytes)\nFROM ubuntu\nRUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*","handlingStrategy":"validation","validationCode":"# pre-check thresholds before enforcing the gate\ndive myimage:latest --json /tmp/dive.json\n# inspect efficiencyScore / wastedBytes in the JSON, compare to your thresholds, then decide","typeGuard":null,"tryCatchPattern":"# in a CI script: treat exit!=0 as gate failure, but read the report first\ndive myimage:latest --ci || { echo 'dive CI gate failed — see report above'; exit 1; }","preventionTips":["Track efficiency/waste metrics over time with --json exports so threshold changes are data-driven","Set thresholds from a measured baseline, not aspirations","Run the CI gate on every image-affecting PR so regressions surface early"],"tags":["ci","rules","evaluation","docker","image-efficiency"],"backgroundTag":null,"analyzedSha":"d6c691947f8fda635c952a17ee3b7555379d58f0","analyzedAt":"2026-08-15T09:42:35.293Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}