{"record":{"id":"f04f59024ff152e4","repo":"cloudflare/cloudflared","slug":"invalid-output-value-provided-please-make-sure","errorCode":null,"errorMessage":"invalid --output value provided, please make sure it is one of: default, json","messagePattern":"invalid --output value provided, please make sure it is one of: default, json","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cmd/cloudflared/tail/cmd.go","lineNumber":277,"sourceCode":"\t}\n}\n\n// Run implements a foreground runner\nfunc Run(c *cli.Context) error {\n\tlog := cliutil.CreateStderrLogger(c)\n\n\tsignals := make(chan os.Signal, 10)\n\tsignal.Notify(signals, syscall.SIGTERM, syscall.SIGINT)\n\tdefer signal.Stop(signals)\n\n\toutput := \"default\"\n\tswitch c.String(\"output\") {\n\tcase \"default\", \"\":\n\t\toutput = \"default\"\n\tcase \"json\":\n\t\toutput = \"json\"\n\tdefault:\n\t\tlog.Err(errors.New(\"invalid --output value provided, please make sure it is one of: default, json\")).Send()\n\t}\n\n\tfilters, err := parseFilters(c)\n\tif err != nil {\n\t\tlog.Error().Err(err).Msgf(\"invalid filters provided\")\n\t\treturn nil\n\t}\n\n\tu, err := buildURL(c, log, cfapi.Logs)\n\tif err != nil {\n\t\tlog.Err(err).Msg(\"unable to construct management request URL\")\n\t\treturn nil\n\t}\n\n\theader := make(http.Header)\n\theader.Add(\"User-Agent\", buildInfo.UserAgent())\n\ttrace := c.String(\"trace\")\n\tif trace != \"\" {","sourceCodeStart":259,"sourceCodeEnd":295,"githubUrl":"https://github.com/cloudflare/cloudflared/blob/2253eeeb25a44a713a4b60b8ba1e1b3f377d1a0f/cmd/cloudflared/tail/cmd.go#L259-L295","documentation":"`cloudflared tunnel tail` accepts --output limited to `default` or `json`. Run() switches on the flag value; for anything else it logs this error. Note the current implementation logs the error and continues with an empty output value rather than returning it, which can lead to unexpected downstream behavior.","triggerScenarios":"`cloudflared tunnel tail <id> --output pretty` (or yaml, text, etc.) — any --output value other than default, empty string, or json.","commonSituations":"Users assuming yaml/pretty formats are supported like other CLIs; copy-pasted commands from docs using --output=json (with equals is fine) or --output JSON in wrong case (case-sensitive switch).","solutions":["Use `--output default` or `--output json` exactly (lowercase).","Omit --output entirely to get the default format.","Check for typos like `JSON`, `ndjson`, or `pretty` and correct them."],"exampleFix":"# before\ncloudflared tunnel tail <id> --output pretty\n# after\ncloudflared tunnel tail <id> --output json","handlingStrategy":"validation","validationCode":"case \"$OUTPUT\" in\n  \"\"|default|json) ;;\n  *) echo \"--output must be 'default' or 'json'\"; exit 2 ;;\nesac","typeGuard":null,"tryCatchPattern":"out, err := runTail(ctx, id, output)\nif err != nil {\n    if strings.Contains(err.Error(), \"invalid --output\") {\n        return runTail(ctx, id, \"default\") // retry with safe default\n    }\n    return err\n}","preventionTips":["Whitelist flag values in wrapper scripts before invoking cloudflared.","Note the value is case-sensitive: use lowercase `json`.","Consult `cloudflared tunnel tail --help` for accepted values instead of guessing formats."],"tags":["cli","flag","validation","tail"],"backgroundTag":"invalid-flag-value","analyzedSha":"2253eeeb25a44a713a4b60b8ba1e1b3f377d1a0f","analyzedAt":"2026-09-06T04:14:33.757Z","contentChangedAt":"2026-09-06T04:14:33.757Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}