{"record":{"id":"7c02d943ca54a59e","repo":"influxdata/influxdb","slug":"must-be-formatted-as-key-value","errorCode":null,"errorMessage":"must be formatted as \"key=value\"","messagePattern":"must be formatted as \"key=value\"","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"influxdb3_commands/src/common.rs","lineNumber":76,"sourceCode":"\n// A clap argument provided as a key/value pair separated by `SEPARATOR`, which by default is a '='\n#[derive(Debug, Clone)]\npub struct SeparatedKeyValue<K, V, const SEPARATOR: char = '='>(pub (K, V));\n\nimpl<K, V, const SEPARATOR: char> FromStr for SeparatedKeyValue<K, V, SEPARATOR>\nwhere\n    K: FromStr<Err: Into<anyhow::Error>>,\n    V: FromStr<Err: Into<anyhow::Error>>,\n{\n    type Err = anyhow::Error;\n\n    fn from_str(s: &str) -> Result<Self, Self::Err> {\n        let (key, value) = s\n            // we only split once because the structure of our input is a SEPARATOR-separated tuple\n            // and we need to allow the SEPARATOR value to be included multiple times in value side\n            // of the tuple\n            .split_once(SEPARATOR)\n            .ok_or_else(|| anyhow::anyhow!(\"must be formatted as \\\"key=value\\\"\"))?;\n\n        Ok(Self((\n            key.parse().map_err(Into::into)?,\n            value.parse().map_err(Into::into)?,\n        )))\n    }\n}\n\n#[derive(Debug, Copy, Clone, PartialEq, Eq)]\npub enum DataType {\n    Int64,\n    Uint64,\n    Float64,\n    Utf8,\n    Bool,\n}\n\n#[derive(Debug, PartialEq, Eq, thiserror::Error)]","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/influxdata/influxdb/blob/d28e26e048401c53cbb98cf2d6ab0cf1e98048ca/influxdb3_commands/src/common.rs#L58-L94","documentation":"SeparatedKeyValue<K, V> is the clap parser for repeated key=value CLI options in the influxdb3 CLI — concretely --trigger-arguments on `influxdb3 create trigger` and --input-arguments on `influxdb3 test trigger`. Its FromStr splits the token once on '=' (the default SEPARATOR); if split_once returns None the token contained no '=' at all and this error is produced. Values may themselves contain '=' because only the first separator splits.","triggerScenarios":"Passing a token without an equals sign: `influxdb3 create trigger ... --trigger-arguments foo`, or `--input-arguments config.json`. Also shell quoting that strips the '=' (e.g. unquoted strings mangled by an outer parser).","commonSituations":"Assuming the flag takes a filename or bare value instead of KEY=VALUE pairs; copy-pasting from docs or wikis where formatting dropped the '='; scripts building the argument list with a missing value component.","solutions":["Provide every argument as KEY=VALUE, e.g. --trigger-arguments host=example.com port=8080","Quote each token in the shell so nothing is re-parsed: \"--trigger-arguments\" \"key=my=value\" (later '=' stay in the value)","Check for typos: empty values (`key=`) are fine, but a missing '=' is not"],"exampleFix":"# before\ninfluxdb3 create trigger --database db --plugin-filename p.py \\\n  --trigger-arguments filename   # no '=' -> must be formatted as \"key=value\"\n\n# after\ninfluxdb3 create trigger --database db --plugin-filename p.py \\\n  --trigger-arguments \"filename=data.csv\"","handlingStrategy":"validation","validationCode":"# shell: validate every key=value argument before invoking the CLI\nfor arg in \"${TRIGGER_ARGS[@]}\"; do\n  [[ \"$arg\" == *=* ]] || { echo \"bad argument '$arg': expected key=value\" >&2; exit 1; }\ndone","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Remember --trigger-arguments and --input-arguments take KEY=VALUE tokens, one per flag use or space-separated","Quote each token so later '=' characters stay in the value","Generate the argument list programmatically and validate it in scripts"],"tags":["influxdb","cli","clap","parsing","key-value"],"backgroundTag":"invalid-cli-argument","analyzedSha":"d28e26e048401c53cbb98cf2d6ab0cf1e98048ca","analyzedAt":"2026-08-16T19:53:34.623Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}