Random errors on lambda alias [INVALID_LAMBDA_CONFIGURATION]

0

Hi,

I have a codepipeline that handles the following stages to deploy an API GW and relative lambdas:

  1. CodeCommit
  2. CodeBuild
  3. CloudFormation

Deployment at a single Lambda Alias update fails, but the lambda function that has the alias is different each time, even if no change happens in the repository and in the deployed objects.

The single codedeploy failing alway reports the following error:

Deployment Failed
The deployment failed because the AppSpec file that specifies the AWS Lambda deployment configuration is missing or has an invalid configuration. The Lambda function alias version does not match the current version in AppSpec file. (Error code: INVALID_LAMBDA_CONFIGURATION)

Deployment configuration
CodeDeployDefault.LambdaAllAtOnce

If cloudformation stack is deleted and created anew deployment works.

mcm
질문됨 6년 전1200회 조회
4개 답변
0

After a couple of good rounds with successful deployment, it chocked on "A conflicting deployment is in progress" reported in CloudFormation console always regarding Alias deployment.

CloudFormation is now trying to rollback, but it is taking a very long time to do so, while it deals with "Already chained. Call unchain() to get rid of the previous chaining." on unrelated Aliases.

N.B. Aliases are defined by SAM as following:

AWSTemplateFormatVersion: '2010-09-09'
Globals:
  Function:
    AutoPublishAlias:
      Ref: Stage
    DeploymentPreference:
      Type: AllAtOnce
    Environment:
      Variables:
        STAGE:
          Ref: Stage
mcm
답변함 6년 전
0

Now after the last failed update and UPDATE_ROLLBACK of CloudFormation changeset , CodeDeploy started failing with INVALID_LAMBDA_CONFIGURATION again on some random alias.

Is there anything that has to be done to avoid having to delete and recreate the whole stack?

mcm
답변함 6년 전
0

It definitely looks like there is some issue with the way the lambda function has been set up. Codedeploy will throw this particular error message when it receives validation errors from AWS Lambda, however it is difficult for Codedeploy to figure out the exact issue with the lambda function. Are you able to test your lambda function directly using Lambda cli?

답변함 6년 전
0

Hi deblinaataws,

First let me inform you that, since my last post, it has been working correctly for a month by now.
This stack (with a nested stack also) comprises more that 35 lambda functions and many other details related to api gateway endpoints, it did not fail on any specific lambda function in the stack but on a different one each time, at random. Those exact functions were unmodified from previous runs where they gave no issues.
Mind that this CD is done all automatically by a codepipeline in what I expect to be a predictable sequence.
Of course on Lambda CLI no error shown, the lambdas are very simple nodejs and python functions.

The good thing is that after a couple of days of repeated random errors the problems just vanished all the sudden and everything works fine now, without any apparent reason (including code modifications or SAM template changes).

Thanks
mcm

mcm
답변함 6년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠