{"record":{"id":"bff40794d741abd0","repo":"warpdotdev/warp","slug":"secret-not-found","errorCode":null,"errorMessage":"Secret '{}' not found","messagePattern":"Secret '(.+?)' not found","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"app/src/ai/agent_sdk/secret.rs","lineNumber":433,"sourceCode":"            };\n\n            if let Some(secret_value) = secret_value {\n                // Look up the existing secret's type so we use the correct ManagedSecretValue variant.\n                let list_future = manager.list_secrets();\n                ctx.spawn(list_future, move |manager, list_result, ctx| {\n                    let secrets = match list_result {\n                        Ok(secrets) => secrets,\n                        Err(err) => {\n                            super::report_fatal_error(err, ctx);\n                            return;\n                        }\n                    };\n\n                    let secret_type = match find_secret_type(&secrets, &args.name, &secret_owner) {\n                        Some(t) => t,\n                        None => {\n                            super::report_fatal_error(\n                                anyhow::anyhow!(\"Secret '{}' not found\", args.name),\n                                ctx,\n                            );\n                            return;\n                        }\n                    };\n\n                    let managed_secret_value =\n                        match make_secret_value_from_gql_type(secret_type, &secret_value) {\n                            Ok(v) => v,\n                            Err(err) => {\n                                super::report_fatal_error(err, ctx);\n                                return;\n                            }\n                        };\n                    let update_future = manager.update_secret(\n                        secret_owner,\n                        args.name.clone(),\n                        Some(managed_secret_value),","sourceCodeStart":415,"sourceCodeEnd":451,"githubUrl":"https://github.com/warpdotdev/warp/blob/e72fd7aacbbb2236d9b3be2aad7e7178fe94b4bc/app/src/ai/agent_sdk/secret.rs#L415-L451","documentation":"During update_secret, the secrets list is fetched from the server and find_secret_type searches it by name within the resolved owner scope. This error means no secret with that name exists for that owner: typo, deleted secret, or a personal-vs-team scope mismatch between the lookup and where the secret actually lives.","triggerScenarios":"oz secret update <name> --value ... where the name does not exist under the resolved owner (e.g. missing --owner <team> so the lookup runs in personal scope), or the secret was deleted.","commonSituations":"Forgetting the team owner flag; typos; stale names after delete/re-create; assuming the update searches all scopes.","solutions":["Run the secret list command with the same owner/scope flags and confirm the exact name","Pass the matching --owner flag so the lookup hits the scope where the secret lives","Re-create the secret if it was deleted","Copy-paste the name from the listing rather than typing it"],"exampleFix":"// before\noz secret update deploy-key --value newkey\n# Error: Secret 'deploy-key' not found\n\n// after\noz secret list --owner my-team        # name lives in team scope\noz secret update deploy-key --owner my-team --value newkey","handlingStrategy":"validation","validationCode":"let secrets = list_secrets(&owner).await?;\nlet secret_type = find_secret_type(&secrets, &args.name, &secret_owner)\n    .ok_or_else(|| anyhow::anyhow!(\"no secret '{}' under {:?}; check --owner\", args.name, owner))?;\nupdate_secret(secret_type, args).await?;","typeGuard":null,"tryCatchPattern":null,"preventionTips":["List with the same owner flags before updating","Standardize owner flags across create/update/delete in scripts","Copy names from listings"],"tags":["agent-sdk","secrets","not-found","owner-scope"],"backgroundTag":null,"analyzedSha":"e72fd7aacbbb2236d9b3be2aad7e7178fe94b4bc","analyzedAt":"2026-08-16T08:27:25.381Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}