goharbor/harbor · critical

namespace of redis worker is required

Error message

namespace of redis worker is required

What it means

Config.validate() (src/jobservice/config/config.go:357) requires a non-empty RedisPoolCfg.Namespace whenever the pool backend is 'redis'. The namespace is the key prefix Harbor uses for every job service key in the shared Redis instance; an empty one risks key collisions with other services, so the job service refuses to boot.

Source

Thrown at src/jobservice/config/config.go:357

	// When backend is redis
	if c.PoolConfig.Backend == JobServicePoolBackendRedis {
		if c.PoolConfig.RedisPoolCfg == nil {
			return fmt.Errorf("redis worker must be configured when backend is set to '%s'", c.PoolConfig.Backend)
		}
		if utils.IsEmptyStr(c.PoolConfig.RedisPoolCfg.RedisURL) {
			return errors.New("URL of redis worker is empty")
		}
		if !strings.Contains(c.PoolConfig.RedisPoolCfg.RedisURL, "://") {
			return errors.New("invalid redis URL")
		}

		if _, err := url.Parse(c.PoolConfig.RedisPoolCfg.RedisURL); err != nil {
			return fmt.Errorf("invalid redis URL: %s", err.Error())
		}

		if utils.IsEmptyStr(c.PoolConfig.RedisPoolCfg.Namespace) {
			return errors.New("namespace of redis worker is required")
		}
	}

	// Job service loggers
	if len(c.LoggerConfigs) == 0 {
		return errors.New("missing logger config of job service")
	}

	// Job loggers
	if len(c.JobLoggerConfigs) == 0 {
		return errors.New("missing logger config of job")
	}

	return nil // valid
}

// MaxUpdateDuration the max time for an execution can be updated by task
func MaxUpdateDuration() time.Duration {

View on GitHub (pinned to 7b2fd08cc5)

Solutions

  1. Set the namespace (jobservice.pool.namespace / JOB_SERVICE_POOL_REDIS_NAMESPACE), e.g. harbor_job_service
  2. Keep the value identical across restarts — changing it orphans previously stored job data in Redis
  3. Redeploy and confirm the variable actually reaches the jobservice container

Example fix

# before
pool:
  backend: redis
  redis_url: redis://:pwd@redis:6379
# after
pool:
  backend: redis
  redis_url: redis://:pwd@redis:6379
  namespace: harbor_job_service
Defensive patterns

Strategy: validation

Validate before calling

if cfg.PoolConfig.Backend == config.JobServicePoolBackendRedis {
    if utils.IsEmptyStr(cfg.PoolConfig.RedisPoolCfg.Namespace) {
        return errors.New("JOB_SERVICE_POOL_REDIS_NAMESPACE is required when backend is redis")
    }
}

Prevention

When it happens

Trigger: Backend set to 'redis' with a valid redis_url but JOB_SERVICE_POOL_REDIS_NAMESPACE (config.go:41) unset and jobservice.pool.namespace missing or empty in the YAML config.

Common situations: Minimal hand-written config.yml that only sets backend and redis_url; Helm chart overrides that drop the namespace key; partially rendered config templates.

Related errors


AI-assisted analysis of goharbor/harbor@7b2fd08cc5 (2026-08-16). Data as JSON: /api/errors/5951aab428c031b0. Report an issue: GitHub.