{"record":{"id":"ab6cfd335a6140c3","repo":"goharbor/harbor","slug":"error-must-set-log-endpoint-port-to-enable-extern","errorCode":null,"errorMessage":"Error: must set log endpoint port to enable external host","messagePattern":"Error: must set log endpoint port to enable external host","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"make/photon/prepare/utils/configs.py","lineNumber":41,"sourceCode":"        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)\n    # ca_bundle validate\n    if conf.get('registry_custom_ca_bundle_path'):","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/make/photon/prepare/utils/configs.py#L23-L59","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"# harbor.yml (before)\nexternal_endpoint:\n  protocol: udp\n  host: logs.example.com\n  port:\n\n# harbor.yml (after)\nexternal_endpoint:\n  protocol: udp\n  host: logs.example.com\n  port: 514","handlingStrategy":"validation","validationCode":"ep = (cfg.get('log') or {}).get('external_endpoint')\nif ep is not None and not ep.get('port'):\n    raise SystemExit('log.external_endpoint.port must be set when external_endpoint is configured')\nif ep is not None and not isinstance(ep.get('port'), int):\n    raise SystemExit('log.external_endpoint.port must be an integer')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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"],"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"}