{"record":{"id":"d42f2fc34538ca14","repo":"cloudflare/cloudflared","slug":"s-is-an-invalid-address-please-make-sure-it-has","errorCode":null,"errorMessage":"%s is an invalid address, please make sure it has a scheme and a hostname","messagePattern":"(.+?) is an invalid address, please make sure it has a scheme and a hostname","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"ingress/ingress.go","lineNumber":301,"sourceCode":"\t\t\t\treturn Ingress{}, fmt.Errorf(\"unable to create ip access policy for %s: %s\", r.Service, err)\n\t\t\t}\n\n\t\t\tservice = newSocksProxyOverWSService(accessPolicy)\n\t\t} else if r.Service == ServiceBastion || cfg.BastionMode {\n\t\t\t// Bastion mode will always start a Websocket proxy server, which will\n\t\t\t// overwrite the localService.URL field when `start` is called. So,\n\t\t\t// leave the URL field empty for now.\n\t\t\tcfg.BastionMode = true\n\t\t\tservice = newBastionService()\n\t\t} else {\n\t\t\t// Validate URL services\n\t\t\tu, err := url.Parse(r.Service)\n\t\t\tif err != nil {\n\t\t\t\treturn Ingress{}, err\n\t\t\t}\n\n\t\t\tif u.Scheme == \"\" || u.Hostname() == \"\" {\n\t\t\t\treturn Ingress{}, fmt.Errorf(\"%s is an invalid address, please make sure it has a scheme and a hostname\", r.Service)\n\t\t\t}\n\n\t\t\tif u.Path != \"\" {\n\t\t\t\treturn Ingress{}, fmt.Errorf(\"%s is an invalid address, ingress rules don't support proxying to a different path on the origin service. The path will be the same as the eyeball request's path\", r.Service)\n\t\t\t}\n\t\t\tif isHTTPService(u) {\n\t\t\t\tservice = &httpService{url: u}\n\t\t\t} else {\n\t\t\t\tservice = newTCPOverWSService(u)\n\t\t\t}\n\t\t}\n\n\t\tvar handlers []middleware.Handler\n\t\tif access := r.OriginRequest.Access; access != nil {\n\t\t\tif err := validateAccessConfiguration(access); err != nil {\n\t\t\t\treturn Ingress{}, err\n\t\t\t}\n\t\t\tif access.Required {","sourceCodeStart":283,"sourceCodeEnd":319,"githubUrl":"https://github.com/cloudflare/cloudflared/blob/2253eeeb25a44a713a4b60b8ba1e1b3f377d1a0f/ingress/ingress.go#L283-L319","documentation":"For non-special service values, validateIngress parses the Service string as a URL and requires both a scheme and a hostname. If either is missing, the address cannot be dialed as an origin, so this error names the offending value and explains the requirement.","triggerScenarios":"ParseIngress/UnmarshalJSON with a service value like `localhost:8080` (no scheme), `http://` (no host), or `backend.internal` (no scheme), producing a parsed URL with empty Scheme or empty Hostname().","commonSituations":"Config entries such as `service: http://localhost:8080` accidentally missing the scheme (`localhost:8080`), or bare hostnames like `service: web-backend` instead of `service: http://web-backend:80`.","solutions":["Add a scheme to the service URL, e.g. `http://localhost:8080` or `https://backend.internal`","Ensure the hostname is present after the scheme (not just `http://`)","Check for YAML quoting issues that strip part of the URL"],"exampleFix":"// before\nservice: localhost:8080\n// after\nservice: http://localhost:8080","handlingStrategy":"validation","validationCode":"func validOriginService(svc string) error {\n\tu, err := url.Parse(svc)\n\tif err != nil { return err }\n\tif u.Scheme == \"\" || u.Hostname() == \"\" {\n\t\treturn fmt.Errorf(\"service %q needs scheme and hostname\", svc)\n\t}\n\treturn nil\n}","typeGuard":null,"tryCatchPattern":"if err := ingress.ParseIngress(cfg); err != nil {\n\tif strings.Contains(err.Error(), \"is an invalid address\") {\n\t\t// fix the service URL to include scheme://host\n\t}\n\treturn err\n}","preventionTips":["Always write full URLs (scheme://host:port) in ingress service fields","Add config schema validation that requires absolute URLs","Beware YAML values like `http://host:80` that may need quoting"],"tags":["ingress","url-validation","config"],"backgroundTag":"invalid-url-format","analyzedSha":"2253eeeb25a44a713a4b60b8ba1e1b3f377d1a0f","analyzedAt":"2026-09-06T04:14:33.757Z","contentChangedAt":"2026-09-06T04:14:33.757Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}