Skip to content

Deploy fails when versionFunctions is switched from false to true. Attempts to publish version for ALL functions instead of modified one. #6349

Open

Description

@sciencey-sanjay

This is a Bug Report

Description

  • What went wrong?
    Deploy failed when I updated versionFunctions to true from false under providers in serverless.yml. Serverless expects that all functions(including the one with code changes) in serverless.yml should have function code or function configuration related changes.
    This error came on third deploy.
    First Deploy - versionFunctions = true and code version = 1.0.3 Deployment status = OK
    Second Deploy versionFunctions = false and code version =1.0.4 Deployment status = OK
    Third Deploy versionFunctions = true and code version =1.0.5 Deployment status = FAILED

- What did you expect should have happened?
One Lambda function(getCustomer) should have published a newer version and a successful deploy.

  • What was the config you used?
provider:
  name: aws
  deploymentBucket: serverless-applicationpipeline
  runtime: nodejs8.10
# you can overwrite defaults here
  stage: ${opt:stage}
  region: us-east-1
  role: arn:aws:iam::xxxxxxxxx:role/service-role/xxxxxxxxx
  logs:
    restApi: true
  versionFunctions: true

- What stacktrace or error message from your provider did you see?
Serverless: [AWS cloudformation 200 1.628s 0 retries] describeStackEvents({ StackName: 'arn:aws:cloudformation:us-east-1:xxxxxxxxx:stack/quickreorder-testversion12/3020fc60-a1ed-11e9-8dd5-0afcd132dcac' }) CloudFormation - UPDATE_IN_PROGRESS - AWS::CloudFormation::Stack - quickreorder-testversion12 CloudFormation - UPDATE_IN_PROGRESS - AWS::Lambda::Function - GetOrderLambdaFunction CloudFormation - UPDATE_IN_PROGRESS - AWS::Lambda::Function - UpdateCustomerLambdaFunction CloudFormation - UPDATE_IN_PROGRESS - AWS::Lambda::Function - CreateCustomerLambdaFunction CloudFormation - UPDATE_IN_PROGRESS - AWS::Lambda::Function - GetCustomerLambdaFunction CloudFormation - UPDATE_COMPLETE - AWS::Lambda::Function - GetOrderLambdaFunction CloudFormation - UPDATE_COMPLETE - AWS::Lambda::Function - UpdateCustomerLambdaFunction CloudFormation - UPDATE_COMPLETE - AWS::Lambda::Function - CreateCustomerLambdaFunction CloudFormation - UPDATE_COMPLETE - AWS::Lambda::Function - GetCustomerLambdaFunction Serverless: [AWS cloudformation 200 1.722s 0 retries] describeStackEvents({ StackName: 'arn:aws:cloudformation:us-east-1:xxxxxxxxx:stack/quickreorder-testversion12/3020fc60-a1ed-11e9-8dd5-0afcd132dcac' }) CloudFormation - CREATE_IN_PROGRESS - AWS::Lambda::Version - GetCustomerLambdaVersionKclQb0utzLNkJLlePGX75r8JcreaTnArdga3isSsAc CloudFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::Deployment - ApiGatewayDeployment1562637848333 CloudFormation - CREATE_IN_PROGRESS - AWS::Lambda::Version - CreateCustomerLambdaVersionFWzSOWgeProNVwi14kOTQlFcpOqmadgUh9AULJkL2o CloudFormation - CREATE_IN_PROGRESS - AWS::Lambda::Version - GetOrderLambdaVersionIkZ1QX2GGsuNeslKiCElhwvGowbLXJWZPJp61EWK4 CloudFormation - CREATE_FAILED - AWS::Lambda::Version - CreateCustomerLambdaVersionFWzSOWgeProNVwi14kOTQlFcpOqmadgUh9AULJkL2o CloudFormation - CREATE_IN_PROGRESS - AWS::Lambda::Version - UpdateCustomerLambdaVersionUtKhim1BM6nLt0JqksJ4zZIwfvPeh6Wg6S94zzRI CloudFormation - CREATE_IN_PROGRESS - AWS::Lambda::Version - GetCustomerLambdaVersionKclQb0utzLNkJLlePGX75r8JcreaTnArdga3isSsAc CloudFormation - CREATE_FAILED - AWS::Lambda::Version - GetOrderLambdaVersionIkZ1QX2GGsuNeslKiCElhwvGowbLXJWZPJp61EWK4 CloudFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::Deployment - ApiGatewayDeployment1562637848333 CloudFormation - CREATE_COMPLETE - AWS::Lambda::Version - GetCustomerLambdaVersionKclQb0utzLNkJLlePGX75r8JcreaTnArdga3isSsAc CloudFormation - CREATE_COMPLETE - AWS::ApiGateway::Deployment - ApiGatewayDeployment1562637848333 CloudFormation - CREATE_FAILED - AWS::Lambda::Version - UpdateCustomerLambdaVersionUtKhim1BM6nLt0JqksJ4zZIwfvPeh6Wg6S94zzRI CloudFormation - UPDATE_ROLLBACK_IN_PROGRESS - AWS::CloudFormation::Stack - quickreorder-testversion12 Serverless: [AWS cloudformation 200 1.32s 0 retries] describeStackEvents({ StackName: 'arn:aws:cloudformation:us-east-1:xxxxxxxxx:stack/quickreorder-testversion12/3020fc60-a1ed-11e9-8dd5-0afcd132dcac' }) Serverless: [AWS cloudformation 200 2.305s 0 retries] describeStackEvents({ StackName: 'arn:aws:cloudformation:us-east-1:xxxxxxxx:stack/quickreorder-testversion12/3020fc60-a1ed-11e9-8dd5-0afcd132dcac' }) Serverless: [AWS cloudformation 200 2.288s 0 retries] describeStackEvents({ StackName: 'arn:aws:cloudformation:us-east-1:xxxxxxxxx:stack/quickreorder-testversion12/3020fc60-a1ed-11e9-8dd5-0afcd132dcac' }) CloudFormation - UPDATE_IN_PROGRESS - AWS::Lambda::Function - GetCustomerLambdaFunction CloudFormation - UPDATE_IN_PROGRESS - AWS::Lambda::Function - UpdateCustomerLambdaFunction CloudFormation - UPDATE_IN_PROGRESS - AWS::Lambda::Function - CreateCustomerLambdaFunction CloudFormation - UPDATE_IN_PROGRESS - AWS::Lambda::Function - GetOrderLambdaFunction CloudFormation - UPDATE_COMPLETE - AWS::Lambda::Function - UpdateCustomerLambdaFunction CloudFormation - UPDATE_COMPLETE - AWS::Lambda::Function - GetCustomerLambdaFunction CloudFormation - UPDATE_COMPLETE - AWS::Lambda::Function - CreateCustomerLambdaFunction CloudFormation - UPDATE_COMPLETE - AWS::Lambda::Function - GetOrderLambdaFunction Serverless: [AWS cloudformation 200 1.175s 0 retries] describeStackEvents({ StackName: 'arn:aws:cloudformation:us-east-1:xxxxxxxxxxxxxx:stack/quickreorder-testversion12/3020fc60-a1ed-11e9-8dd5-0afcd132dcac' }) CloudFormation - UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS - AWS::CloudFormation::Stack - quickreorder-testversion12 CloudFormation - DELETE_IN_PROGRESS - AWS::ApiGateway::Deployment - ApiGatewayDeployment1562637848333 CloudFormation - DELETE_SKIPPED - AWS::Lambda::Version - GetOrderLambdaVersionIkZ1QX2GGsuNeslKiCElhwvGowbLXJWZPJp61EWK4 CloudFormation - DELETE_SKIPPED - AWS::Lambda::Version - CreateCustomerLambdaVersionFWzSOWgeProNVwi14kOTQlFcpOqmadgUh9AULJkL2o CloudFormation - DELETE_SKIPPED - AWS::Lambda::Version - UpdateCustomerLambdaVersionUtKhim1BM6nLt0JqksJ4zZIwfvPeh6Wg6S94zzRI CloudFormation - DELETE_SKIPPED - AWS::Lambda::Version - GetCustomerLambdaVersionKclQb0utzLNkJLlePGX75r8JcreaTnArdga3isSsAc CloudFormation - DELETE_COMPLETE - AWS::ApiGateway::Deployment - ApiGatewayDeployment1562637848333 CloudFormation - UPDATE_ROLLBACK_COMPLETE - AWS::CloudFormation::Stack - quickreorder-testversion12 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%3Acloud formation%3Aus-east-1%3Axxxxxxxxxxxxx%3Astack%2Fquickreorder-testversion12%2F3020fc60-a1ed-11e9-8dd5-0afcd132dcac Serverless Error --------------------------------------- An error occurred: CreateCustomerLambdaVersionFWzSOWgeProNVwi14kOTQlFcpOqmadgUh9AULJkL2o - A version for this Lambda function exists ( 1 ). Modify the func tion to create a new version.. Stack Trace -------------------------------------------- ServerlessError: An error occurred: CreateCustomerLambdaVersionFWzSOWgeProNVwi14kOTQlFcpOqmadgUh9AULJkL2o - A version for this Lambda function exists ( 1 ). Modify the function to create a new version.. at provider.request.then (/usr/local/lib/nodejs/node-v10.15.3-linux-x64/lib/node_modules/serverless/lib/plugins/aws/lib/monitorStack.js:118:33) From previous event: at AwsDeploy.monitorStack (/usr/local/lib/nodejs/node-v10.15.3-linux-x64/lib/node_modules/serverless/lib/plugins/aws/lib/monitorStack.js:31:12) at provider.request.then (/usr/local/lib/nodejs/node-v10.15.3-linux-x64/lib/node_modules/serverless/lib/plugins/aws/lib/updateStack.js:105:30) From previous event: at AwsDeploy.update (/usr/local/lib/nodejs/node-v10.15.3-linux-x64/lib/node_modules/serverless/lib/plugins/aws/lib/updateStack.js:105:8) From previous event: at AwsDeploy.BbPromise.bind.then (/usr/local/lib/nodejs/node-v10.15.3-linux-x64/lib/node_modules/serverless/lib/plugins/aws/lib/updateStack.js:122:12) From previous event: at AwsDeploy.updateStack (/usr/local/lib/nodejs/node-v10.15.3-linux-x64/lib/node_modules/serverless/lib/plugins/aws/lib/updateStack.js:116:8) From previous event: at AwsDeploy.BbPromise.bind.then (/usr/local/lib/nodejs/node-v10.15.3-linux-x64/lib/node_modules/serverless/lib/plugins/aws/deploy/index.js:127:39) From previous event: at Object.aws:deploy:deploy:updateStack [as hook] (/usr/local/lib/nodejs/node-v10.15.3-linux-x64/lib/node_modules/serverless/lib/plugins/aws/deploy/index .js:123:10) at BbPromise.reduce (/usr/local/lib/nodejs/node-v10.15.3-linux-x64/lib/node_modules/serverless/lib/classes/PluginManager.js:408:55) From previous event: at PluginManager.invoke (/usr/local/lib/nodejs/node-v10.15.3-linux-x64/lib/node_modules/serverless/lib/classes/PluginManager.js:408:22) at PluginManager.spawn (/usr/local/lib/nodejs/node-v10.15.3-linux-x64/lib/node_modules/serverless/lib/classes/PluginManager.js:426:17) at AwsDeploy.BbPromise.bind.then (/usr/local/lib/nodejs/node-v10.15.3-linux-x64/lib/node_modules/serverless/lib/plugins/aws/deploy/index.js:93:48) From previous event: at Object.deploy:deploy [as hook] (/usr/local/lib/nodejs/node-v10.15.3-linux-x64/lib/node_modules/serverless/lib/plugins/aws/deploy/index.js:89:10) at BbPromise.reduce (/usr/local/lib/nodejs/node-v10.15.3-linux-x64/lib/node_modules/serverless/lib/classes/PluginManager.js:408:55) From previous event: at PluginManager.invoke (/usr/local/lib/nodejs/node-v10.15.3-linux-x64/lib/node_modules/serverless/lib/classes/PluginManager.js:408:22) at PluginManager.run (/usr/local/lib/nodejs/node-v10.15.3-linux-x64/lib/node_modules/serverless/lib/classes/PluginManager.js:439:17) at variables.populateService.then (/usr/local/lib/nodejs/node-v10.15.3-linux-x64/lib/node_modules/serverless/lib/Serverless.js:109:33) at runCallback (timers.js:705:18) at tryOnImmediate (timers.js:676:5) at processImmediate (timers.js:658:5) at process.topLevelDomainCallback (domain.js:120:23) From previous event: at Serverless.run (/usr/local/lib/nodejs/node-v10.15.3-linux-x64/lib/node_modules/serverless/lib/Serverless.js:96:6) at serverless.init.then (/usr/local/lib/nodejs/node-v10.15.3-linux-x64/lib/node_modules/serverless/bin/serverless:43:28) at /usr/local/lib/nodejs/node-v10.15.3-linux-x64/lib/node_modules/serverless/node_modules/graceful-fs/graceful-fs.js:111:16 at /usr/local/lib/nodejs/node-v10.15.3-linux-x64/lib/node_modules/serverless/node_modules/graceful-fs/graceful-fs.js:45:10 at FSReqWrap.args [as oncomplete] (fs.js:140:20) From previous event: at initializeErrorReporter.then (/usr/local/lib/nodejs/node-v10.15.3-linux-x64/lib/node_modules/serverless/bin/serverless:43:6) at runCallback (timers.js:705:18) at tryOnImmediate (timers.js:676:5) at processImmediate (timers.js:658:5) at process.topLevelDomainCallback (domain.js:120:23) From previous event: at /usr/local/lib/nodejs/node-v10.15.3-linux-x64/lib/node_modules/serverless/bin/serverless:28:46 at Object. (/usr/local/lib/nodejs/node-v10.15.3-linux-x64/lib/node_modules/serverless/bin/serverless:65:4) at Module._compile (internal/modules/cjs/loader.js:701:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10) at Module.load (internal/modules/cjs/loader.js:600:32) at tryModuleLoad (internal/modules/cjs/loader.js:539:12) at Function.Module._load (internal/modules/cjs/loader.js:531:3) at Function.Module.runMain (internal/modules/cjs/loader.js:754:12) at startup (internal/bootstrap/node.js:283:19) at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3) Get Support -------------------------------------------- Docs: docs.serverless.com Bugs: github.com/serverless/serverless/issues Issues: forum.serverless.com Your Environment Information --------------------------- OS: linux Node Version: 10.15.3 Serverless Version: 1.41.1 --
Similar or dependent issues:

Additional Data

Activity

  1. changed the title [-]Deploy fails when versionFunctions is switched from false to true. Attempts to publish version for functions instead of one.[/-] [+]Deploy fails when versionFunctions is switched from false to true. Attempts to publish version for ALL functions instead of modified one.[/+] on Jul 9, 2019
  2. azizur commented on Sep 27, 2020

    @azizur

    Any update on this? I am still getting A version for this Lambda function exists ( XXX ). Modify the function to create a new version..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions