{"record":{"id":"311b57c646323a78","repo":"goharbor/harbor","slug":"nil-registration-to-create","errorCode":null,"errorMessage":"nil registration to create","messagePattern":"nil registration to create","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/pkg/scan/scanner/manager.go","lineNumber":79,"sourceCode":"\tDefaultScannerUUID(ctx context.Context) (string, error)\n}\n\n// basicManager is the default implementation of Manager\ntype basicManager struct{}\n\n// New a basic manager\nfunc New() Manager {\n\treturn &basicManager{}\n}\n\nfunc (bm *basicManager) Count(ctx context.Context, query *q.Query) (int64, error) {\n\treturn scanner.GetTotalOfRegistrations(ctx, query)\n}\n\n// Create ...\nfunc (bm *basicManager) Create(ctx context.Context, registration *scanner.Registration) (string, error) {\n\tif registration == nil {\n\t\treturn \"\", errors.New(\"nil registration to create\")\n\t}\n\n\t// Inject new UUID\n\tuid, err := uuid.NewUUID()\n\tif err != nil {\n\t\treturn \"\", errors.Wrap(err, \"new UUID: create registration\")\n\t}\n\tregistration.UUID = uid.String()\n\n\tif err := registration.Validate(true); err != nil {\n\t\treturn \"\", errors.Wrap(err, \"create registration\")\n\t}\n\n\tif err := encryptCredential(registration); err != nil {\n\t\treturn \"\", errors.Wrap(err, \"encrypt credential: create registration\")\n\t}\n\n\tif _, err := scanner.AddRegistration(ctx, registration); err != nil {","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/pkg/scan/scanner/manager.go#L61-L97","documentation":"Error \"nil registration to create\" thrown in goharbor/harbor.","triggerScenarios":"Thrown at src/pkg/scan/scanner/manager.go:79 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"}