{"record":{"id":"71c9c43d77437167","repo":"goharbor/harbor","slug":"log-level-must-be-one-of-debug-info-warning-err","errorCode":null,"errorMessage":"log level must be one of debug, info, warning, error, fatal","messagePattern":"log level must be one of debug, info, warning, error, fatal","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"make/photon/prepare/utils/configs.py","lineNumber":247,"sourceCode":"    value = config_dict[\"max_job_duration_hours\"]\n    if not isinstance(value, int) or value < 24:\n        config_dict[\"max_job_duration_hours\"] = 24\n    config_dict['job_loggers'] = js_config[\"job_loggers\"]\n    config_dict['logger_sweeper_duration'] = js_config[\"logger_sweeper_duration\"]\n    config_dict['jobservice_secret'] = generate_random_string(16)\n\n    # notification config\n    notification_config = configs.get('notification') or {}\n    config_dict['notification_webhook_job_max_retry'] = notification_config[\"webhook_job_max_retry\"]\n    config_dict['notification_webhook_job_http_client_timeout'] = notification_config[\"webhook_job_http_client_timeout\"]\n\n    # Log configs\n    allowed_levels = ['debug', 'info', 'warning', 'error', 'fatal']\n    log_configs = configs.get('log') or {}\n\n    log_level = log_configs['level']\n    if log_level not in allowed_levels:\n        raise Exception('log level must be one of debug, info, warning, error, fatal')\n    config_dict['log_level'] = log_level.lower()\n\n    # parse local log related configs\n    local_logs = log_configs.get('local') or {}\n    if local_logs:\n        config_dict['log_location'] = local_logs.get('location') or '/var/log/harbor'\n        config_dict['log_rotate_count'] = local_logs.get('rotate_count') or 50\n        config_dict['log_rotate_size'] = local_logs.get('rotate_size') or '200M'\n\n    # parse external log endpoint related configs\n    if log_configs.get('external_endpoint'):\n        config_dict['log_external'] = True\n        config_dict['log_ep_protocol'] = log_configs['external_endpoint']['protocol']\n        config_dict['log_ep_host'] = log_configs['external_endpoint']['host']\n        config_dict['log_ep_port'] = log_configs['external_endpoint']['port']\n    else:\n        config_dict['log_external'] = False\n","sourceCodeStart":229,"sourceCodeEnd":265,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/make/photon/prepare/utils/configs.py#L229-L265","documentation":"Thrown by parse_yaml_config() in make/photon/prepare/utils/configs.py when harbor.yml's 'log.level' is not one of the literal strings debug, info, warning, error, fatal. The membership test runs on the raw value before log_level.lower() is applied, so the check is case-sensitive: 'INFO' or 'Info' fail even though they look correct. 'warn' (a common shorthand elsewhere) also fails — Harbor requires 'warning'.","triggerScenarios":"harbor.yml contains log: level: INFO (uppercase), level: warn, or a typo like 'eror'. The comparison log_level not in ['debug','info','warning','error','fatal'] is exact-match on the raw YAML string.","commonSituations":"Values copied from docker logging drivers or logrus examples that use uppercase or 'warn'; editing generated configs where other sections accept mixed case; template variables injecting 'DEBUG' from CI environment variables.","solutions":["Set the level to an exact lowercase value from the allowed set, e.g. 'info' or 'debug'","Use 'warning' instead of 'warn'","Re-run ./install.sh"],"exampleFix":"# harbor.yml (before)\nlog:\n  level: INFO\n\n# harbor.yml (after)\nlog:\n  level: info","handlingStrategy":"validation","validationCode":"ALLOWED = {'debug', 'info', 'warning', 'error', 'fatal'}\nlevel = (cfg.get('log') or {}).get('level', 'info')\nif level not in ALLOWED:\n    raise SystemExit('log.level %r must be one of %s (lowercase)' % (level, sorted(ALLOWED)))","typeGuard":null,"tryCatchPattern":null,"preventionTips":["harbor.yml log levels are lowercase-only: debug, info, warning, error, fatal","'warn' is not accepted - write 'warning'","When templating harbor.yml, normalize injected log levels with | lower"],"tags":["harbor","logging","configuration","validation"],"backgroundTag":null,"analyzedSha":"7b2fd08cc568955cca339afeefab27372840d936","analyzedAt":"2026-08-16T00:00:10.961Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}