{"record":{"id":"12ab4f8a8133263e","repo":"cloudflare/cloudflared","slug":"error-starting-local-service-s","errorCode":null,"errorMessage":"Error starting local service %s","messagePattern":"Error starting local service (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"ingress/ingress.go","lineNumber":209,"sourceCode":"\n// IsEmpty checks if there are any ingress rules.\nfunc (ing Ingress) IsEmpty() bool {\n\treturn len(ing.Rules) == 0\n}\n\n// IsSingleRule checks if the user only specified a single ingress rule.\nfunc (ing Ingress) IsSingleRule() bool {\n\treturn len(ing.Rules) == 1\n}\n\n// StartOrigins will start any origin services managed by cloudflared, e.g. proxy servers or Hello World.\nfunc (ing Ingress) StartOrigins(\n\tlog *zerolog.Logger,\n\tshutdownC <-chan struct{},\n) error {\n\tfor _, rule := range ing.Rules {\n\t\tif err := rule.Service.start(log, shutdownC, rule.Config); err != nil {\n\t\t\treturn errors.Wrapf(err, \"Error starting local service %s\", rule.Service)\n\t\t}\n\t}\n\treturn nil\n}\n\n// CatchAll returns the catch-all rule (i.e. the last rule)\nfunc (ing Ingress) CatchAll() *Rule {\n\treturn &ing.Rules[len(ing.Rules)-1]\n}\n\n// Gets the default ingress rule that will be return 503 status\n// code for all incoming requests.\nfunc GetDefaultIngressRules(log *zerolog.Logger) []Rule {\n\tnoRulesService := newDefaultStatusCode(log)\n\treturn []Rule{\n\t\t{\n\t\t\tService: &noRulesService,\n\t\t},","sourceCodeStart":191,"sourceCodeEnd":227,"githubUrl":"https://github.com/cloudflare/cloudflared/blob/2253eeeb25a44a713a4b60b8ba1e1b3f377d1a0f/ingress/ingress.go#L191-L227","documentation":"StartOrigins iterates every ingress rule and calls the rule service's start function. When any local service (http, https, socks5, hello world, bastion, etc.) fails to start, the underlying error is wrapped with the rule's service string. It means one of the configured local origins could not be brought up, and cloudflared aborts starting origins.","triggerScenarios":"Calling Ingress.StartOrigins after a rule's Service.start returns an error, e.g. an http/https origin URL that fails to parse, a socks5 or bastion misconfiguration, or the embedded hello world server failing to listen.","commonSituations":"Typos in the ingress 'service' field in config.yml (e.g. 'http:/localhost:8080' with a missing slash), pointing at an invalid unix+tls path, or an origin service whose start prerequisites are missing.","solutions":["Read the wrapped inner error to identify which rule's service failed to start.","Check the 'service' value for the failing rule in your ingress config for typos and correct scheme syntax (http://, https://, unix:, unix+tls:, status:, hello_world, bastion, socks5).","Verify any referenced unix socket paths or hostnames exist and are reachable.","Run cloudflared with debug logging (--loglevel debug) to see the full startup stack."],"exampleFix":"// before\nservice: http:/localhost:8080\n// after\nservice: http://localhost:8080","handlingStrategy":"validation","validationCode":"for i, rule := range ing.Rules {\n    if rule.Service == nil {\n        return fmt.Errorf(\"rule #%d has no service\", i+1)\n    }\n    switch {\n    case strings.HasPrefix(string(*rule.Service), \"http://\"),\n        strings.HasPrefix(string(*rule.Service), \"https://\"),\n        strings.HasPrefix(string(*rule.Service), \"unix:\"),\n        strings.HasPrefix(string(*rule.Service), \"unix+tls:\"),\n        strings.HasPrefix(string(*rule.Service), \"http_status:\"),\n        *rule.Service == \"hello_world\", *rule.Service == \"bastion\", *rule.Service == \"socks5\":\n    default:\n        return fmt.Errorf(\"rule #%d has unsupported service %q\", i+1, *rule.Service)\n    }\n}","typeGuard":null,"tryCatchPattern":"if err := ing.StartOrigins(log, shutdownC); err != nil {\n    log.Error().Err(err).Msg(\"failed to start origins; check ingress service definitions\")\n    return err\n}","preventionTips":["Validate the ingress config with `cloudflared tunnel ingress validate` before running.","Use `cloudflared tunnel ingress url <url>` to test rule matching.","Keep service schemes canonical and double-check YAML indentation."],"tags":["ingress","origin-service","startup"],"backgroundTag":"invalid-config-value","analyzedSha":"2253eeeb25a44a713a4b60b8ba1e1b3f377d1a0f","analyzedAt":"2026-09-06T04:14:33.757Z","contentChangedAt":"2026-09-06T04:14:33.757Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}