question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Lambda fails to deploy when provisoned_executions > 0

See original GitHub issue

This code fails to deploy with:

Provisioned Concurrency configuration failed to be applied. 
Reason: FUNCTION_ERROR_INIT_FAILURE

However, if I change provisioned_executions from 10 to 0, it deploys correctly.

    def addValidationFunction(self):
        
        self.validationDlq = Queue(self, 'validationDLQ')
        
        curTime = round(time.time())
        
        fnName = "IssFn{}".format(curTime)
        
        self.validationFunction = Function(self, fnName,
            runtime=Runtime.PYTHON_3_6,
            code=Code.asset('lambda/issuer'),
            handler='validation_function.lambda_handler',
            timeout=core.Duration.seconds(900),
            layers=[self.depLayer],
            dead_letter_queue=self.validationDlq
        )
        
        verName = "IssFnVer{}".format(curTime)
        
        self.validationVersion = self.validationFunction.add_version(name=verName, provisioned_executions=10)
        
        lambdaPolicy = PolicyStatement()
        lambdaPolicy.add_all_resources()
        lambdaPolicy.add_actions("secretsmanager:GetSecretValue")
        self.validationFunction.add_to_role_policy(lambdaPolicy)
        
        StringParameter(self, "issuerValidationFunctionArn",
             parameter_name="ISSUER_VALIDATION_FN_ARN",
             string_value=self.validationVersion.function_arn,
             simple_name=True
        )

Environment

  • CLI Version :
  • Framework Version: CDK 1.20.0
  • OS : OSX
  • Language : Python

Other


This is 🐛 Bug Report

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
netroycommented, Jan 31, 2020

@sblackstone this issue doesn’t seem specific to CDK. it’s likely that you’d see the same error working with cloudformation directly.

When you pre-provision a lambda, it is bootstrapped in the same call that creates the cloudformation resource. if the bootstrapping either fails or times out, FUNCTION_ERROR_INIT_FAILURE is thrown.

So, the question is, why is this code failing to initialize in a timely manner. Can you try some other code in this lambda, or perhaps a stripped-down version of your current code?

0reactions
SomayaBcommented, Feb 21, 2020

Closing this issue since there hasn’t been a response in a while. Feel free to reopen.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot deployment issues in Lambda
Deployment errors prevent the new version from being used and can arise from issues with your deployment package, code, permissions, or tools.
Read more >
CloudFormation stack fails to deploy due to Resource of type ...
I'm deploying a CloudFromation stack via CDK, and it fails to deploy due to lambdas failing to stabilize.
Read more >
When Lambda deployments aren't zero-downtime (and how to ...
In this case, for some period of time, the function will be called with an incompatible combination of code and configuration, and the...
Read more >
terraform-aws-modules/lambda/aws
Note that this module does not copy prebuilt packages into S3 bucket. ... Make sure, you deploy Lambda@Edge functions into US East (N....
Read more >
AWS Lambda Guide - Serverless.yml Reference
'warn' reports deprecations on the go, 'error' will result with an ... the S3 bucket used by Serverless Framework to deploy code packages...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found