# 错误：未找到上下文 'deploy-aws'。请创建上下文或检查上下文名称。

- **ID:** `cicd/circleci-missing-context`
- **领域:** cicd
- **类别:** config_error
- **验证级别:** ai_generated
- **修复率:** 95%

## 根因

CircleCI 流水线引用了组织中不存在的上下文，原因可能是上下文被删除、名称拼写错误或用户缺少访问权限。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| CircleCI CLI 0.1.28000+ | active | — | — |
| CircleCI Server 4.0+ | active | — | — |
| CircleCI SaaS | active | — | — |

## 解决方案

1. ```
   Create the missing context in the CircleCI web UI (Organization Settings > Contexts > Create Context) with the exact name 'deploy-aws', then restart the pipeline from the CircleCI dashboard.
   ```
2. ```
   Correct the context name in .circleci/config.yml by verifying the existing context list via CLI: `circleci context list --org-id <org-id>` and updating the `context` field in the job.
   ```

## 无效尝试

- **Renaming the context in the CircleCI web UI without updating the .circleci/config.yml file** — The config file still references the old context name, causing the same error on the next pipeline run. (60% 失败率)
- **Creating a new context with the same name but in a different organization or team** — Contexts are scoped to organizations; a context in a different org is not accessible to the pipeline. (80% 失败率)
