{"record":{"id":"007a7bbc9c95281b","repo":"goharbor/harbor","slug":"10013-007a7b","errorCode":"10013","errorMessage":"missing job parameters","messagePattern":"missing job parameters","errorType":"validation","errorClass":"badRequestError","httpStatus":400,"severity":"error","filePath":"src/jobservice/job/impl/gdpr/audit_logs_data_masking.go","lineNumber":50,"sourceCode":"\tuserManager user.Manager\n}\n\nfunc (a AuditLogsDataMasking) MaxFails() uint {\n\treturn 3\n}\n\nfunc (a AuditLogsDataMasking) MaxCurrency() uint {\n\treturn 1\n}\n\nfunc (a AuditLogsDataMasking) ShouldRetry() bool {\n\treturn true\n}\n\nfunc (a AuditLogsDataMasking) Validate(params job.Parameters) error {\n\tif params == nil {\n\t\t// Params are required\n\t\treturn errors.New(\"missing job parameters\")\n\t}\n\t_, err := a.parseParams(params)\n\treturn err\n}\n\nfunc (a *AuditLogsDataMasking) init() {\n\tif a.manager == nil {\n\t\ta.manager = audit.New()\n\t}\n\tif a.userManager == nil {\n\t\ta.userManager = user.New()\n\t}\n\tif a.extManager == nil {\n\t\ta.extManager = auditext.Mgr\n\t}\n}\n\nfunc (a AuditLogsDataMasking) Run(ctx job.Context, params job.Parameters) error {","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/jobservice/job/impl/gdpr/audit_logs_data_masking.go#L32-L68","documentation":"The AUDIT_LOGS_DATA_MASKING job (GDPR username masking in audit logs) rejects a nil parameter map in Validate (src/jobservice/job/impl/gdpr/audit_logs_data_masking.go:50) with code 10013. parseParams then requires the 'username' key (UserNameParam) to be present and a string — so only a completely absent params object (JSON null) triggers this specific message; an empty map instead fails with 'param username not found'.","triggerScenarios":"Submitting or scheduling the AUDIT_LOGS_DATA_MASKING job with params omitted/null in the launch request rather than an object.","commonSituations":"Custom admin tooling launching the masking job without building the params object; webhook-driven flows that construct params conditionally and pass nil when empty; GDPR purge integrations after upgrade.","solutions":["Pass a non-nil params map containing the 'username' key (see parseParams at audit_logs_data_masking.go:84-94)","Ensure the value is a string — a non-string type is rejected with a separate error","Validate the params map on the client before enqueueing"],"exampleFix":"// before\nparams := job.Parameters(nil)\n// after\nparams := job.Parameters{\n    \"username\": \"user@example.com\",\n}","handlingStrategy":"validation","validationCode":"if params == nil {\n    return fmt.Errorf(\"AUDIT_LOGS_DATA_MASKING requires params\")\n}\nif _, ok := params[\"username\"].(string); !ok {\n    return fmt.Errorf(\"params must contain string 'username'\")\n}","typeGuard":"func hasUsernameParam(params job.Parameters) bool {\n    v, ok := params[\"username\"]\n    return ok\n}","tryCatchPattern":null,"preventionTips":["Always construct the params map explicitly instead of passing a possibly-nil variable","Check UserNameParam ('username') presence and type before enqueueing","Cover the nil-params path in job client tests"],"tags":["jobservice","gdpr","audit","validation","job-parameters","harbor"],"backgroundTag":null,"analyzedSha":"7b2fd08cc568955cca339afeefab27372840d936","analyzedAt":"2026-08-16T00:00:10.961Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}