{"record":{"id":"662b2f99c879daee","repo":"cloudflare/cloudflared","slug":"unknown-protocol-s-s","errorCode":null,"errorMessage":"unknown protocol %s, %s","messagePattern":"unknown protocol (.+?), (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"connection/protocol.go","lineNumber":136,"sourceCode":"func NewProtocolSelector(\n\tprotocolFlag string,\n\tlog *zerolog.Logger,\n) (ProtocolSelector, error) {\n\t// If the user picks a protocol, then we stick to it no matter what.\n\tswitch protocolFlag {\n\tcase \"h2mux\":\n\t\t// Any users still requesting h2mux will be upgraded to http2 instead\n\t\tlog.Warn().Msg(\"h2mux is no longer a supported protocol: upgrading edge connection to http2. Please remove '--protocol h2mux' from runtime arguments to remove this warning.\")\n\t\treturn &protocolSelector{current: HTTP2}, nil\n\tcase QUIC.String():\n\t\treturn &protocolSelector{current: QUIC}, nil\n\tcase HTTP2.String():\n\t\treturn &protocolSelector{current: HTTP2}, nil\n\tcase AutoSelectFlag:\n\t\treturn &protocolSelector{current: QUIC, allowFallback: true}, nil\n\t}\n\n\treturn nil, fmt.Errorf(\"unknown protocol %s, %s\", protocolFlag, AvailableProtocolFlagMessage)\n}\n","sourceCodeStart":118,"sourceCodeEnd":138,"githubUrl":"https://github.com/cloudflare/cloudflared/blob/2253eeeb25a44a713a4b60b8ba1e1b3f377d1a0f/connection/protocol.go#L118-L138","documentation":"NewProtocolSelector maps the --protocol flag value to a protocolSelector. Accepted values are quic, http2, and auto. Any other string falls through to `unknown protocol %s, %s` with the list of valid values appended (AvailableProtocolFlagMessage). It fails fast at tunnel startup before any connection attempt.","triggerScenarios":"prepareTunnelConfig (or tests) calls NewProtocolSelector with a --protocol flag value not in {quic, http2, auto}, e.g. a typo (`quic2`), old value (`h2mux` removed in newer versions), or an empty-but-set string.","commonSituations":"Config files carried over from older cloudflared versions still setting `protocol: h2mux`, typos in the --protocol CLI flag, or automation scripts using invalid values.","solutions":["Set --protocol to one of: quic, http2, or auto (or remove the flag to use auto)","Replace removed values like h2mux with http2","Check both the config file `protocol:` key and the CLI flag, since config file values also flow here","Run `cloudflared tunnel --help` to see the accepted protocol values for your version"],"exampleFix":"# before (config.yml)\nprotocol: h2mux\n# after\nprotocol: quic","handlingStrategy":"validation","validationCode":"valid := map[string]bool{\"quic\": true, \"http2\": true, \"auto\": true}\nif p := cfg.Protocol; p != \"\" && !valid[strings.ToLower(p)] {\n    return fmt.Errorf(\"protocol %q is invalid; use quic, http2, or auto\", p)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only set --protocol to quic, http2, or auto","Migrate removed protocol values (h2mux) to http2 in old configs","Keep the config file `protocol:` key consistent with CLI flags"],"tags":["config","protocol","cli-flag","enum"],"backgroundTag":"invalid-enum-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"}