{"record":{"id":"c84ba9bfb345ff86","repo":"Tencent/WeKnora","slug":"concurrency-must-be-at-least-1","errorCode":null,"errorMessage":"concurrency must be at least 1","messagePattern":"concurrency must be at least 1","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/application/service/system_setting.go","lineNumber":1322,"sourceCode":"// is acceptable for persistence.\n//\n// Adding new validators:\n//   - keep them strict (reject silently-broken input rather than fixing\n//     it server-side — the user should see what they typed),\n//   - keep them deterministic (no DNS lookups, no env reads),\n//   - keep error messages user-facing (the handler surfaces them as the\n//     400 body verbatim).\nfunc validateRegistryEntry(key string, rawValue any) error {\n\tswitch key {\n\tcase \"asynq.core_concurrency\", \"asynq.postprocess_concurrency\",\n\t\t\"asynq.enrichment_concurrency\", \"asynq.maintenance_concurrency\",\n\t\t\"asynq.shared_concurrency\", \"asynq.wiki_concurrency\":\n\t\tn, err := coerceToPositiveInt64(rawValue)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif n < 1 {\n\t\t\treturn errors.New(\"concurrency must be at least 1\")\n\t\t}\n\tcase \"ssrf.whitelist\":\n\t\t// Coerce into the same shape encodeForType produced. We don't\n\t\t// look at the encoded JSON because that's already canonicalised\n\t\t// — easier to validate the raw input the user typed.\n\t\tentries, err := coerceToStringSlice(rawValue)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn utils.ValidateSSRFWhitelistEntries(entries)\n\t}\n\treturn nil\n}\n\n// coerceToPositiveInt64 accepts int / int64 / float64 from JSON decoding.\nfunc coerceToPositiveInt64(rawValue any) (int64, error) {\n\tswitch v := rawValue.(type) {\n\tcase int:","sourceCodeStart":1304,"sourceCodeEnd":1340,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/application/service/system_setting.go#L1304-L1340","documentation":"Validation error from validateRegistryEntry for asynq concurrency keys (asynq.core_concurrency, asynq.postprocess_concurrency, etc.): the submitted value is less than 1. Validators are strict and user-facing — the message is returned verbatim as the 400 body.","triggerScenarios":"Thrown at internal/application/service/system_setting.go:1322 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set the concurrency setting to an integer of at least 1","Fix client-side validation to enforce the minimum before submission"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"988cbb03305e055d8ebb7d46d9ac6cc0803cd074","analyzedAt":"2026-09-02T14:41:08.344Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}