{"record":{"id":"40edd31a344ac091","repo":"cloudflare/cloudflared","slug":"unknown-output-format-s","errorCode":null,"errorMessage":"Unknown output format '%s'","messagePattern":"Unknown output format '(.+?)'","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/cloudflared/tunnel/subcommands.go","lineNumber":712,"sourceCode":"\n\ttunnelIDs, err := sc.findIDs(c.Args().Slice())\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn sc.delete(tunnelIDs)\n}\n\nfunc renderOutput(format string, v interface{}) error {\n\tswitch format {\n\tcase \"json\":\n\t\tencoder := json.NewEncoder(os.Stdout)\n\t\tencoder.SetIndent(\"\", \"  \")\n\t\treturn encoder.Encode(v)\n\tcase \"yaml\":\n\t\treturn yaml.NewEncoder(os.Stdout).Encode(v)\n\tdefault:\n\t\treturn errors.Errorf(\"Unknown output format '%s'\", format)\n\t}\n}\n\nfunc buildRunCommand() *cli.Command {\n\t//nolint: prealloc\n\tcliFlags := []cli.Flag{\n\t\tcredentialsFileFlag,\n\t\tcredentialsContentsFlag,\n\t\tpostQuantumFlag,\n\t\tselectProtocolFlag,\n\t\tfeaturesFlag,\n\t\ttunnelTokenFlag,\n\t\ttunnelTokenFileFlag,\n\t\ticmpv4SrcFlag,\n\t\ticmpv6SrcFlag,\n\t\tmaxActiveFlowsFlag,\n\t\tdnsResolverAddrsFlag,\n\t}","sourceCodeStart":694,"sourceCodeEnd":730,"githubUrl":"https://github.com/cloudflare/cloudflared/blob/2253eeeb25a44a713a4b60b8ba1e1b3f377d1a0f/cmd/cloudflared/tunnel/subcommands.go#L694-L730","documentation":"renderOutput serializes command results to stdout in the format chosen by the --output flag. Only 'json' and 'yaml' are supported; any other value produces 'Unknown output format %s'. This is used by create, list, info, routes, and vnet list commands.","triggerScenarios":"Passing an unsupported --output value, e.g. `cloudflared tunnel list --output table`, --output JSON (case-sensitive), or --output xml.","commonSituations":"Users assuming table/text output is supported; capitalization mistakes like JSON/YAML; older cloudflared versions where --output handling or supported formats differ; scripts carrying flags over from other CLIs.","solutions":["Use --output json or --output yaml only (lowercase)","Omit the --output flag entirely for the default human-readable output","Check `cloudflared tunnel list --help` for the exact accepted values on your version","Fix case in scripts — the format string is matched exactly"],"exampleFix":"// before\ncloudflared tunnel list --output table\n// after\ncloudflared tunnel list --output json   # or omit --output","handlingStrategy":"validation","validationCode":"var supportedFormats = map[string]bool{\"json\": true, \"yaml\": true}\nif format != \"\" && !supportedFormats[strings.ToLower(format)] {\n\treturn fmt.Errorf(\"unsupported --output %q; use json or yaml\", format)\n}","typeGuard":"func isSupportedOutputFormat(f string) bool {\n\treturn f == \"\" || f == \"json\" || f == \"yaml\"\n}","tryCatchPattern":"if err := renderOutput(format, v); err != nil {\n\tif strings.HasPrefix(err.Error(), \"Unknown output format\") {\n\t\t// fall back to default text output\n\t}\n\treturn err\n}","preventionTips":["Only use --output json or --output yaml (lowercase)","Omit --output for human-readable output","Pin cloudflared versions and verify flag help in CI before scripted use","Avoid case changes — format matching is exact"],"tags":["cloudflared","cli","output-format","validation"],"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"}