goharbor/harbor · critical

missing logger config of job

Error message

missing logger config of job

What it means

Config.validate() (src/jobservice/config/config.go:368) requires at least one job logger (c.JobLoggerConfigs, YAML key 'job_loggers'). These sinks persist per-job log data (what GetJobLogData later returns); with none configured, job output could not be stored, so startup aborts. The default Harbor config ships two job loggers.

Source

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

		}

		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 {
	if DefaultConfig != nil && DefaultConfig.ReaperConfig != nil && DefaultConfig.ReaperConfig.MaxUpdateHour > 24 {
		return time.Duration(DefaultConfig.ReaperConfig.MaxUpdateHour) * time.Hour
	}
	return 24 * time.Hour
}

// MaxDanglingHour the max time for an execution can be dangling state
func MaxDanglingHour() int {
	if DefaultConfig != nil && DefaultConfig.ReaperConfig != nil && DefaultConfig.ReaperConfig.MaxDanglingHour > 24*7 {
		return DefaultConfig.ReaperConfig.MaxDanglingHour
	}

View on GitHub (pinned to 7b2fd08cc5)

Solutions

  1. Restore the default job_loggers block from Harbor's stock jobservice config template (FILE sink for job output plus a second logger)
  2. When configuring via env/template, ensure the job_loggers array renders with at least one entry
  3. Validate the rendered config in CI before deploy

Example fix

# before
job_loggers: []
# after
job_loggers:
  - name: FILE
    level: INFO
    sweeper_duration: 1
    settings:
      output_file: /var/log/jobs/job_logs
    backend: FILE
Defensive patterns

Strategy: validation

Validate before calling

if len(cfg.JobLoggerConfigs) == 0 {
    return errors.New("jobservice config must define at least one job logger")
}

Prevention

When it happens

Trigger: A jobservice config whose 'job_loggers' array is empty or missing while the service-level 'loggers' is populated.

Common situations: Hand-written configs that only copy the loggers section; values files that trim job_loggers; programmatic config builders that fill LoggerConfigs but not JobLoggerConfigs.

Related errors


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