{"record":{"id":"0d126ef981424865","repo":"neondatabase/neon","slug":"unsupported-linekind-s","errorCode":null,"errorMessage":"unsupported linekind: {s}","messagePattern":"unsupported linekind: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pageserver/ctl/src/draw_timeline_dir.rs","lineNumber":133,"sourceCode":"}\n\nimpl From<LineKind> for Fill {\n    fn from(value: LineKind) -> Self {\n        match value {\n            LineKind::GcCutoff => Fill::Color(rgb(255, 0, 0)),\n            LineKind::Branch => Fill::Color(rgb(0, 255, 0)),\n        }\n    }\n}\n\nimpl FromStr for LineKind {\n    type Err = anyhow::Error;\n\n    fn from_str(s: &str) -> std::prelude::v1::Result<Self, Self::Err> {\n        Ok(match s {\n            \"gc_cutoff\" => LineKind::GcCutoff,\n            \"branch\" => LineKind::Branch,\n            _ => anyhow::bail!(\"unsupported linekind: {s}\"),\n        })\n    }\n}\n\npub fn main() -> Result<()> {\n    // Parse layer filenames from stdin\n    struct Layer {\n        filename: String,\n        key_range: Range<Key>,\n        lsn_range: Range<Lsn>,\n    }\n    let mut files: Vec<Layer> = vec![];\n    let stdin = io::stdin();\n\n    let mut lines: Vec<(Lsn, LineKind)> = vec![];\n\n    for (lineno, line) in stdin.lock().lines().enumerate() {\n        let lineno = lineno + 1;","sourceCodeStart":115,"sourceCodeEnd":151,"githubUrl":"https://github.com/neondatabase/neon/blob/8f60b04da47ffefe0e52bda2440134b42874eb75/pageserver/ctl/src/draw_timeline_dir.rs#L115-L151","documentation":"The draw_timeline_dir command renders horizontal guide lines and parses a --linekind value with FromStr. Only the exact strings \"gc_cutoff\" and \"branch\" are recognized; any other value bails before any drawing happens. The match is case-sensitive and has no aliases.","triggerScenarios":"Passing --linekind gc-horizon, --linekind GC_CUTOFF, or any other spelling than the two accepted literals.","commonSituations":"Guessing flag values without --help; renamed variants between ctl versions; shell completion inserting the wrong token.","solutions":["Use exactly gc_cutoff or branch, lowercase with an underscore.","Run the subcommand with --help to list the accepted values for your ctl build."],"exampleFix":"# before\npageserver_ctl draw-timeline-dir --linekind gc-horizon ...\n\n# after\npageserver_ctl draw-timeline-dir --linekind gc_cutoff ...","handlingStrategy":"validation","validationCode":"// validate before the call\nanyhow::ensure!(\n    matches!(linekind.as_str(), \"gc_cutoff\" | \"branch\"),\n    \"linekind must be gc_cutoff or branch, got {linekind}\"\n);","typeGuard":"fn is_supported_linekind(s: &str) -> bool {\n    matches!(s, \"gc_cutoff\" | \"branch\")\n}","tryCatchPattern":null,"preventionTips":["Check the subcommand's --help for accepted enum values before scripting.","Keep a shared constant listing accepted linekinds if you wrap the ctl in tooling."],"tags":["rust","neon","ctl","cli","input-validation"],"backgroundTag":"invalid-cli-argument-value","analyzedSha":"8f60b04da47ffefe0e52bda2440134b42874eb75","analyzedAt":"2026-08-16T23:39:28.135Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}