New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"A version for this Lambda function exists ( 8 ). Modify the function to create a new version.." even when functions have changed #8392
Comments
PS: I tried deploying my service under a different name and reducing the functions there, but that also doesn't cause any errors. |
|
@Bersaelor thanks for report. I believe the issue comes from a fact that with #8066 we fixed some discovered issues in lambda version hash generation, and it started to produce different hashes for lambda version than previously. That means, that for a same function code and configuration you'll get a different hash, and this is where AWS will complain. I didn't envision this when we were merging it. Interestingly there's just two reports for that. I believe right fix will come with solution for #8251, Otherwise a workaround on your side could be to simply modify in some way code for all the functions. Maybe you have some common util file used by all, you can tweak it's content in non-destructive manner and that'll ensure that redeployment will work, and issue should be gone. |
Thanks @medikoo , that makes a lot of sense and from reading that PR I could have come up with that by myself 😅 I changed a variable name in a file that's imported by practically all lambda code files and the error went away. |
@medikoo the same for me, everything works fine after code modification. Thanks. |
I am experiencing the same issue using EDIT: By downgrading to |
@jaska120 have you tried suggestion mentioned in this comment: #8392 (comment) ? |
@medikoo for now |
@jaska120 for me, changing one method that is imported into all my lambda functions was enough. |
Seeing the same issue, when the function code is not modified. |
@eldos-dl This is expected when upgrading to `lambdaHashingVersion: 20201221 |
@eldos-dl when adding |
I ran into this same problem after upgrading to serverless 2.72.2 |
@sjwoodr I'm not aware of any new changes that could trigger that. Still, we've prepared some solution and guide on how to tackle such errors. See: https://www.serverless.com/framework/docs/guides/upgrading-v3#lambda-hashing-algorithm |
I'm going to close this issue, as solution I've mentioned in the previous comment should help mitigate such issues, and we will definitely not introduce any changes which break version hash again |
This guide will help, thanks! |
I have a serverless.yml with 29 functions (194 resources, just under the limit).
As of a few days ago, every time I change a function and
sls deploy -s prod
, I get an error during the Cloudformationstack deployment:
This happens regardless of function changed. The error always mentions a different function than the one I had changed, since I obviously don't change every function every time. I tried it in
2.6.0
,2.5.0
,2.4.0
,2.3.0
, all with the same result.Going back to
2.2.0
it works again as before.I tried reducing my yml to a minimal version that reproduces the issue, by deploying reduced versions to my
dev
environment. Unfortunately deploying todev
seemed to always work, regardless of the amount of lambda functions.And in production environment, I can't just remove functions and deploy the reduced production list. (One should note here that in the
dev
environment, I have to remove theCandidatesDynamoDbTable
otherwise it'll complain that the table already exists, thats the only difference in the serverless.yml between posting todev
andprod
).Here's a redacted serverless.yml that reproduces the issue:
serverless.yml
sls deploy -s prod
outputServerless: Packaging service...
Serverless: Excluding development dependencies...
Serverless: Excluding development dependencies...
Serverless: Excluding development dependencies...
Serverless: Excluding development dependencies...
Serverless: Excluding development dependencies...
Serverless: Excluding development dependencies...
Serverless: Excluding development dependencies...
Serverless: Excluding development dependencies...
Serverless: Excluding development dependencies...
Serverless: Excluding development dependencies...
Serverless: Excluding development dependencies...
Serverless: Excluding development dependencies...
Serverless: Excluding development dependencies...
Serverless: Excluding development dependencies...
Serverless: Excluding development dependencies...
Serverless: Excluding development dependencies...
Serverless: Excluding development dependencies...
Serverless: Excluding development dependencies...
Serverless: Excluding development dependencies...
Serverless: Excluding development dependencies...
Serverless: Excluding development dependencies...
Serverless: Excluding development dependencies...
Serverless: Excluding development dependencies...
Serverless: Excluding development dependencies...
Serverless: Excluding development dependencies...
Serverless: Excluding development dependencies...
Serverless: Excluding development dependencies...
Serverless: Excluding development dependencies...
Serverless: Excluding development dependencies...
Serverless: Uploading CloudFormation file to S3...
Serverless: Uploading artifacts...
Serverless: Uploading service appData.zip file to S3 (6.54 KB)...
Serverless: Uploading service refresh-app-data.zip file to S3 (6.54 KB)...
Serverless: Uploading service categories.zip file to S3 (6.54 KB)...
Serverless: Uploading service cognito-verification-email.zip file to S3 (52.15 KB)...
Serverless: Uploading service create-dxf-files.zip file to S3 (628.95 KB)...
Serverless: Uploading service send-new-order-mails.zip file to S3 (52.15 KB)...
Serverless: Uploading service create-order.zip file to S3 (6.1 KB)...
Serverless: Uploading service get-order.zip file to S3 (6.1 KB)...
Serverless: Uploading service copy-orders.zip file to S3 (2.35 KB)...
Serverless: Uploading service get-orders-v2.zip file to S3 (6.1 KB)...
Serverless: Uploading service delete-device.zip file to S3 (2.83 KB)...
Serverless: Uploading service check-device.zip file to S3 (2.83 KB)...
Serverless: Uploading service get-devices.zip file to S3 (2.83 KB)...
Serverless: Uploading service users-by-brand.zip file to S3 (3.24 KB)...
Serverless: Uploading service delete-user.zip file to S3 (5.28 KB)...
Serverless: Uploading service resend-user-invite.zip file to S3 (5.28 KB)...
Serverless: Uploading service create-user.zip file to S3 (5.28 KB)...
Serverless: Uploading service my-brands.zip file to S3 (2.74 KB)...
Serverless: Uploading service create-tag.zip file to S3 (4.21 KB)...
Serverless: Uploading service tags.zip file to S3 (4.21 KB)...
Serverless: Uploading service delete-model.zip file to S3 (8.18 KB)...
Serverless: Uploading service copy-model.zip file to S3 (8.18 KB)...
Serverless: Uploading service create-model.zip file to S3 (8.18 KB)...
Serverless: Uploading service set-model-status.zip file to S3 (8.18 KB)...
Serverless: Uploading service get-model.zip file to S3 (8.18 KB)...
Serverless: Uploading service models.zip file to S3 (8.18 KB)...
Serverless: Uploading service delete-category.zip file to S3 (6.54 KB)...
Serverless: Uploading service set-category-status.zip file to S3 (6.54 KB)...
Serverless: Uploading service create-category.zip file to S3 (6.54 KB)...
Serverless: Validating template...
Serverless: Updating Stack...
Serverless: Checking Stack update progress...
........................................................................................................
Serverless: Operation failed!
Serverless: View the full error output: ***
Serverless Error ---------------------------------------
An error occurred: CopyDashordersLambdaVersionvk88Tcgtu1LRggMQjJl6aOhSHdDZS5FGb62HpriD14 - A version for this Lambda function exists ( 5 ). Modify the function to create a new version..
Get Support --------------------------------------------
Docs: docs.serverless.com
Bugs: github.com/serverless/serverless/issues
Issues: forum.serverless.com
Your Environment Information ---------------------------
Operating System: darwin
Node Version: 10.16.0
Framework Version: 2.6.0
Plugin Version: 4.0.4
SDK Version: 2.3.2
Components Version: 3.2.1
Installed version
Framework Core: 2.6.0
Plugin: 4.0.4
SDK: 2.3.2
Components: 3.2.1
The text was updated successfully, but these errors were encountered: