{"record":{"id":"8719bac61b79ef49","repo":"goharbor/harbor","slug":"delete-all-sbom-reports-at-once-is-not-allowed","errorCode":null,"errorMessage":"delete all sbom reports at once is not allowed","messagePattern":"delete all sbom reports at once is not allowed","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/pkg/scan/sbom/dao/dao.go","lineNumber":65,"sourceCode":"// New returns an instance of the default DAO\nfunc New() DAO {\n\treturn &dao{}\n}\n\ntype dao struct{}\n\n// Create creates new sbom report\nfunc (d *dao) Create(ctx context.Context, r *model.Report) (int64, error) {\n\to, err := orm.FromContext(ctx)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn o.Insert(r)\n}\n\nfunc (d *dao) DeleteMany(ctx context.Context, query q.Query) (int64, error) {\n\tif len(query.Keywords) == 0 {\n\t\treturn 0, errors.New(\"delete all sbom reports at once is not allowed\")\n\t}\n\n\tqs, err := orm.QuerySetter(ctx, &model.Report{}, &query)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\treturn qs.Delete()\n}\n\nfunc (d *dao) List(ctx context.Context, query *q.Query) ([]*model.Report, error) {\n\tqs, err := orm.QuerySetter(ctx, &model.Report{}, query)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treports := []*model.Report{}\n\tif _, err = qs.All(&reports); err != nil {","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/pkg/scan/sbom/dao/dao.go#L47-L83","documentation":"Error \"delete all sbom reports at once is not allowed\" thrown in goharbor/harbor.","triggerScenarios":"Thrown at src/pkg/scan/sbom/dao/dao.go:65 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7b2fd08cc568955cca339afeefab27372840d936","analyzedAt":"2026-08-16T00:00:10.961Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}