{"record":{"id":"615cb021b8716ea7","repo":"goharbor/harbor","slug":"url-of-redis-worker-is-empty","errorCode":null,"errorMessage":"URL of redis worker is empty","messagePattern":"URL of redis worker is empty","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"src/jobservice/config/config.go","lineNumber":346,"sourceCode":"\t\t\treturn fmt.Errorf(\"certificate for protocol %s is not correctly configured\", c.Protocol)\n\t\t}\n\t}\n\n\tif c.PoolConfig == nil {\n\t\treturn errors.New(\"no worker worker is configured\")\n\t}\n\n\tif c.PoolConfig.Backend != JobServicePoolBackendRedis {\n\t\treturn fmt.Errorf(\"worker worker backend %s does not support\", c.PoolConfig.Backend)\n\t}\n\n\t// When backend is redis\n\tif c.PoolConfig.Backend == JobServicePoolBackendRedis {\n\t\tif c.PoolConfig.RedisPoolCfg == nil {\n\t\t\treturn fmt.Errorf(\"redis worker must be configured when backend is set to '%s'\", c.PoolConfig.Backend)\n\t\t}\n\t\tif utils.IsEmptyStr(c.PoolConfig.RedisPoolCfg.RedisURL) {\n\t\t\treturn errors.New(\"URL of redis worker is empty\")\n\t\t}\n\t\tif !strings.Contains(c.PoolConfig.RedisPoolCfg.RedisURL, \"://\") {\n\t\t\treturn errors.New(\"invalid redis URL\")\n\t\t}\n\n\t\tif _, err := url.Parse(c.PoolConfig.RedisPoolCfg.RedisURL); err != nil {\n\t\t\treturn fmt.Errorf(\"invalid redis URL: %s\", err.Error())\n\t\t}\n\n\t\tif utils.IsEmptyStr(c.PoolConfig.RedisPoolCfg.Namespace) {\n\t\t\treturn errors.New(\"namespace of redis worker is required\")\n\t\t}\n\t}\n\n\t// Job service loggers\n\tif len(c.LoggerConfigs) == 0 {\n\t\treturn errors.New(\"missing logger config of job service\")\n\t}","sourceCodeStart":328,"sourceCodeEnd":364,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/jobservice/config/config.go#L328-L364","documentation":"Jobservice config validation fails when worker_pool exists with backend redis but redis_pool.redis_url is empty. The URL is mandatory for the redis backend and must contain '://' and parse via url.Parse; a namespace is required right after this check.","triggerScenarios":"worker_pool.redis_pool present with redis_url omitted or empty, e.g. because the value was templated from an unset environment variable.","commonSituations":"Secrets templating leaves redis_url blank during deployment; config migrated between environments and the URL line was dropped; URL given without a scheme (fails the neighboring 'invalid redis URL' checks).","solutions":["Set redis_url including a scheme, e.g. redis://:password@redis:6379/5, and set namespace in the same block","Confirm the URL contains '://' and parses (url.Parse) to clear the adjacent validations","Redeploy jobservice with the corrected config"],"exampleFix":"# before\nworker_pool:\n  backend: redis\n  redis_pool:\n    redis_url: \"\"\n\n# after\nworker_pool:\n  backend: redis\n  redis_pool:\n    redis_url: redis://:password@redis:6379/5\n    namespace: harbor_jobservice","handlingStrategy":"validation","validationCode":"var cfg Config\n_ = yaml.Unmarshal(raw, &cfg)\nif cfg.PoolConfig != nil && cfg.PoolConfig.Backend == \"redis\" {\n    rp := cfg.PoolConfig.RedisPoolCfg\n    if rp == nil || strings.TrimSpace(rp.RedisURL) == \"\" || !strings.Contains(rp.RedisURL, \"://\") {\n        return errors.New(\"worker_pool.redis_pool.redis_url missing or scheme-less\")\n    }\n    if strings.TrimSpace(rp.Namespace) == \"\" {\n        return errors.New(\"worker_pool.redis_pool.namespace required\")\n    }\n}","typeGuard":"func isEmptyRedisURL(err error) bool { return err != nil && strings.Contains(err.Error(), \"URL of redis worker is empty\") }","tryCatchPattern":"if err := cfg.Load(...); err != nil {\n    if strings.Contains(err.Error(), \"URL of redis worker is empty\") {\n        return errors.New(\"set worker_pool.redis_pool.redis_url (e.g. redis://:pwd@redis:6379/5)\")\n    }\n    return err\n}","preventionTips":["Fail deployment when templating leaves redis_url empty","Include scheme:// in every redis URL","Smoke-test config loading as a container entrypoint pre-check"],"tags":["harbor","jobservice","config","redis","startup"],"backgroundTag":null,"analyzedSha":"7b2fd08cc568955cca339afeefab27372840d936","analyzedAt":"2026-08-16T00:00:10.961Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}