{"record":{"id":"2b1bc52202eab979","repo":"goharbor/harbor","slug":"error-must-set-log-endpoint-host-to-enable-extern","errorCode":null,"errorMessage":"Error: must set log endpoint host to enable external host","messagePattern":"Error: must set log endpoint host to enable external host","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"make/photon/prepare/utils/configs.py","lineNumber":39,"sourceCode":"    # hostname validate\n    if conf.get('hostname') == '127.0.0.1':\n        raise Exception(\"127.0.0.1 can not be the hostname\")\n    if conf.get('hostname') == 'reg.mydomain.com':\n        raise Exception(\"Please specify hostname\")\n\n    # protocol validate\n    protocol = conf.get(\"protocol\")\n    if protocol == \"https\":\n        if not conf.get(\"cert_path\") or conf[\"cert_path\"] == default_https_cert_path:\n            raise Exception(\"Error: The protocol is https but attribute ssl_cert is not set\")\n        if not conf.get(\"cert_key_path\") or conf['cert_key_path'] == default_https_key_path:\n            raise Exception(\"Error: The protocol is https but attribute ssl_cert_key is not set\")\n    if protocol == \"http\":\n        logging.warning(\"WARNING: HTTP protocol is insecure. Harbor will deprecate http protocol in the future. Please make sure to upgrade to https\")\n\n    # log endpoint validate\n    if ('log_ep_host' in conf) and not conf['log_ep_host']:\n        raise Exception('Error: must set log endpoint host to enable external host')\n    if ('log_ep_port' in conf) and not conf['log_ep_port']:\n        raise Exception('Error: must set log endpoint port to enable external host')\n    if ('log_ep_protocol' in conf) and (conf['log_ep_protocol'] not in ['udp', 'tcp']):\n        raise Exception(\"Protocol in external log endpoint must be one of 'udp' or 'tcp' \")\n\n    # Storage validate\n    valid_storage_drivers = [\"filesystem\", \"azure\", \"gcs\", \"s3\", \"swift\", \"oss\"]\n    storage_provider_name = conf.get(\"storage_provider_name\")\n    if storage_provider_name not in valid_storage_drivers:\n        raise Exception(\"Error: storage driver %s is not supported, only the following ones are supported: %s\" % (\n            storage_provider_name, \",\".join(valid_storage_drivers)))\n\n    # original is registry_storage_provider_config\n    storage_provider_config = conf.get(\"storage_provider_config\")\n    if storage_provider_name != \"filesystem\":\n        if storage_provider_config == \"\":\n            raise Exception(\n                \"Error: no provider configurations are provided for provider %s\" % storage_provider_name)","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/make/photon/prepare/utils/configs.py#L21-L57","documentation":"Thrown by validate() in make/photon/prepare/utils/configs.py when harbor.yml configures an external syslog endpoint ('log.external_endpoint') but its 'host' is present and empty. Harbor forwards container logs to this endpoint via a syslog driver, and an empty host would produce an unusable syslog target, so prepare refuses to continue.","triggerScenarios":"harbor.yml contains a 'log:' section with 'external_endpoint:' uncommented and 'host:' left blank (empty string). parse_yaml_config sets config_dict['log_ep_host'] to '', and the check ('log_ep_host' in conf) and not conf['log_ep_host'] fires.","commonSituations":"Users enable external_endpoint to ship logs to Paperstack/splunk/syslog but forget the host, or comment the host value while keeping the key; YAML indentation mistakes that null out host.","solutions":["Set 'log.external_endpoint.host:' to the FQDN or IP of the syslog receiver, e.g. logs.example.com","Set the matching 'port:' and 'protocol:' (see related checks) in the same block","If external log shipping is not wanted, comment out or delete the whole 'external_endpoint:' block so local logging is used","Re-run ./install.sh"],"exampleFix":"# harbor.yml (before)\nlog:\n  level: info\n  external_endpoint:\n    protocol: tcp\n    host:\n    port: 5140\n\n# harbor.yml (after)\nlog:\n  level: info\n  external_endpoint:\n    protocol: tcp\n    host: logs.example.com\n    port: 5140","handlingStrategy":"validation","validationCode":"ep = (cfg.get('log') or {}).get('external_endpoint')\nif ep is not None and not ep.get('host'):\n    raise SystemExit('log.external_endpoint.host must be set when external_endpoint is configured')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Fill host, port, and protocol together when enabling external_endpoint","Comment out the entire external_endpoint block to disable it, not just one key","Validate harbor.yml with a YAML linter to catch empty values"],"tags":["harbor","logging","syslog","configuration"],"backgroundTag":null,"analyzedSha":"7b2fd08cc568955cca339afeefab27372840d936","analyzedAt":"2026-08-16T00:00:10.961Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}