goharbor/harbor · error

certificate must be configured if serve with protocol

Error message

certificate must be configured if serve with protocol %s

What it means

Validation in Configuration.validate: protocol is HTTPS but HTTPSConfig is nil, so no TLS certificate/key block was provided and the job service cannot serve HTTPS.

Solutions

  1. Provide HTTPS certificate and key configuration for jobservice
  2. Or switch protocol to 'http' if TLS is terminated upstream
  3. Verify the config section name matches the expected schema
Defensive patterns

Strategy: validation

When it happens

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

Common situations: See trigger scenarios.

Understand the failure class


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

Appendix: source

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

}

// Check if the configurations are valid settings.
func (c *Configuration) validate() error {
	if c.Protocol != JobServiceProtocolHTTPS &&
		c.Protocol != JobServiceProtocolHTTP {
		return fmt.Errorf("protocol should be %s or %s, but current setting is %s",
			JobServiceProtocolHTTP,
			JobServiceProtocolHTTPS,
			c.Protocol)
	}

	if !utils.IsValidPort(c.Port) {
		return fmt.Errorf("port number should be a none zero integer and less or equal 65535, but current is %d", c.Port)
	}

	if c.Protocol == JobServiceProtocolHTTPS {
		if c.HTTPSConfig == nil {
			return fmt.Errorf("certificate must be configured if serve with protocol %s", c.Protocol)
		}

		if utils.IsEmptyStr(c.HTTPSConfig.Cert) ||
			!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)
	}

View on GitHub (pinned to 7b2fd08cc5)