{"record":{"id":"1fe9a5b7ed30f6e1","repo":"goharbor/harbor","slug":"failed-to-create-the-notification-policy-v","errorCode":null,"errorMessage":"failed to create the notification policy: %v","messagePattern":"failed to create the notification policy: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/pkg/notification/policy/dao/dao.go","lineNumber":88,"sourceCode":"\treturn j, nil\n}\n\n// Create ...\nfunc (d *dao) Create(ctx context.Context, policy *model.Policy) (int64, error) {\n\tif policy == nil {\n\t\treturn 0, errors.New(\"nil policy\")\n\t}\n\tormer, err := orm.FromContext(ctx)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tid, err := ormer.Insert(policy)\n\tif err != nil {\n\t\tif e := orm.AsConflictError(err, \"notification policy named %s already exists\", policy.Name); e != nil {\n\t\t\terr = e\n\t\t\treturn id, err\n\t\t}\n\t\terr = fmt.Errorf(\"failed to create the notification policy: %v\", err)\n\t\treturn id, err\n\t}\n\treturn id, err\n}\n\n// Update ...\nfunc (d *dao) Update(ctx context.Context, policy *model.Policy) error {\n\tif policy == nil {\n\t\treturn errors.New(\"nil policy\")\n\t}\n\n\tormer, err := orm.FromContext(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\tn, err := ormer.Update(policy)\n\tif n == 0 {\n\t\tif e := orm.AsConflictError(err, \"notification policy named %s already exists\", policy.Name); e != nil {","sourceCodeStart":70,"sourceCodeEnd":106,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/pkg/notification/policy/dao/dao.go#L70-L106","documentation":"Error \"failed to create the notification policy: %v\" thrown in goharbor/harbor.","triggerScenarios":"Thrown at src/pkg/notification/policy/dao/dao.go:88 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"}