{"record":{"id":"e1e1b56ab950ba0f","repo":"goharbor/harbor","slug":"failed-to-get-cve-allowlist-for-project-d-error","errorCode":null,"errorMessage":"failed to get CVE allowlist for project %d, error: %v","messagePattern":"failed to get CVE allowlist for project (.+?), error: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/pkg/allowlist/dao/dao.go","lineNumber":74,"sourceCode":"\tnow := time.Now()\n\tl.CreationTime = now\n\tl.UpdateTime = now\n\titemsBytes, _ := json.Marshal(l.Items)\n\tl.ItemsText = string(itemsBytes)\n\treturn ormer.InsertOrUpdate(&l, \"project_id\")\n}\n\nfunc (d *dao) QueryByProjectID(ctx context.Context, pid int64) (*models.CVEAllowlist, error) {\n\tormer, err := orm.FromContext(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tqs := ormer.QueryTable(&models.CVEAllowlist{})\n\tqs = qs.Filter(\"ProjectID\", pid)\n\tvar r []models.CVEAllowlist\n\t_, err = qs.All(&r)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to get CVE allowlist for project %d, error: %v\", pid, err)\n\t}\n\tif len(r) == 0 {\n\t\treturn nil, nil\n\t} else if len(r) > 1 {\n\t\tlog.Infof(\"Multiple CVE allowlists found for project %d, length: %d, returning first element.\", pid, len(r))\n\t}\n\titems := []models.CVEAllowlistItem{}\n\terr = json.Unmarshal([]byte(r[0].ItemsText), &items)\n\tif err != nil {\n\t\tlog.Errorf(\"Failed to decode item list, err: %v, text: %s\", err, r[0].ItemsText)\n\t\treturn nil, err\n\t}\n\tr[0].Items = items\n\treturn &r[0], nil\n}\n","sourceCodeStart":56,"sourceCodeEnd":90,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/pkg/allowlist/dao/dao.go#L56-L90","documentation":"Error \"failed to get CVE allowlist for project %d, error: %v\" thrown in goharbor/harbor.","triggerScenarios":"Thrown at src/pkg/allowlist/dao/dao.go:74 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"}