You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

AWS Elastic Beanstalk执行eb swap命令提示环境待部署错误如何解决

该问题为EB CLI 3.20.2版本的已知bug

该版本新增了客户端侧的环境状态预校验逻辑,存在状态同步延迟、误判环境处于pending部署状态的问题,而AWS管理控制台直接调用后端原生接口,无额外客户端校验,因此可以正常完成交换操作。

排查验证步骤

运行如下命令确认环境真实状态:

eb status AAAA --profile CCCC

若返回结果中Status为Ready、Health状态正常,即可确认属于CLI误判。

解决方案

临时规避(无需升级版本)

二选一即可:

  • 先强制刷新环境状态后再执行swap操作
eb use AAAA --profile CCCC
eb deploy --refresh --nohang --profile CCCC
# 等待1~2分钟后执行交换
eb swap AAAA --destination_name BBBB --profile CCCC
  • 直接调用AWS CLI原生的Elastic Beanstalk交换接口,绕过EB CLI的状态校验
aws elasticbeanstalk swap-environment-cnames --source-environment-name AAAA --destination-environment-name BBBB --profile CCCC

永久修复

升级EB CLI到3.20.3及以上版本,该版本已修复客户端状态校验错误的问题:

pip install awsebcli --upgrade --user

升级完成后验证版本:

eb --version

内容的提问来源于stack exchange,提问作者naan

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.10.02 12:06:01