{"record":{"id":"547848aff38ea690","repo":"linera-io/linera-protocol","slug":"invalid-protocol-flag","errorCode":null,"errorMessage":"Invalid protocol flag","messagePattern":"Invalid protocol flag","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"linera-service/src/cli/main.rs","lineNumber":729,"sourceCode":"                                            .map(|ids| {\n                                                ids.into_iter().map(|s| s.parse()).collect::<Result<\n                                                    BTreeSet<_>,\n                                                    _,\n                                                >>(\n                                                )\n                                            })\n                                            .transpose()\n                                            .expect(\"Invalid application ID\")\n                                            .unwrap_or(existing_policy.free_application_ids),\n                                        flags: flags\n                                            .map(|values| {\n                                                values\n                                                    .into_iter()\n                                                    .map(|s| s.parse())\n                                                    .collect::<Result<BTreeSet<_>, _>>()\n                                            })\n                                            .transpose()\n                                            .expect(\"Invalid protocol flag\")\n                                            .unwrap_or(existing_policy.flags),\n                                    };\n                                    info!(\"{policy}\");\n                                    if committee.policy() == &policy {\n                                        return Ok(ClientOutcome::Committed(None));\n                                    }\n                                }\n                                _ => unreachable!(),\n                            }\n                            let new_committee = Committee::new(validators, policy)?;\n                            chain_client\n                                .stage_new_committee(new_committee)\n                                .await\n                                .map(|outcome| outcome.map(Some))\n                        }\n                    })\n                    .await\n                    .context(\"Failed to stage committee\")?;","sourceCodeStart":711,"sourceCodeEnd":747,"githubUrl":"https://github.com/linera-io/linera-protocol/blob/6c226ddcb332ef55118dc8d0aafbd093d5420899/linera-service/src/cli/main.rs#L711-L747","documentation":"When assembling a ResourceControlPolicy, the CLI parses each --flags string into the ProtocolFlag enum (strum EnumString) and collects the results into a BTreeSet. The expect panics when any flag string does not match a ProtocolFlag variant. In the current linera-execution the enum only defines the hidden variant _Reserved, so effectively every user-supplied flag value fails.","triggerScenarios":"Passing --flags with any value (e.g. 'foo', 'fast', '0') on a command that builds a policy: none of them map to a defined ProtocolFlag variant, so .parse() returns Err and the expect aborts.","commonSituations":"Assuming --flags accepts arbitrary feature toggles or future protocol names; carrying over flag values from other blockchains' CLIs; scripting genesis/config generation with a placeholder flag.","solutions":["Omit --flags entirely — the field is reserved for future protocol flags and has no user-facing values today","If a value must be supplied for testing, only the exact variant name '_Reserved' parses on current versions","Check the ProtocolFlag variants for your linera-execution version (linera-execution/src/policy.rs) before scripting flags","Remove the flag from templates/CI scripts that were written against a different toolchain"],"exampleFix":"# before\nlinera ... --flags experimental\n\n# after\nlinera ...   # omit --flags; no protocol flags are accepted yet","handlingStrategy":"validation","validationCode":"# Only accept flag values known to the installed version (currently none / _Reserved).\nif [ -n \"$FLAGS\" ] && [ \"$FLAGS\" != '_Reserved' ]; then echo \"unsupported --flags value\" >&2; exit 1; fi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Leave --flags unset in all scripts and templates","When upgrading Linera, check ProtocolFlag variants for newly accepted values before adopting them","Treat reserved CLI surface as off-limits in automation"],"tags":["linera","cli","resource-control-policy","enum-parsing","flags"],"backgroundTag":"invalid-config-value","analyzedSha":"6c226ddcb332ef55118dc8d0aafbd093d5420899","analyzedAt":"2026-08-22T22:49:09.787Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}