goharbor/harbor · critical

URL of redis worker is empty

Error message

URL of redis worker is empty

What it means

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.

Source

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

			return fmt.Errorf("certificate for protocol %s is not correctly configured", c.Protocol)
		}
	}

	if c.PoolConfig == nil {
		return errors.New("no worker worker is configured")
	}

	if c.PoolConfig.Backend != JobServicePoolBackendRedis {
		return fmt.Errorf("worker worker backend %s does not support", c.PoolConfig.Backend)
	}

	// 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")
	}

View on GitHub (pinned to 7b2fd08cc5)

Solutions

  1. Set redis_url including a scheme, e.g. redis://:password@redis:6379/5, and set namespace in the same block
  2. Confirm the URL contains '://' and parses (url.Parse) to clear the adjacent validations
  3. Redeploy jobservice with the corrected config

Example fix

# before
worker_pool:
  backend: redis
  redis_pool:
    redis_url: ""

# after
worker_pool:
  backend: redis
  redis_pool:
    redis_url: redis://:password@redis:6379/5
    namespace: harbor_jobservice
Defensive patterns

Strategy: validation

Validate before calling

var cfg Config
_ = yaml.Unmarshal(raw, &cfg)
if cfg.PoolConfig != nil && cfg.PoolConfig.Backend == "redis" {
    rp := cfg.PoolConfig.RedisPoolCfg
    if rp == nil || strings.TrimSpace(rp.RedisURL) == "" || !strings.Contains(rp.RedisURL, "://") {
        return errors.New("worker_pool.redis_pool.redis_url missing or scheme-less")
    }
    if strings.TrimSpace(rp.Namespace) == "" {
        return errors.New("worker_pool.redis_pool.namespace required")
    }
}

Type guard

func isEmptyRedisURL(err error) bool { return err != nil && strings.Contains(err.Error(), "URL of redis worker is empty") }

Try / catch

if err := cfg.Load(...); err != nil {
    if strings.Contains(err.Error(), "URL of redis worker is empty") {
        return errors.New("set worker_pool.redis_pool.redis_url (e.g. redis://:pwd@redis:6379/5)")
    }
    return err
}

Prevention

When it happens

Trigger: worker_pool.redis_pool present with redis_url omitted or empty, e.g. because the value was templated from an unset environment variable.

Common situations: 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).

Related errors


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