serverless: Deploy Error: IamPolicyLambdaExecution - LogGroup doesn't exist
This is a Bug Report
Description
-
What went wrong? After updating to v1.1.0, adding
cfLogs: trueto my config, and deleting my existing CloudWatch log groups as instructed by the CLI, I can no longer deploy my functions. -
What did you expect should have happened? Functions should deploy and log groups should be recreated.
-
What was the config you used?
frameworkVersion: 1.1.0
service: my-service-name
provider:
name: aws
cfLogs: true
runtime: nodejs4.3
iamRoleStatements:
- Effect: "Allow"
Action:
- "dynamodb:GetRecords"
- "dynamodb:GetItem"
- "dynamodb:Query"
- "dynamodb:Scan"
Resource:
- "*"
# ...
- What stacktrace or error message from your provider did you see?
An error occurred while provisioning your stack: IamPolicyLambdaExecution
- Template error: LogGroup /aws/lambda/my-service-name-dev-functionName
doesn't exist.
Additional Data
- Serverless Framework Version you’re using: v1.1.0
- Operating System: OSX
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 25
- Comments: 41 (8 by maintainers)
@big-kahuna-burger This is a CloudFormation level bug, confirmed with AWS support (they were able to reproduce it).
The only quick fix besides what you did with provider level role is to rename your functions so no function is a prefix of another function.
Here’s what I’ve distilled it down to: https://github.com/geoffdutton/serverless-loggroup-test
It works if you use the same prefix, but as long as there more to it i.e.
someFunctionandsomeFunctionAgainwill cause this, butsomeFunctionandsomeOtherFunctionwill not cause it.I’ve also checked that the log group get’s created, and it does.
So weird…
Edit: I also tried with 20 functions, and it’s come down to the prefix issue.
@shortjared Can you post the AWS thread so people can complain to AWS instead of complaining here?
Still occurring:
Hi,
I tested just now with the gist provided by @bsamuel-ui and it looks like the issue of similar name in LogGroup in Cloudformation has been fixed.
Thanks.
I found this forum post if you want to bug AWS about it.
Have there been any update from AWS about this?
cc @pmuens @eahefnawy
Renaming helped. Renamed like this:
Hope it does not cause any blockers in the future.
I’ve verified the claims above. My workaround for this is to change the name.
So, instead of:
I just rename one of the functions:
May have narrowed down the issue to a problem with function naming conventions. After commenting out the function definitions in my
serverless.yml, I noticed that I could successfully deploy all but 2 of the 9 functions in this service.The only thing that stands out about these two functions is that their names are a subset of two other functions in the service. E.g.:
If I remove the stage (delete the CF stack), and comment out either one of these functions, the deploy will be successful.