{"record":{"id":"1bff4611b7413c05","repo":"neondatabase/neon","slug":"unknown-placement-policy-s-try-detached-secon","errorCode":null,"errorMessage":"Unknown placement policy '{s}', try detached,secondary,attached:<n>","messagePattern":"Unknown placement policy '(.+?)', try detached,secondary,attached:<n>","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"control_plane/storcon_cli/src/main.rs","lineNumber":362,"sourceCode":"\nimpl FromStr for PlacementPolicyArg {\n    type Err = anyhow::Error;\n\n    fn from_str(s: &str) -> Result<Self, Self::Err> {\n        match s {\n            \"detached\" => Ok(Self(PlacementPolicy::Detached)),\n            \"secondary\" => Ok(Self(PlacementPolicy::Secondary)),\n            _ if s.starts_with(\"attached:\") => {\n                let mut splitter = s.split(':');\n                let _prefix = splitter.next().unwrap();\n                match splitter.next().and_then(|s| s.parse::<usize>().ok()) {\n                    Some(n) => Ok(Self(PlacementPolicy::Attached(n))),\n                    None => Err(anyhow::anyhow!(\n                        \"Invalid format '{s}', a valid example is 'attached:1'\"\n                    )),\n                }\n            }\n            _ => Err(anyhow::anyhow!(\n                \"Unknown placement policy '{s}', try detached,secondary,attached:<n>\"\n            )),\n        }\n    }\n}\n\n#[derive(Debug, Clone)]\nstruct SkSchedulingPolicyArg(SkSchedulingPolicy);\n\nimpl FromStr for SkSchedulingPolicyArg {\n    type Err = anyhow::Error;\n\n    fn from_str(s: &str) -> Result<Self, Self::Err> {\n        SkSchedulingPolicy::from_str(s).map(Self)\n    }\n}\n\n#[derive(Debug, Clone)]","sourceCodeStart":344,"sourceCodeEnd":380,"githubUrl":"https://github.com/neondatabase/neon/blob/8f60b04da47ffefe0e52bda2440134b42874eb75/control_plane/storcon_cli/src/main.rs#L344-L380","documentation":"The placement policy parser did not recognize the value at all: it is neither the keyword 'detached' nor 'secondary' and does not start with 'attached:'. This is the catch-all FromStr error for PlacementPolicyArg.","triggerScenarios":"Typos, casing, or whitespace deviations: attach:1, Detached, ' detached' (leading space from quoting), detached-standby, or an empty string.","commonSituations":"Shell quoting mistakes adding whitespace, stale flag vocabulary from older CLI versions, autocomplete typos.","solutions":["Use exactly one of detached, secondary, or attached:<n>","Check for stray whitespace or quotes around the argument","Consult --help for the accepted policy syntax"],"exampleFix":"# before\n--placement-policy attach:1\n# after\n--placement-policy attached:1","handlingStrategy":"type-guard","validationCode":"let arg = arg.trim();\nif !matches!(arg, \"detached\" | \"secondary\") && !arg.starts_with(\"attached:\") {\n    eprintln!(\"unknown policy '{arg}'; try detached, secondary, attached:<n>\");\n}","typeGuard":"fn is_known_placement_policy(s: &str) -> bool {\n    matches!(s, \"detached\" | \"secondary\") || s.starts_with(\"attached:\")\n}","tryCatchPattern":null,"preventionTips":["Trim whitespace and match exact casing before passing the flag","Quote CLI arguments in scripts","Re-check --help when the CLI vocabulary changes between versions"],"tags":["rust","storcon-cli","cli","argument-parsing","placement-policy"],"backgroundTag":"invalid-cli-argument","analyzedSha":"8f60b04da47ffefe0e52bda2440134b42874eb75","analyzedAt":"2026-08-16T23:39:28.135Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}