{"record":{"id":"95698f27af5b3222","repo":"neondatabase/neon","slug":"unknown-scheduling-policy-s-try-active-essent","errorCode":null,"errorMessage":"Unknown scheduling policy '{s}', try active,essential,pause,stop","messagePattern":"Unknown scheduling policy '(.+?)', try active,essential,pause,stop","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"control_plane/storcon_cli/src/main.rs","lineNumber":392,"sourceCode":"\n    fn from_str(s: &str) -> Result<Self, Self::Err> {\n        SkSchedulingPolicy::from_str(s).map(Self)\n    }\n}\n\n#[derive(Debug, Clone)]\nstruct ShardSchedulingPolicyArg(ShardSchedulingPolicy);\n\nimpl FromStr for ShardSchedulingPolicyArg {\n    type Err = anyhow::Error;\n\n    fn from_str(s: &str) -> Result<Self, Self::Err> {\n        match s {\n            \"active\" => Ok(Self(ShardSchedulingPolicy::Active)),\n            \"essential\" => Ok(Self(ShardSchedulingPolicy::Essential)),\n            \"pause\" => Ok(Self(ShardSchedulingPolicy::Pause)),\n            \"stop\" => Ok(Self(ShardSchedulingPolicy::Stop)),\n            _ => Err(anyhow::anyhow!(\n                \"Unknown scheduling policy '{s}', try active,essential,pause,stop\"\n            )),\n        }\n    }\n}\n\n#[derive(Debug, Clone)]\nstruct NodeAvailabilityArg(NodeAvailabilityWrapper);\n\nimpl FromStr for NodeAvailabilityArg {\n    type Err = anyhow::Error;\n\n    fn from_str(s: &str) -> Result<Self, Self::Err> {\n        match s {\n            \"active\" => Ok(Self(NodeAvailabilityWrapper::Active)),\n            \"offline\" => Ok(Self(NodeAvailabilityWrapper::Offline)),\n            _ => Err(anyhow::anyhow!(\"Unknown availability state '{s}'\")),\n        }","sourceCodeStart":374,"sourceCodeEnd":410,"githubUrl":"https://github.com/neondatabase/neon/blob/8f60b04da47ffefe0e52bda2440134b42874eb75/control_plane/storcon_cli/src/main.rs#L374-L410","documentation":"storcon_cli parses its scheduling-policy CLI argument through a FromStr impl that accepts exactly four lowercase strings: active, essential, pause, stop. Any other input fails during argument parsing, before any request reaches the storage controller. The four values map to ShardSchedulingPolicy variants Active, Essential, Pause, Stop.","triggerScenarios":"Running a storcon_cli subcommand that takes a scheduling policy (e.g. node configure with a --scheduling-style flag) with a misspelled, capitalized, or out-of-vocabulary value such as 'Active', 'draining', or 'filling'. Clap surfaces the anyhow error from ShardSchedulingPolicyArg::from_str verbatim.","commonSituations":"Typos or wrong casing; using vocabulary from other Neon components (pageserver 'draining'/'filling' scheduling states) that is not valid here; confusing scheduling policy with node availability (active/offline) and passing the wrong one.","solutions":["Re-run with one of the exact lowercase values: active, essential, pause, stop","Run storcon_cli <subcommand> --help to see the accepted values for the flag","If you meant node up/down state, use the availability argument (active, offline) instead of the scheduling policy argument"],"exampleFix":"# before\nstorcon_cli node configure --node-id 1 --scheduling Draining\n# after\nstorcon_cli node configure --node-id 1 --scheduling pause","handlingStrategy":"validation","validationCode":"const VALID_SCHEDULING: &[&str] = &[\"active\", \"essential\", \"pause\", \"stop\"];\n\nfn validate_scheduling(value: &str) -> Result<(), String> {\n    if VALID_SCHEDULING.contains(&value) {\n        Ok(())\n    } else {\n        Err(format!(\"invalid scheduling policy '{value}', expected one of {VALID_SCHEDULING:?}\"))\n    }\n}\n// call before spawning storcon_cli\nvalidate_scheduling(&policy)?;","typeGuard":"fn is_valid_scheduling_policy(s: &str) -> bool {\n    matches!(s, \"active\" | \"essential\" | \"pause\" | \"stop\")\n}","tryCatchPattern":null,"preventionTips":["Keep the allowed vocabulary in one shared constant next to the code that builds storcon_cli commands","Never let scheduling and availability vocabularies mix; assert the flag name and value set together","Fail fast in scripts: validate arguments before running any mutating storcon_cli command"],"tags":["cli","argument-parsing","storcon","rust","scheduling"],"backgroundTag":"invalid-cli-argument","analyzedSha":"8f60b04da47ffefe0e52bda2440134b42874eb75","analyzedAt":"2026-08-16T23:39:28.135Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}