{"record":{"id":"16544c8727491bca","repo":"warpdotdev/warp","slug":"failed-to-expire-api-key","errorCode":null,"errorMessage":"failed to expire API key","messagePattern":"failed to expire API key","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"app/src/ai/agent_sdk/api_key.rs","lineNumber":215,"sourceCode":"                        ctx.terminate_app(TerminationMode::ForceTerminate, None);\n                        return;\n                    }\n                }\n\n                let uid = ApiKeyUid::from(key.uid);\n                let auth_client = ServerApiProvider::as_ref(ctx).get_auth_client();\n                ctx.spawn(\n                    async move {\n                        let result = auth_client.expire_api_key(&uid).await?;\n                        let expired = match result {\n                            ExpireApiKeyResult::ExpireApiKeyOutput(output) => output.success,\n                            ExpireApiKeyResult::UserFacingError(e) => {\n                                return Err(anyhow!(\n                                    warp_graphql::client::get_user_facing_error_message(e)\n                                ));\n                            }\n                            ExpireApiKeyResult::Unknown => {\n                                return Err(anyhow!(\"failed to expire API key\"))\n                            }\n                        };\n                        print_expire_api_key_result(\n                            uid.to_string(),\n                            expired,\n                            output_format,\n                            json_output,\n                        )?;\n                        Ok(())\n                    },\n                    |_, result: Result<()>, ctx| finish_command(result, ctx),\n                );\n            },\n        );\n    }\n}\n\nimpl warpui::Entity for ApiKeyCommandRunner {","sourceCodeStart":197,"sourceCodeEnd":233,"githubUrl":"https://github.com/warpdotdev/warp/blob/e72fd7aacbbb2236d9b3be2aad7e7178fe94b4bc/app/src/ai/agent_sdk/api_key.rs#L197-L233","documentation":"Generic fallback when the `expireApiKey` GraphQL mutation returns `ExpireApiKeyResult::Unknown`: the server responded but the payload matched neither the success output nor a recognized user-facing error, so the CLI cannot tell whether the key was actually expired.","triggerScenarios":"Running `warp api-key expire <uid> [--force]`; `auth_client.expire_api_key(&uid)` deserializes to Unknown because of schema skew, an unrecognized server error code, or an intermediary altering the response.","commonSituations":"Client/server version mismatch; auth token invalid mid-flight; proxies rewriting responses; server-side incidents.","solutions":["Check the key's actual state with `warp api-key list` — the expire may or may not have been applied","Retry the expire command: expiring an already-expired key is idempotent server-side","Update the client to a build matching the server schema","If Unknown persists, check server status/logs"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"match auth_client.expire_api_key(&uid).await? {\n    ExpireApiKeyResult::ExpireApiKeyOutput(output) => Ok(output.success),\n    ExpireApiKeyResult::UserFacingError(e) =>\n        Err(anyhow!(warp_graphql::client::get_user_facing_error_message(e))),\n    ExpireApiKeyResult::Unknown => {\n        // Expire is idempotent: verify via list_api_keys, then retry once.\n        verify_then_retry(&uid)\n    }\n}","preventionTips":["Treat Unknown as indeterminate: re-list keys to confirm state","Expire is idempotent — retrying is safe","Keep client/server schema versions aligned"],"tags":["api-key","graphql","server","expire","version-skew"],"backgroundTag":null,"analyzedSha":"e72fd7aacbbb2236d9b3be2aad7e7178fe94b4bc","analyzedAt":"2026-08-16T08:27:25.381Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}