{"record":{"id":"de2306fe7e8cf5d8","repo":"cloudflare/cloudflared","slug":"tag-parse-failure","errorCode":null,"errorMessage":"Tag parse failure","messagePattern":"Tag parse failure","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/cloudflared/tunnel/configuration.go","lineNumber":138,"sourceCode":") (*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)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tprotocolSelector, err := connection.NewProtocolSelector(transportProtocol, log)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tlog.Info().Msgf(\"Initial protocol %s\", protocolSelector.Current())\n\n\tedgeTLSConfigs := make(map[connection.Protocol]*tls.Config, len(connection.ProtocolList))\n\tfor _, p := range connection.ProtocolList {\n\t\ttlsSettings := p.TLSSettings()","sourceCodeStart":120,"sourceCodeEnd":156,"githubUrl":"https://github.com/cloudflare/cloudflared/blob/2253eeeb25a44a713a4b60b8ba1e1b3f377d1a0f/cmd/cloudflared/tunnel/configuration.go#L120-L156","documentation":"Raised when NewTagSliceFromCLI cannot parse the values passed with the repeated --tag flag. Tags must be KEY=VALUE pairs attached to the connector; a malformed entry fails tunnel configuration. The error is logged as 'Tag parse failure' and wrapped before returning.","triggerScenarios":"Running `cloudflared tunnel run --tag foo` (missing '=value'), `--tag =bar` (empty key), or `--tag a=b=c` style values that the parser rejects.","commonSituations":"Users forgetting the '=' separator; values containing unquoted '=' or spaces in shell scripts; config files with tag lists copied from docs using wrong format.","solutions":["Format every --tag as KEY=VALUE, e.g. --tag team=platform.","Quote tags in the shell if they contain special characters: --tag \"env=prod us\".","Remove empty or malformed tag entries from config file / startup scripts.","Run `cloudflared tunnel run --help` to see the expected tag syntax."],"exampleFix":"// before\ncloudflared tunnel run --tag team my-tunnel\n// after\ncloudflared tunnel run --tag team=platform my-tunnel","handlingStrategy":"validation","validationCode":"func validTag(t string) bool {\n\tparts := strings.SplitN(t, \"=\", 2)\n\treturn len(parts) == 2 && parts[0] != \"\" && parts[1] != \"\"\n}\n// check each --tag value with validTag before running","typeGuard":null,"tryCatchPattern":"tags, err := NewTagSliceFromCLI(c.StringSlice(flags.Tag))\nif err != nil {\n\tlog.Err(err).Msg(\"Tag parse failure\")\n\treturn nil, nil, errors.Wrap(err, \"Tag parse failure\")\n}","preventionTips":["Always supply tags as KEY=VALUE","Quote tag values containing spaces or '=' in shell scripts","Lint startup scripts/config files for tag format","Keep tag keys short and free of special characters"],"tags":["cli","configuration","parsing"],"backgroundTag":"invalid-cli-argument","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"}