goharbor/harbor · error · Exception
Error: must set log endpoint port to enable external host
Error message
Error: must set log endpoint port to enable external host
What it means
Thrown by validate() in make/photon/prepare/utils/configs.py when harbor.yml configures an external syslog endpoint ('log.external_endpoint') with a 'port' that is present but empty. The port is required to build the syslog target address; without it the log driver configuration would be invalid, so prepare aborts.
Source
Thrown at make/photon/prepare/utils/configs.py:41
raise Exception("127.0.0.1 can not be the hostname")
if conf.get('hostname') == 'reg.mydomain.com':
raise Exception("Please specify hostname")
# protocol validate
protocol = conf.get("protocol")
if protocol == "https":
if not conf.get("cert_path") or conf["cert_path"] == default_https_cert_path:
raise Exception("Error: The protocol is https but attribute ssl_cert is not set")
if not conf.get("cert_key_path") or conf['cert_key_path'] == default_https_key_path:
raise Exception("Error: The protocol is https but attribute ssl_cert_key is not set")
if protocol == "http":
logging.warning("WARNING: HTTP protocol is insecure. Harbor will deprecate http protocol in the future. Please make sure to upgrade to https")
# log endpoint validate
if ('log_ep_host' in conf) and not conf['log_ep_host']:
raise Exception('Error: must set log endpoint host to enable external host')
if ('log_ep_port' in conf) and not conf['log_ep_port']:
raise Exception('Error: must set log endpoint port to enable external host')
if ('log_ep_protocol' in conf) and (conf['log_ep_protocol'] not in ['udp', 'tcp']):
raise Exception("Protocol in external log endpoint must be one of 'udp' or 'tcp' ")
# Storage validate
valid_storage_drivers = ["filesystem", "azure", "gcs", "s3", "swift", "oss"]
storage_provider_name = conf.get("storage_provider_name")
if storage_provider_name not in valid_storage_drivers:
raise Exception("Error: storage driver %s is not supported, only the following ones are supported: %s" % (
storage_provider_name, ",".join(valid_storage_drivers)))
# original is registry_storage_provider_config
storage_provider_config = conf.get("storage_provider_config")
if storage_provider_name != "filesystem":
if storage_provider_config == "":
raise Exception(
"Error: no provider configurations are provided for provider %s" % storage_provider_name)
# ca_bundle validate
if conf.get('registry_custom_ca_bundle_path'):View on GitHub (pinned to 7b2fd08cc5)
Solutions
- Set 'log.external_endpoint.port:' to the syslog receiver port, typically 514 (udp) or 5140 (tcp)
- Keep protocol and host consistent with the receiver (udp/tcp check is separate)
- Or remove the whole 'external_endpoint:' block to use local logs
- Re-run ./install.sh
Example fix
# harbor.yml (before) external_endpoint: protocol: udp host: logs.example.com port: # harbor.yml (after) external_endpoint: protocol: udp host: logs.example.com port: 514
Defensive patterns
Strategy: validation
Validate before calling
ep = (cfg.get('log') or {}).get('external_endpoint')
if ep is not None and not ep.get('port'):
raise SystemExit('log.external_endpoint.port must be set when external_endpoint is configured')
if ep is not None and not isinstance(ep.get('port'), int):
raise SystemExit('log.external_endpoint.port must be an integer') Prevention
- Write port as a bare YAML integer (5140), not a quoted string
- Check the receiver actually listens on that port before installing
- Fill the whole external_endpoint block in one edit
When it happens
Trigger: harbor.yml has 'log.external_endpoint.port:' present but blank (empty value). config_dict['log_ep_port'] becomes '' and the check ('log_ep_port' in conf) and not conf['log_ep_port'] raises. Note the value must be non-empty; a non-numeric port is not caught here but fails later.
Common situations: Same context as the host error: enabling external logging and filling host but leaving port blank; YAML where 'port:' has no value; ports accidentally commented out.
Related errors
- Error: must set log endpoint host to enable external host
- Protocol in external log endpoint must be one of 'udp' or 't
- log level must be one of debug, info, warning, error, fatal
- missing logger config of job service
- missing logger config of job
AI-assisted analysis of goharbor/harbor@7b2fd08cc5 (2026-08-16).
Data as JSON: /api/errors/ab6cfd335a6140c3.
Report an issue: GitHub.