Azure devops Azure DevOps AWS CloudFormation创建/更新堆栈任务-失败';堆栈不存在';

Azure devops Azure DevOps AWS CloudFormation创建/更新堆栈任务-失败';堆栈不存在';,azure-devops,amazon-cloudformation,aws-serverless,Azure Devops,Amazon Cloudformation,Aws Serverless,我有一个发布管道配置为使用AWS CloudFormation创建/更新堆栈任务。任务配置为使用更改集,如下所示: 然而,由于某种原因,管道不断出现故障。它失败是因为它测试堆栈的存在,发现它不存在,切换到“创建”模式,但随后测试更改集的存在,失败是因为更改集也不存在??这毫无意义 2020-12-08T03:54:36.5413925Z Checking existence for stack S2CSalesOrderStack 2020-12-08T03:54:37.5245618Z Te

我有一个发布管道配置为使用AWS CloudFormation创建/更新堆栈任务。任务配置为使用更改集,如下所示:

然而,由于某种原因,管道不断出现故障。它失败是因为它测试堆栈的存在,发现它不存在,切换到“创建”模式,但随后测试更改集的存在,失败是因为更改集也不存在??这毫无意义

2020-12-08T03:54:36.5413925Z Checking existence for stack S2CSalesOrderStack
2020-12-08T03:54:37.5245618Z Test for existence of stack S2CSalesOrderStack returned error: 'ValidationError: Stack with id S2CSalesOrderStack does not exist'.
2020-12-08T03:54:37.5265140Z Stack does not exist, switching to create stack mode
2020-12-08T03:54:37.5267421Z Testing to see if change set S2CSalesOrderStack11 associated with stack S2CSalesOrderStack exists
2020-12-08T03:54:38.3717711Z Test for existence of change set S2CSalesOrderStack11 returned error: 'Stack [S2CSalesOrderStack] does not exist'.
2020-12-08T03:54:38.3724223Z Loading template file from 'D:\a\r1\a\_AWS-S2C-ProcessMessage-CI\serverless-output\serverless-output.yaml'
2020-12-08T03:54:38.3730075Z No parameters file specified
2020-12-08T03:54:38.3731723Z Setting capability CAPABILITY_IAM for stack
2020-12-08T03:54:38.3732908Z Setting capability CAPABILITY_NAMED_IAM for stack
2020-12-08T03:54:38.3734631Z Setting capability CAPABILITY_AUTO_EXPAND for stack
2020-12-08T03:54:38.3735285Z Creating CREATE type change set S2CSalesOrderStack11
2020-12-08T03:54:46.5889859Z Change set creation request failed with error: 'undefined' { InternalFailure
2020-12-08T03:54:46.5891500Z     at constructor.extractError (D:\a\_tasks\CloudFormationCreateOrUpdateStack_7ef7cdfa-aa45-42c5-93c8-d7603643dd99\1.8.0\CloudFormationCreateOrUpdateStack.js:2:88282)
2020-12-08T03:54:46.5892456Z     at constructor.callListeners (D:\a\_tasks\CloudFormationCreateOrUpdateStack_7ef7cdfa-aa45-42c5-93c8-d7603643dd99\1.8.0\CloudFormationCreateOrUpdateStack.js:2:108520)
2020-12-08T03:54:46.5893265Z     at constructor.emit (D:\a\_tasks\CloudFormationCreateOrUpdateStack_7ef7cdfa-aa45-42c5-93c8-d7603643dd99\1.8.0\CloudFormationCreateOrUpdateStack.js:2:108230)
2020-12-08T03:54:46.5896438Z     at constructor.emitEvent (D:\a\_tasks\CloudFormationCreateOrUpdateStack_7ef7cdfa-aa45-42c5-93c8-d7603643dd99\1.8.0\CloudFormationCreateOrUpdateStack.js:2:183886)
2020-12-08T03:54:46.5897267Z     at constructor.e (D:\a\_tasks\CloudFormationCreateOrUpdateStack_7ef7cdfa-aa45-42c5-93c8-d7603643dd99\1.8.0\CloudFormationCreateOrUpdateStack.js:2:179393)
2020-12-08T03:54:46.5898003Z     at r.runTo (D:\a\_tasks\CloudFormationCreateOrUpdateStack_7ef7cdfa-aa45-42c5-93c8-d7603643dd99\1.8.0\CloudFormationCreateOrUpdateStack.js:2:185728)
2020-12-08T03:54:46.5898720Z     at D:\a\_tasks\CloudFormationCreateOrUpdateStack_7ef7cdfa-aa45-42c5-93c8-d7603643dd99\1.8.0\CloudFormationCreateOrUpdateStack.js:2:185934
2020-12-08T03:54:46.5899455Z     at constructor.<anonymous> (D:\a\_tasks\CloudFormationCreateOrUpdateStack_7ef7cdfa-aa45-42c5-93c8-d7603643dd99\1.8.0\CloudFormationCreateOrUpdateStack.js:2:179663)
2020-12-08T03:54:46.5900239Z     at constructor.<anonymous> (D:\a\_tasks\CloudFormationCreateOrUpdateStack_7ef7cdfa-aa45-42c5-93c8-d7603643dd99\1.8.0\CloudFormationCreateOrUpdateStack.js:2:183942)
2020-12-08T03:54:46.5901203Z     at constructor.callListeners (D:\a\_tasks\CloudFormationCreateOrUpdateStack_7ef7cdfa-aa45-42c5-93c8-d7603643dd99\1.8.0\CloudFormationCreateOrUpdateStack.js:2:108626)
2020-12-08T03:54:46.5901689Z   message: undefined,
2020-12-08T03:54:46.5902055Z   code: 'InternalFailure',
2020-12-08T03:54:46.5902486Z   time: 2020-12-08T03:54:46.559Z,
2020-12-08T03:54:46.5903062Z   requestId: '26a7ef25-1e18-4e00-8721-fd07bbd90a53',
2020-12-08T03:54:46.5903486Z   statusCode: 500,
2020-12-08T03:54:46.5903851Z   retryable: true }
2020-12-08T03:54:46.5962341Z ##[error]InternalFailure
2020-12-08T03:54:46.6025994Z ##[section]Finishing: Create/Update Stack: S2CSalesOrderStack
2020-12-08T03:54:36.5413925Z检查堆栈S2CSalesOrderStack是否存在
2020-12-08T03:54:37.5245618Z堆栈存在性测试S2CSalesOrderStack返回错误:“ValidationError:id为S2CSalesOrderStack的堆栈不存在”。
2020-12-08T03:54:37.5265140Z堆栈不存在,正在切换到创建堆栈模式
2020-12-08T03:54:37.5267421Z测试与堆栈S2CSalesOrderStack关联的变更集S2CSalesOrderStack11是否存在
2020-12-08T03:54:38.3717711Z测试是否存在更改集S2CSalesOrderStack11返回错误:“堆栈[S2CSalesOrderStack]不存在”。
2020-12-08T03:54:38.3724223Z从'D:\a\r1\a\\U AWS-S2C-ProcessMessage-CI\serverless output\serverless output.yaml'加载模板文件
2020-12-08T03:54:38.3730075Z未指定参数文件
2020-12-08T03:54:38.3731723Z烟囱的设置能力
2020-12-08T03:54:38.3732908Z为堆栈命名的设置能力
2020-12-08T03:54:38.3734631Z堆栈的设置能力自动扩展
2020-12-08T03:54:38.3735285Z创建创建类型更改集S2CSalesOrderStack11
2020-12-08T03:54:46.5889859Z更改集创建请求失败,错误为:“未定义”{InternalFailure
2020-12-08T03:54:46.5891500Z at constructor.extractError(D:\a\\u tasks\CloudFormationCreateOrUpdateStack\u 7ef7cdfa-aa45-42c5-93c8-d7603643dd99\1.8.0\CloudFormationCreateOrUpdateStack.js:2:88282)
2020-12-08T03:54:46.5892456Z位于constructor.callListeners(D:\a\\ u tasks\CloudFormationCreateOrUpdateStack\u 7ef7cdfa-aa45-42c5-93c8-d7603643dd99\1.8.0\CloudFormationCreateOrUpdateStack.js:2:108520)
2020-12-08T03:54:46.5893265Z位于constructor.emit(D:\a\\ u tasks\CloudFormationCreateOrUpdateStack\u 7ef7cdfa-aa45-42c5-93c8-d7603643dd99\1.8.0\CloudFormationCreateOrUpdateStack.js:2:108230)
2020-12-08T03:54:46.5896438Z在constructor.emitEvent(D:\a\\ u tasks\CloudFormationCreateOrUpdateStack\u 7ef7cdfa-aa45-42c5-93c8-d7603643dd99\1.8.0\CloudFormationCreateOrUpdateStack.js:2:183886)
2020-12-08T03:54:46.5897267Z位于constructor.e(D:\a\\ u tasks\CloudFormationCreateOrUpdateStack\u 7ef7cdfa-aa45-42c5-93c8-d7603643dd99\1.8.0\CloudFormationCreateOrUpdateStack.js:2:179393)
2020-12-08T03:54:46.5898003Z在r.runTo(D:\a\\ u tasks\CloudFormationCreateOrUpdateStack\u 7ef7cdfa-aa45-42c5-93c8-d7603643dd99\1.8.0\CloudFormationCreateOrUpdateStack.js:2:185728)
2020-12-08T03:54:46.5898720Z位于D:\a\\ u tasks\CloudFormationCreateOrUpdateStack\u 7ef7cdfa-aa45-42c5-93c8-d7603643dd99\1.8.0\CloudFormationCreateOrUpdateStack.js:2:185934
2020-12-08T03:54:46.5899455Z在构造函数处。(D:\a\\u tasks\CloudFormationCreateOrUpdateStack\u 7ef7cdfa-aa45-42c5-93c8-d7603643dd99\1.8.0\CloudFormationCreateOrUpdateStack.js:2:179663)
2020-12-08T03:54:46.5900239Z在构造函数处。(D:\a\\u tasks\CloudFormationCreateOrUpdateStack\u 7ef7cdfa-aa45-42c5-93c8-d7603643dd99\1.8.0\CloudFormationCreateOrUpdateStack.js:2:183942)
2020-12-08T03:54:46.5901203Z位于constructor.callListeners(D:\a\\ u tasks\CloudFormationCreateOrUpdateStack\u 7ef7cdfa-aa45-42c5-93c8-d7603643dd99\1.8.0\CloudFormationCreateOrUpdateStack.js:2:108626)
2020-12-08T03:54:46.5901689Z消息:未定义,
2020-12-08T03:54:46.5902055Z代码:“内部故障”,
2020-12-08T03:54:46.5902486Z时间:2020-12-08T03:54:46.559Z,
2020-12-08T03:54:46.5903062Z请求ID:'26a7ef25-1e18-4e00-8721-fd07bbd90a53',
2020-12-08T03:54:46.5903486Z状态代码:500,
2020-12-08T03:54:46.5903851Z可检索:真)
2020-12-08T03:54:46.5962341Z###[错误]内部故障
2020-12-08T03:54:46.6025994Z###[部分]完成:创建/更新堆栈:S2CSalesOrderStack

您可以通过以下步骤对问题进行故障排除:

首先检查用于创建AWS凭据的AWS帐户是否具有
cloudformation:DescribeCacks
cloudformation:DescribeCackEvents权限。如果使用IAM角色创建AWS凭据服务连接。您需要确保已将上述权限分配给角色。看

确保您选择了正确的AWS地区。因为云的形成是区域性的

手动删除已存在的堆栈,或使用AWS CloudFormation删除堆栈 创建前删除堆栈的任务。有关信息,请参见下面的线程


这是YAML模板本身的多个小语法错误,例如Ref参数的使用方式。不幸的是,错误消息并没有真正帮助发现这是一个问题,此外,SAM CLI validate命令确认模板有效

尽管如此,现在有了一个固定且有效的无服务器YAML模板,管道仍在运行