Broken deployment with 1.10
perrin4869 opened this issue · 13 comments
serverless deploy
on the new version 1.10
results in Error: The CloudFormation template is invalid: Unresolved resource dependencies [FormsDashgetLambdaVersionjmhPCOJ9bV7swCtnlSRyVQmMO3sZaVSjCYh0FUxhl8] in the Outputs block of the template
for me, didn't dig yet into which commit broke this though, but thought I'd report this now
Hello, have you solved it? I had the same problem
1.9.3 version does not have this issue.
Temporary you can revert back to that version.
Same problem here, reverting back to 1.9.3 fixed my problem.
Can anyone supply a reproducuble example? I'll deprecate but I'd like to fix
@dougmoscrop Not a reproducuble example (my project is huge), but maybe this will help:
Error: The CloudFormation template is invalid: Template format error: Unresolved resource dependencies [ApiGatewayResourceGluePartitions] in the Resources block of the template
I've been looking for differences in compiled-cloudformation-template.json
to see what's wrong.
In template generated by 1.9.3 version (which doesn't throw ValidationError) there's
"ApiGatewayResourceGluePartitionsMeta": {
"Type": "AWS::ApiGateway::Resource",
"Properties": {
"ParentId": {
"Ref": "ApiGatewayResourceGluePartitions"
},
"PathPart": "meta",
"RestApiId": {
"Ref": "ApiGatewayRestApi"
}
},
"DependsOn": [
"APINestedStack"
]
}
while in template generated by 1.10 (which throws ValidationError) there's
"ApiGatewayResourceGluePartitionsMeta": {
"Type": "AWS::ApiGateway::Resource",
"Properties": {
"ParentId": {
"Fn::GetAtt": [
"APINestedStack",
"Outputs.ApiGatewayResourceGluePartitions"
]
},
"PathPart": "meta",
"RestApiId": {
"Ref": "ApiGatewayRestApi"
}
},
"DependsOn": [
"APINestedStack"
]
}
I am encountering the same issue and noticed that ApiGatewayRestApi
was ApiGatewayRestApiParameter
when passed to the stack.
Looks like Lambda Function resources are present in the cloudformation-template-X-nested-stack.json
files, but are absent in the compiled-cloudformation-template.json
. This started happening very recently.
In my case, the difference seems to be in the cloudformation-template-update-stack
- the Outputs
section is different between 1.9.3
and 1.10.0
:
// 1.10.0
{
"Outputs": {
"FormsDashgetLambdaFunctionQualifiedArn": {
"Description": "Current Lambda function version",
"Value": {
"Ref": "FormsDashgetLambdaVersionegEfKwLTnvplxeY6U8F6DNUygmSYNDoejB7UuDc"
}
}
}
}
// 1.9.3
{
"Outputs": {
"FormsDashgetLambdaFunctionQualifiedArn": {
"Description": "Current Lambda function version",
"Value": {
"Fn::GetAtt": [
"FormsDashgetNestedStack",
"Outputs.FormsDashgetLambdaVersion7bpdMmFFUixDbq3vIkBtcD1SLoj7rgy9UXvgy8DJrU"
]
}
}
}
}
I will dig into the cause for this change!
Edit:
I am using perFunction: true
@dougmoscrop actually, the integration tests fails in this exact fashion, these would be a reproducible example:
❯ npm run integration-test
> serverless-plugin-split-stacks@1.10.0 integration-test /home/perrin4869/univapay/serverless-plugin-split-stacks
> node __tests__/_integration.js
Serverless: Deprecation warning: Starting with next major version, default value of provider.lambdaHashingVersion will be equal to "20201221"
More Info: https://www.serverless.com/framework/docs/deprecations/#LAMBDA_HASHING_VERSION_V2
Serverless: Deprecation warning: Starting with next major version, API Gateway naming will be changed from "{stage}-{service}" to "{service}-{stage}".
Set "provider.apiGateway.shouldStartNameWithService" to "true" to adapt to the new behavior now.
More Info: https://www.serverless.com/framework/docs/deprecations/#AWS_API_GATEWAY_NAME_STARTING_WITH_SERVICE
Serverless: Packaging service...
Serverless: Excluding development dependencies...
Serverless: [serverless-plugin-split-stacks]: Summary: 26 resources migrated in to 5 nested stacks
Serverless: [serverless-plugin-split-stacks]: Resources per stack:
Serverless: [serverless-plugin-split-stacks]: - (root): 10
Serverless: [serverless-plugin-split-stacks]: - ANestedStack: 10
Serverless: [serverless-plugin-split-stacks]: - BNestedStack: 6
Serverless: [serverless-plugin-split-stacks]: - CNestedStack: 7
Serverless: [serverless-plugin-split-stacks]: - PermissionsNestedStack: 2
Serverless: [serverless-plugin-split-stacks]: - PoliciesNestedStack: 1
Serverless: Creating Stack...
Serverless: Checking Stack create progress...
........
Serverless: Stack create finished...
Serverless: Uploading CloudFormation file to S3...
Serverless: Uploading artifacts...
Serverless: Uploading service split-stack-test.zip file to S3 (2.99 KB)...
Serverless: Validating template...
Test failed: Error: The CloudFormation template is invalid: Template error: instance of Fn::GetAtt references undefined resource BLambdaFunction
at /home/perrin4869/univapay/serverless-plugin-split-stacks/node_modules/serverless/lib/plugins/aws/deploy/lib/validateTemplate.js:20:13
at tryCatcher (/home/perrin4869/univapay/serverless-plugin-split-stacks/node_modules/serverless/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/home/perrin4869/univapay/serverless-plugin-split-stacks/node_modules/serverless/node_modules/bluebird/js/release/promise.js:547:31)
at Promise._settlePromise (/home/perrin4869/univapay/serverless-plugin-split-stacks/node_modules/serverless/node_modules/bluebird/js/release/promise.js:604:18)
at Promise._settlePromise0 (/home/perrin4869/univapay/serverless-plugin-split-stacks/node_modules/serverless/node_modules/bluebird/js/release/promise.js:649:10)
at Promise._settlePromises (/home/perrin4869/univapay/serverless-plugin-split-stacks/node_modules/serverless/node_modules/bluebird/js/release/promise.js:725:18)
at _drainQueueStep (/home/perrin4869/univapay/serverless-plugin-split-stacks/node_modules/serverless/node_modules/bluebird/js/release/async.js:93:12)
at _drainQueue (/home/perrin4869/univapay/serverless-plugin-split-stacks/node_modules/serverless/node_modules/bluebird/js/release/async.js:86:9)
at Async._drainQueues (/home/perrin4869/univapay/serverless-plugin-split-stacks/node_modules/serverless/node_modules/bluebird/js/release/async.js:102:5)
at Immediate.Async.drainQueues [as _onImmediate] (/home/perrin4869/univapay/serverless-plugin-split-stacks/node_modules/serverless/node_modules/bluebird/js/release/async.js:15:14)
at processImmediate (internal/timers.js:458:21) undefined
Serverless: Getting all objects in S3 bucket...
Serverless: Removing objects in S3 bucket...
Serverless: Removing Stack...
Serverless: Checking Stack delete progress...
Serverless: Stack delete finished...
Serverless: Stack delete finished...
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! serverless-plugin-split-stacks@1.10.0 integration-test: `node __tests__/_integration.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the serverless-plugin-split-stacks@1.10.0 integration-test script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/perrin4869/.npm/_logs/2021-01-10T19_08_03_365Z-debug.log
it runs correctly in 1.9.3
(well, other than node 8.x not being supported in AWS that is):
❯ git checkout v1.9.3
❯ npm ci
❯ npm run integration-test
> serverless-plugin-split-stacks@1.9.3 integration-test /home/perrin4869/univapay/serverless-plugin-split-stacks
> node __tests__/_integration.js
Serverless: Packaging service...
Serverless: Excluding development dependencies...
Serverless: [serverless-plugin-split-stacks]: Summary: 15 resources migrated in to 4 nested stacks
Serverless: [serverless-plugin-split-stacks]: Resources per stack:
Serverless: [serverless-plugin-split-stacks]: - (root): 18
Serverless: [serverless-plugin-split-stacks]: - APINestedStack: 1
Serverless: [serverless-plugin-split-stacks]: - AlarmsNestedStack: 6
Serverless: [serverless-plugin-split-stacks]: - PermissionsNestedStack: 5
Serverless: [serverless-plugin-split-stacks]: - VersionsNestedStack: 3
Serverless: Creating Stack...
Serverless: Checking Stack create progress...
.....
Serverless: Stack create finished...
Serverless: Uploading CloudFormation file to S3...
Serverless: Uploading artifacts...
Serverless: Uploading service split-stack-test.zip file to S3 (2.99 KB)...
Serverless: Validating template...
Serverless: Updating Stack...
Serverless: Checking Stack update progress...
............................
Serverless: Operation failed!
Serverless: View the full error output: https://us-east-1.console.aws.amazon.com/cloudformation/home?region=us-east-1#/stack/detail?stackId=arn%3Aaws%3Acloudformation%3Aus-east-1%3A247805970927%3Astack%2Fsplit-stack-test-dev%2Fb687d160-5377-11eb-826a-12be65336f97
Test failed: ServerlessError: An error occurred: CLambdaFunction - The runtime parameter of nodejs8.10 is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (nodejs12.x) while creating or updating functions. (Service: AWSLambdaInternal; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: 58d1416e-8152-40a3-a0e6-5b980783e690; Proxy: null).
at /home/perrin4869/univapay/serverless-plugin-split-stacks/node_modules/serverless/lib/plugins/aws/lib/monitorStack.js:121:33
at tryCatcher (/home/perrin4869/univapay/serverless-plugin-split-stacks/node_modules/serverless/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/home/perrin4869/univapay/serverless-plugin-split-stacks/node_modules/serverless/node_modules/bluebird/js/release/promise.js:517:31)
at Promise._settlePromise (/home/perrin4869/univapay/serverless-plugin-split-stacks/node_modules/serverless/node_modules/bluebird/js/release/promise.js:574:18)
at Promise._settlePromise0 (/home/perrin4869/univapay/serverless-plugin-split-stacks/node_modules/serverless/node_modules/bluebird/js/release/promise.js:619:10)
at Promise._settlePromises (/home/perrin4869/univapay/serverless-plugin-split-stacks/node_modules/serverless/node_modules/bluebird/js/release/promise.js:699:18)
at _drainQueueStep (/home/perrin4869/univapay/serverless-plugin-split-stacks/node_modules/serverless/node_modules/bluebird/js/release/async.js:138:12)
at _drainQueue (/home/perrin4869/univapay/serverless-plugin-split-stacks/node_modules/serverless/node_modules/bluebird/js/release/async.js:131:9)
at Async._drainQueues (/home/perrin4869/univapay/serverless-plugin-split-stacks/node_modules/serverless/node_modules/bluebird/js/release/async.js:147:5)
at Immediate.Async.drainQueues [as _onImmediate] (/home/perrin4869/univapay/serverless-plugin-split-stacks/node_modules/serverless/node_modules/bluebird/js/release/async.js:17:14)
at processImmediate (internal/timers.js:458:21) {
statusCode: undefined
} undefined
Serverless: Getting all objects in S3 bucket...
Serverless: Removing objects in S3 bucket...
Serverless: Removing Stack...
Unhandled rejection ServerlessError: Stack [arn:aws:cloudformation:us-east-1:247805970927:stack/split-stack-test-dev/b687d160-5377-11eb-826a-12be65336f97] cannot be deleted while in status UPDATE_ROLLBACK_IN_PROGRESS
at /home/perrin4869/univapay/serverless-plugin-split-stacks/node_modules/serverless/lib/plugins/aws/provider/awsProvider.js:316:27
at processTicksAndRejections (internal/process/task_queues.js:93:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! serverless-plugin-split-stacks@1.9.3 integration-test: `node __tests__/_integration.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the serverless-plugin-split-stacks@1.9.3 integration-test script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/perrin4869/.npm/_logs/2021-01-10T19_12_43_003Z-debug.log
~/un/serverless-plugin-split-stacks on #v1.9.3
Ffffff yeah I should have ran the integration tests. I don't really have time to fix whatever is wrong these days.
Actually it may be time (or long overdue) to talk about turning all these plugins in to an organization. Is anybody interested in that?
I tried figuring out the root cause, but would need more time to figure out how the codebase works... I'm also busy right now, can't dedicate the time to it, sorry ><;;
Probably the best for now is to revert #107 and try to find a fix that doesn't break the integration tests.
Can anyone supply a reproducible example? I'll deprecate but I'd like to fix
I didn't change anything but update the version of the plugin. This is the error I was facing
ServerlessError: An error occurred: 5NestedStack - Template error: instance of Fn::GetAtt references undefined resource
Ffffff yeah I should have ran the integration tests. I don't really have time to fix whatever is wrong these days.
Actually it may be time (or long overdue) to talk about turning all these plugins in to an organization. Is anybody interested in that?
Well, if you don't have time to fix this... than yes.