goharbor/harbor · error

redis worker must be configured when backend is set to

Error message

redis worker must be configured when backend is set to '%s'

What it means

Validation in Configuration.validate: the worker pool backend is redis but RedisPoolCfg is nil, so the mandatory Redis connection settings for the job worker pool are absent.

Solutions

  1. Provide Redis pool configuration (URL, etc.) for the jobservice
  2. Check env variables like REDIS_URL are being loaded
  3. Ensure the config file includes the redis worker section
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/jobservice/config/config.go:343 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

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

			!utils.FileExists(c.HTTPSConfig.Cert) ||
			utils.IsEmptyStr(c.HTTPSConfig.Key) ||
			!utils.FileExists(c.HTTPSConfig.Key) {
			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

View on GitHub (pinned to 7b2fd08cc5)