{"record":{"id":"a77068fb5c141828","repo":"cloudflare/cloudflared","slug":"failed-to-create-feature-selector","errorCode":null,"errorMessage":"Failed to create feature selector","messagePattern":"Failed to create feature selector","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/cloudflared/tunnel/configuration.go","lineNumber":125,"sourceCode":"\t\t\t}\n\t\t}\n\t}\n\treturn false\n}\n\nfunc prepareTunnelConfig(\n\tctx context.Context,\n\tc *cli.Context,\n\tinfo *cliutil.BuildInfo,\n\tlog, logTransport *zerolog.Logger,\n\tobserver *connection.Observer,\n\tnamedTunnel *connection.TunnelProperties,\n) (*supervisor.TunnelConfig, *orchestration.Config, error) {\n\ttransportProtocol := c.String(flags.Protocol)\n\tisPostQuantumEnforced := c.Bool(flags.PostQuantum)\n\tfeatureSelector, err := features.NewFeatureSelector(ctx, namedTunnel.Credentials.AccountTag, c.StringSlice(flags.Features), isPostQuantumEnforced, log)\n\tif err != nil {\n\t\treturn nil, nil, errors.Wrap(err, \"Failed to create feature selector\")\n\t}\n\n\tclientConfig, err := client.NewConfig(info.Version(), info.OSArch(), featureSelector)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tlog.Info().Msgf(\"Generated Connector ID: %s\", clientConfig.ConnectorID)\n\n\ttags, err := NewTagSliceFromCLI(c.StringSlice(flags.Tag))\n\tif err != nil {\n\t\tlog.Err(err).Msg(\"Tag parse failure\")\n\t\treturn nil, nil, errors.Wrap(err, \"Tag parse failure\")\n\t}\n\ttags = append(tags, pogs.Tag{Name: \"ID\", Value: clientConfig.ConnectorID.String()})\n\n\tcfg := config.GetConfiguration()\n\tingressRules, err := ingress.ParseIngressFromConfigAndCLI(cfg, c, log)","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/cloudflare/cloudflared/blob/2253eeeb25a44a713a4b60b8ba1e1b3f377d1a0f/cmd/cloudflared/tunnel/configuration.go#L107-L143","documentation":"prepareTunnelConfig calls features.NewFeatureSelector to compute which protocol/features the connector will use, given the named tunnel properties and CLI flags. If feature selection cannot be produced the whole tunnel configuration fails and StartServer aborts. This guards against invalid combinations of PostQuantum mode and feature flags.","triggerScenarios":"Starting a tunnel with an invalid --post-quantum value or a features flag combination that features.NewFeatureSelector rejects (unsupported feature set for the supplied TunnelProperties).","commonSituations":"Typos in the --post-quantum flag; users copying flags from newer/older cloudflared versions whose feature selector no longer accepts them; scripted deployments with stale flag values.","solutions":["Check the exact value passed to --post-quantum / feature flags against `cloudflared tunnel run --help` and fix the typo.","Remove the experimental feature flags and run with defaults to isolate the offending flag.","Upgrade or match cloudflared version to one that supports the feature flags you are passing.","Review the wrapped inner error message (logged) for the specific rejected input."],"exampleFix":"// before\ncloudflared tunnel run --post-quantum=true my-tunnel\n// flag no longer takes a value\n// after\ncloudflared tunnel run --post-quantum my-tunnel","handlingStrategy":"validation","validationCode":"// validate flag values before launch\nvalidPQ := map[string]bool{\"\": true, \"prefer\": true, \"strict\": true}\nif !validPQ[pqFlag] { return fmt.Errorf(\"unsupported --post-quantum value: %s\", pqFlag) }","typeGuard":null,"tryCatchPattern":"if err != nil {\n\treturn nil, nil, errors.Wrap(err, \"Failed to create feature selector\")\n}","preventionTips":["Copy flags only from the docs of your installed cloudflared version","Run `cloudflared tunnel run --help` to confirm accepted flag values","Avoid experimental feature flags in production scripts","Pin cloudflared versions across your fleet"],"tags":["cli","configuration","feature-flags"],"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"}