【问题标题】:What causes cdk bootstrap to hang?是什么导致 cdk 引导程序挂起?
【发布时间】:2021-10-28 17:38:21
【问题描述】:

我正在尝试使用 cdk bootstrap 命令。

>$env:CDK_NEW_BOOTSTRAP=1
>npx cdk bootstrap --cloudformation-execution-policies arn:aws:iam::aws:policy/AdministratorAccess aws://1234.../us-east-1

我得到了输出:

CDK_NEW_BOOTSTRAP set, using new-style bootstrapping.
Bootstrapping environment aws://1234.../us-east-1...

我只是挂在这一点上。有一次我在一个多小时后回来了,但它仍然卡住了。带有前缀 cdk 的 s3 存储桶确实出现了,但没有文件。

我尝试运行了几次,但总是一样。

什么会导致它这样卡住?

更新

根据 vt102 的评论,我从命令中得到了一些错误。

>$env:CDK_NEW_BOOTSTRAP=1
>npx cdk bootstrap --cloudformation-execution-policies --verbose --debug arn:aws:iam::aws:policy/AdministratorAccess aws://1234.../us-east-1

现在的输出是:

Waiting for stack CDKToolkit to finish creating or updating...
Stack CDKToolkit has an ongoing operation in progress and is not stable (REVIEW_IN_PROGRESS (User Initiated))

关于不稳定堆栈的第二行每隔几秒钟就会重复一次。

我进入 AWS 控制台并在 CloudFormation -> Stacks 下查看,但没有列出任何堆栈。我试图更改状态过滤器,但没有。

如何找到并删除这个不稳定的堆栈并重新开始?

我记得当我第一次尝试 cdk 命令时,我在帐号和区域中出现了语法错误。它卡住了,我杀了它。可能就是在那个时候它进入了这种无效状态。

那个

【问题讨论】:

  • 流程管理器显示什么?在 Windows 上,您可以检查 Process Explorer。在 Linux 上,您可以使用 ps aux -Hww。在 Mac OS X 上,树模式下的 htop (F5) 会有所帮助。如果它已经在创建 CDKToolkit 堆栈,它的状态是什么?
  • cdk 有 --verbose--debug 标志。使用这些运行并检查其输出。
  • 检查 Cloud Formation web gui,它会显示卡在哪里。
  • @vt102 这是个好主意。当我添加 --verbose --debug 标志时,它揭示了问题。 Waiting for stack CDKToolkit to finish creating or updating... Stack CDKToolkit has an ongoing operation in progress and is not stable (REVIEW_IN_PROGRESS (User Initiated)).我会尝试弄清楚如何在 AWS 控制台中清除它,然后再试一次。

标签: amazon-web-services aws-cdk


【解决方案1】:

我遇到了完全相同的问题,正在管理控制台中的某处搜索堆栈。经过长时间的重新安装,更新等。我再次被控制台愚弄。我通过 AWS CLI 检查了堆栈

aws cloudformation list-stacks --region eu-west-1 --profile account-id_AWSAdministratorAccess

我发现控制台隐藏了一个堆栈

"StackSummaries": [
    {
        "StackId": "arn:aws:cloudformation:eu-west-1:account-id:stack/CDKToolkit/some-uuid",
        "StackName": "CDKToolkit",
        "TemplateDescription": "This stack includes resources needed to deploy AWS CDK apps into this environment",
        "CreationTime": "2021-12-13T15:16:34.541000+00:00",
        "LastUpdatedTime": "2021-12-13T15:16:40.397000+00:00",
        "DeletionTime": "2021-12-13T15:23:40.728000+00:00",
        "StackStatus": "DELETE_IN_PROGRESS",
        "DriftInformation": {
            "StackDriftStatus": "NOT_CHECKED"
        }
    },

我可以通过以下方式删除它:

aws cloudformation delete-stack --stack-name CDKToolkit --region eu-west-1 --profile account-id_AWSAdministratorAccess

之后我可以再次引导

【讨论】:

  • 非常好!我现在退出了那个项目,所以我无法尝试你的答案,但我相信如果我再次遇到这个问题会有所帮助。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-11-18
  • 2015-03-02
  • 1970-01-01
相关资源
最近更新 更多