{"record":{"id":"a7654867bcc430b2","repo":"jdx/mise","slug":"has-no-value","errorCode":null,"errorMessage":"{} has no value","messagePattern":"(.+?) has no value","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/set.rs","lineNumber":227,"sourceCode":"                Settings::get().ensure_experimental(\"age encryption\")?;\n                // Collect recipients once before the loop to avoid repeated I/O\n                let recipients = self.collect_age_recipients().await?;\n                for ev in env_vars {\n                    match ev.value {\n                        Some(value) => {\n                            let age_directive =\n                                agecrypt::create_age_directive(ev.key.clone(), &value, &recipients)\n                                    .await?;\n                            if let crate::config::env_directive::EnvDirective::Age {\n                                value: encrypted_value,\n                                format,\n                                ..\n                            } = age_directive\n                            {\n                                mise_toml.update_env_age(&ev.key, &encrypted_value, format)?;\n                            }\n                        }\n                        None => bail!(\"{} has no value\", ev.key),\n                    }\n                }\n            } else {\n                for ev in env_vars {\n                    match ev.value {\n                        Some(value) => mise_toml.update_env(&ev.key, value)?,\n                        None => bail!(\"{} has no value\", ev.key),\n                    }\n                }\n            }\n        }\n        mise_toml.save()\n    }\n\n    async fn complete(&self) -> Result<()> {\n        let config = Config::get().await?;\n        for ev in self.cur_env(&config).await? {\n            println!(\"{}\", ev.key);","sourceCodeStart":209,"sourceCodeEnd":245,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/cli/set.rs#L209-L245","documentation":"When setting env vars in a file whose [env] section is age-encrypted (env_age directive), each variable must carry a plaintext value to encrypt; a KEY-only argument has nothing to write. mise bails naming the key that has no value.","triggerScenarios":"`mise set KEY` (no =value and no --stdin) targeting a config file using env_age encryption, where update_env_age requires a value argument.","commonSituations":"Trying to create a placeholder entry in an encrypted env section; forgetting the value in scripts that write encrypted variables.","solutions":["Provide a value: `mise set KEY=value`","Pipe it: `echo secret | mise set --stdin KEY`","Remove the KEY-only argument if the entry was not intended"],"exampleFix":"// before\nmise set API_KEY   # API_KEY has no value (encrypted env)\n// after\nmise set API_KEY=abc123","handlingStrategy":"validation","validationCode":"[[ \"$arg\" == *=* ]] || { echo \"mise set requires KEY=VALUE for encrypted env\"; exit 1; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always supply a value when writing into env_age-managed config","Pipe secrets via --stdin rather than leaving the value empty"],"tags":["cli","env","encryption"],"backgroundTag":"missing-required-argument","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}