{"record":{"id":"561bfe1719164225","repo":"goharbor/harbor","slug":"native-report-summary-required","errorCode":null,"errorMessage":"native report summary required","messagePattern":"native report summary required","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/pkg/scan/report/summary.go","lineNumber":66,"sourceCode":"\tv1.MimeTypeNativeReport:               MergeNativeSummary,\n\tv1.MimeTypeGenericVulnerabilityReport: MergeNativeSummary,\n}\n\n// MergeSummary merge summary s1 and s2\nfunc MergeSummary(mimeType string, s1, s2 any) (any, error) {\n\tm, ok := SupportedSummaryMergers[mimeType]\n\tif !ok {\n\t\treturn nil, errors.Errorf(\"no summary merger bound with mime type %s\", mimeType)\n\t}\n\n\treturn m(s1, s2)\n}\n\n// MergeNativeSummary merge vuln.NativeReportSummary together\nfunc MergeNativeSummary(s1, s2 any) (any, error) {\n\tnrs1, ok := s1.(*vuln.NativeReportSummary)\n\tif !ok {\n\t\treturn nil, errors.New(\"native report summary required\")\n\t}\n\n\tnrs2, ok := s2.(*vuln.NativeReportSummary)\n\tif !ok {\n\t\treturn nil, errors.New(\"native report summary required\")\n\t}\n\n\treturn nrs1.Merge(nrs2), nil\n}\n\n// SupportedGenerators declares mappings between mime type and summary generator func.\nvar SupportedGenerators = map[string]SummaryGenerator{\n\tv1.MimeTypeNativeReport:               GenerateNativeSummary,\n\tv1.MimeTypeGenericVulnerabilityReport: GenerateNativeSummary,\n}\n\n// GenerateSummary is a helper function to generate report\n// summary based on the given report.","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/pkg/scan/report/summary.go#L48-L84","documentation":"Type guard in MergeNativeSummary: one of the summary arguments is not a *vuln.NativeReportSummary, so native summary merging cannot be performed on the supplied values.","triggerScenarios":"Thrown at src/pkg/scan/report/summary.go:66 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Only pass *vuln.NativeReportSummary values to MergeNativeSummary","Add a dedicated summary merger for the actual summary type and register it by mime type"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7b2fd08cc568955cca339afeefab27372840d936","analyzedAt":"2026-08-16T00:00:10.961Z","contentChangedAt":"2026-08-16T00:00:10.961Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}