goharbor/harbor · error
no artifact id to get sbom report data
Error message
no artifact id to get sbom report data
What it means
Guard in sbom basicManager.GetBy: artifactID is 0, meaning no artifact was specified, so SBOM report rows cannot be queried.
Solutions
- Resolve the artifact first and pass its numeric ID
- Check that the artifact lookup preceding GetBy succeeded
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at src/pkg/scan/sbom/manager.go:152 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/3cc27a22641e0446.
Report an issue: GitHub.
Appendix: source
Thrown at src/pkg/scan/sbom/manager.go:152
}
func (bm *basicManager) Delete(ctx context.Context, uuid string) error {
query := q.Query{Keywords: q.KeyWords{"uuid": uuid}}
count, err := bm.dao.DeleteMany(ctx, query)
if err != nil {
return err
}
if count == 0 {
return errors.Errorf("no report with uuid %s deleted", uuid)
}
return nil
}
// GetBy ...
func (bm *basicManager) GetBy(ctx context.Context, artifactID int64, registrationUUID string,
mimeType string, mediaType string) ([]*model.Report, error) {
if artifactID == 0 {
return nil, errors.New("no artifact id to get sbom report data")
}
kws := make(map[string]any)
kws["artifact_id"] = artifactID
if len(registrationUUID) > 0 {
kws["registration_uuid"] = registrationUUID
}
if len(mimeType) > 0 {
kws["mine_type"] = mimeType
}
if len(mediaType) > 0 {
kws["media_type"] = mediaType
}
// Query all
query := &q.Query{
PageNumber: 0,
Keywords: kws,
}View on GitHub (pinned to 7b2fd08cc5)