Repository navigation
Closed
Labels
Description
This is a Bug Report
Description
For bug reports:
- What went wrong?
After upgrading to Serverless 1.14.0, I'm now getting:
Serverless: Deployment failed!
Serverless Error ---------------------------------------
An error occurred while provisioning your stack: SaveAttachmentLambdaVersionXX
- CodeSHA256 (XX)
is different from current CodeSHA256 in $LATEST (XX).
Please try again with the CodeSHA256 in $LATEST..
- What did you expect should have happened?
New deployment should have succeeded
- What was the config you used?
Deploying to AWS. Using serverless-plugins-typescript to compile TS to a .build folder before deployment.
- What stacktrace or error message from your provider did you see?
ServerlessError: An error occurred while provisioning your stack: SaveSearchLambdaVersionXXX- CodeSHA256 (XXX) is different from current CodeSHA256 in $LATEST (XXX). Please try again with the CodeSHA256 in $LATEST..
at provider.request.then (/Users/cmmoyer/.nvm/v6.10.1/lib/node_modules/serverless/lib/plugins/aws/lib/monitorStack.js:109:33)
From previous event:
at AwsDeploy.monitorStack (/Users/cmmoyer/.nvm/v6.10.1/lib/node_modules/serverless/lib/plugins/aws/lib/monitorStack.js:26:12)
at provider.request.then (/Users/cmmoyer/.nvm/v6.10.1/lib/node_modules/serverless/lib/plugins/aws/lib/updateStack.js:88:30)
From previous event:
at AwsDeploy.update (/Users/cmmoyer/.nvm/v6.10.1/lib/node_modules/serverless/lib/plugins/aws/lib/updateStack.js:88:8)
From previous event:
at AwsDeploy.BbPromise.bind.then (/Users/cmmoyer/.nvm/v6.10.1/lib/node_modules/serverless/lib/plugins/aws/lib/updateStack.js:105:12)
From previous event:
at AwsDeploy.updateStack (/Users/cmmoyer/.nvm/v6.10.1/lib/node_modules/serverless/lib/plugins/aws/lib/updateStack.js:99:8)
From previous event:
at Object.aws:deploy:deploy:updateStack [as hook] (/Users/cmmoyer/.nvm/v6.10.1/lib/node_modules/serverless/lib/plugins/aws/deploy/index.js:99:10)
at BbPromise.reduce (/Users/cmmoyer/.nvm/v6.10.1/lib/node_modules/serverless/lib/classes/PluginManager.js:234:55)
From previous event:
at PluginManager.invoke (/Users/cmmoyer/.nvm/v6.10.1/lib/node_modules/serverless/lib/classes/PluginManager.js:234:22)
at PluginManager.spawn (/Users/cmmoyer/.nvm/v6.10.1/lib/node_modules/serverless/lib/classes/PluginManager.js:246:17)
at AwsDeploy.BbPromise.bind.then (/Users/cmmoyer/.nvm/v6.10.1/lib/node_modules/serverless/lib/plugins/aws/deploy/index.js:85:48)
From previous event:
at Object.deploy:deploy [as hook] (/Users/cmmoyer/.nvm/v6.10.1/lib/node_modules/serverless/lib/plugins/aws/deploy/index.js:81:10)
at BbPromise.reduce (/Users/cmmoyer/.nvm/v6.10.1/lib/node_modules/serverless/lib/classes/PluginManager.js:234:55)
at runCallback (timers.js:666:20)
at tryOnImmediate (timers.js:639:5)
at processImmediate [as _immediateCallback] (timers.js:611:5)
From previous event:
at PluginManager.invoke (/Users/cmmoyer/.nvm/v6.10.1/lib/node_modules/serverless/lib/classes/PluginManager.js:234:22)
at PluginManager.run (/Users/cmmoyer/.nvm/v6.10.1/lib/node_modules/serverless/lib/classes/PluginManager.js:253:17)
at variables.populateService.then (/Users/cmmoyer/.nvm/v6.10.1/lib/node_modules/serverless/lib/Serverless.js:100:33)
From previous event:
at Serverless.run (/Users/cmmoyer/.nvm/v6.10.1/lib/node_modules/serverless/lib/Serverless.js:87:74)
at serverless.init.then (/Users/cmmoyer/.nvm/v6.10.1/lib/node_modules/serverless/bin/serverless:23:50)
Additional Data
- Serverless Framework Version you're using: 1.14.0
- Operating System: darwin (macOS 10.12.4)
- Stack Trace: See above
- Provider Error messages: CodeSHA256 (XX)
is different from current CodeSHA256 in $LATEST (XX) - Node Version: v6.10.1
Reacted by Adam Biggs
Activity
scott-martin commentedon May 26, 2017
Also just started seeing this. I'm on serverless 1.13.2, using the serverless webpack plugin also.
scott-martin commentedon May 26, 2017
Upgrade to 1.14 did not fix it.
Downgrade down to 1.11 also did not fix it.
ncloward commentedon May 26, 2017
Started seeing this as well... serverless 1.14.0, also using
serverless-webpack. I see the same error in the CloudFormation stack event:adambiggs commentedon May 26, 2017
Saw the same error today. Ended up working after a redeploy, but hopefully it doesn't happen again...
kopertop commentedon May 26, 2017
Same with me, I downgraded to 1.13 and it didn't fix it, but after waiting a while it's working again.
This might have been an AWS issue after all?
pmuens commentedon May 29, 2017
Thanks for the feedback everyone 👍
We saw such a behavior a few months ago. It was also resolved by simply waiting and re-reploying after some time. Seems to be smth. on AWS end.
I'll close this issue for now. Feel free to re-open / continue the discussion if this problems pops up again.
evaneaston commentedon Jun 6, 2017
FWIW, we've been seeing this failure a lot more frequently over the past several days. We're on 1.5 right now and not able to move up to latest quite yet. As others have said, retrying once or twice takes care of it.
thomaswmanion commentedon Aug 24, 2017
Did anyone actually figure out what the problem generally seems to be when this error occurs?
It's hard to believe that AWS has some batch job that runs once a day that magically fixes all the SHA problems. Maybe they do?
thomaswmanion commentedon Aug 24, 2017
Adding
versionFunctions: falseto the provider property of serverless.yml is a possible workaround.jedkcanderson commentedon Sep 11, 2018
I just ran into this myself because I we had to workaround permissions issues in the built zip by unzipping, chmodding, and then rezipping. I created a script to update the SHAs in the json files, the primary guts of which are:
ceefour commentedon Oct 9, 2018
BTW I also experienced this using claudiajs (not serverless framework). So there's something on AWS's end.
madguy02 commentedon Aug 24, 2019
I have also been hitting this issue a lot more frequently , but updating the stack does not seem to fix it, versionFunction: false does not allow you to update your lambda functions. Any solutions ?
unfor19 commentedon Nov 28, 2019
For me, it happened because I used the same filename in
artifactfor two functionsSo I renamed the ZIP files ... and now it works
The issue:
Solution:
hellatan commentedon Mar 5, 2020
a little late to this, but could this be an alias issue? I just tried deploying my function and received this error. I removed my alias and then deployed again and that error was gone, albeit a different one which I was expecting was there instead 😄
simonobe commentedon Oct 14, 2020
happening to me as well, does anybody know what is happening?
jsnanigans commentedon Nov 26, 2020
I found a solution by updating the permissions in was IAM:
Debugging:
When running the deploy command add the
--verboseoption, this gave me this:Solution:
In IAM I gave my Policy that is attached to the user that is authenticated with the
aws configurecommand full access to Lambda. I would absolutely not advise you to do the same if this is production code, instead, you should find the specific Access setting that is needed, I think it's inPermissions Managementsomewhere.Now that line has changed to:
corydorning53 commentedon Dec 4, 2020
I get this error when trying to overwrite the serverless generated zip files in a separate pipeline job (due to lack of immutability in serverless [see #4715]). anyone solved for this?
I package my functions individually so I can't specify the artifact via
--artifacthardik-muchhadiya commentedon Nov 2, 2022
give zip file name different for lambda function . issue will fix .
appetiser-apps-daryl-teo commentedon Mar 23, 2023
Having encountered this with my own local plugin - the issue was that SLS was doing a SHA on the old artifact prior to the build, which would then generate a new artifact with a different SHA when uploaded.
Using the lifecycle hook
package:initinstead ofpackage:compileFunctionsfixed the issue for me.