{"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":218,"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":200,"sourceCodeEnd":236,"githubUrl":"https://github.com/jdx/mise/blob/6f52dcdf99e282ef7a7db68c81301fa4618d0f79/src/cli/set.rs#L200-L236","documentation":"On the write path, after --prompt/--stdin processing, every variable must carry a value before it can be encrypted. This is the --age-encrypt branch: create_age_directive() needs plaintext to encrypt to the age recipients, so a variable that still has value None bails '{key} has no value'. The single-bare-key read shortcut only applies without --prompt/--stdin, so multiple bare keys or keys skipped by prompting fall through to here.","triggerScenarios":"Running `mise set --age-encrypt FOO BAR` (two bare keys — only a single bare key takes the read path), or mixing forms like `mise set --age-encrypt FOO BAR=baz` where FOO never receives a value.","commonSituations":"Trying to encrypt several variables in one command while assuming bare keys would be read interactively without --prompt; mixing already-valued and bare keys in a single invocation.","solutions":["Provide values inline for every key: `mise set --age-encrypt FOO=secret BAR=secret2`","Or add --prompt so bare keys are prompted (and masked) interactively: `mise set --age-encrypt --prompt FOO BAR`","Query values one key at a time: `mise set FOO` (single bare key is the read form)"],"exampleFix":"# before\nmise set --age-encrypt --age-recipient age1... API_TOKEN DB_PASSWORD   # API_TOKEN has no value\n\n# after\nmise set --age-encrypt --age-recipient age1... API_TOKEN=xxx DB_TOKEN=yyy\n# or be prompted with masked input:\nmise set --age-encrypt --prompt API_TOKEN DB_TOKEN","handlingStrategy":"validation","validationCode":"# ensure every variable has a value before encrypting\nfor kv in \"$@\"; do\n  case \"$kv\" in\n    *=*) ;;\n    *) echo \"$kv has no value; use KEY=VALUE or --prompt\" >&2; exit 2;;\n  esac\ndone\nmise set --age-encrypt --age-recipient \"$AGE_RECIPIENT\" \"$@\"","typeGuard":"all_keyed() { for a in \"$@\"; do case \"$a\" in *=*) ;; *) return 1;; esac; done; return 0; }","tryCatchPattern":"Catch '{key} has no value' and re-run the same command with --prompt so the operator supplies the missing values interactively (masked for age).","preventionTips":["With multiple keys, always use KEY=VALUE form or --prompt","Only a single bare key switches to read mode — never rely on bare keys in set operations","Validate arguments in wrapper scripts before touching config files"],"tags":["env","age","encryption","arguments","missing-value","mise"],"backgroundTag":"missing-required-value","analyzedSha":"6f52dcdf99e282ef7a7db68c81301fa4618d0f79","analyzedAt":"2026-08-22T10:14:23.840Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}