{"record":{"id":"0971cf3dc1a5f37f","repo":"goharbor/harbor","slug":"expected-s-but-got-s","errorCode":null,"errorMessage":"expected '%s' but got '%s'","messagePattern":"expected '(.+?)' but got '(.+?)'","errorType":"validation","errorClass":null,"httpStatus":400,"severity":"error","filePath":"src/jobservice/job/impl/sample/job.go","lineNumber":56,"sourceCode":"}\n\n// ShouldRetry ...\nfunc (j *Job) ShouldRetry() bool {\n\treturn true\n}\n\n// Validate is implementation of same method in Interface.\nfunc (j *Job) Validate(params job.Parameters) error {\n\tif len(params) == 0 {\n\t\treturn errors.New(\"parameters required for replication job\")\n\t}\n\tname, ok := params[\"image\"]\n\tif !ok {\n\t\treturn errors.New(\"missing parameter 'image'\")\n\t}\n\n\tif !strings.HasPrefix(name.(string), \"demo\") {\n\t\treturn fmt.Errorf(\"expected '%s' but got '%s'\", \"demo *\", name)\n\t}\n\n\treturn nil\n}\n\n// Run the replication logic here.\nfunc (j *Job) Run(ctx job.Context, params job.Parameters) error {\n\tlogger := ctx.GetLogger()\n\n\tlogger.Info(\"Sample job starting\")\n\tdefer func() {\n\t\tlogger.Info(\"Sample job exit\")\n\t}()\n\n\tlogger.Infof(\"Params: %#v\\n\", params)\n\tif v, ok := ctx.Get(\"sample\"); ok {\n\t\tfmt.Printf(\"Get prop form context: sample=%s\\n\", v)\n\t}","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/jobservice/job/impl/sample/job.go#L38-L74","documentation":"Error \"expected '%s' but got '%s'\" thrown in goharbor/harbor.","triggerScenarios":"Thrown at src/jobservice/job/impl/sample/job.go:56 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"}