goharbor/harbor · error

no way to get report summaries for nil artifact

Error message

no way to get report summaries for nil artifact

What it means

Error "no way to get report summaries for nil artifact" thrown in goharbor/harbor.

Source

Thrown at src/pkg/scan/sbom/sbom.go:303

		logger.Errorf("Failed to get report for artifact %s@%s of mimetype %s, error %v", artRepo, artDigest, mimeType, err)
		return nil, err
	}
	if len(rpts) == 0 {
		logger.Errorf("No report found for artifact %s@%s of mimetype %s, error %v", artRepo, artDigest, mimeType, err)
		return nil, errors.NotFoundError(nil).WithMessage("no report found to update data")
	}
	return &scanModel.Report{
		UUID:     rpts[0].UUID,
		MimeType: rpts[0].MimeType,
	}, nil
}

func (h *scanHandler) GetSummary(ctx context.Context, art *artifact.Artifact, mimeTypes []string) (map[string]any, error) {
	if len(mimeTypes) == 0 {
		return nil, errors.New("no mime types to get report summaries")
	}
	if art == nil {
		return nil, errors.New("no way to get report summaries for nil artifact")
	}
	ds := h.ScannerControllerFunc()
	r, err := ds.GetRegistrationByProject(ctx, art.ProjectID)
	if err != nil {
		return nil, errors.Wrap(err, "get sbom summary failed")
	}
	reports, err := h.SBOMMgrFunc().GetBy(ctx, art.ID, r.UUID, mimeTypes[0], sbomMediaTypeSpdx)
	if err != nil {
		return nil, err
	}
	if len(reports) == 0 {
		return map[string]any{}, nil
	}
	reportContent := reports[0].ReportSummary
	result := map[string]any{}
	if len(reportContent) == 0 {
		status := h.TaskMgrFunc().RetrieveStatusFromTask(ctx, reports[0].UUID)
		if len(status) > 0 {

View on GitHub (pinned to 7b2fd08cc5)

When it happens

Trigger: Thrown at src/pkg/scan/sbom/sbom.go:303 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of goharbor/harbor@7b2fd08cc5 (2026-08-16). Data as JSON: /api/errors/da515f6bb4d504bc. Report an issue: GitHub.