[AWS] Solve Error: Uploaded file must be a non-empty zip


 

If you got the following error when run the sam deploy :

 

CREATE_FAILED AWS::Lambda::Function <YourFunctionName> Resource handler
Function returned message:
"Uploaded file must be
a non-empty zip
(Service: Lambda,
Status Code: 400,
Request ID: <YourRequestID>, Extended Request
ID: null)"
(RequestToken: <YourRequestToken>,
HandlerErrorCode:
InvalidRequest)

 

First of all, check your lambda function resource path in the template.yaml file, make sure you have the correct path, and it did have the specified source code file under the folder.

 

Otherwise, it might be the node version issue, the CDK bug is #12536 and the upstream NodeJS bug is #37027

Try to change the node version to older than v15.5.0 to mitigate this issue:

 

nvm list
nvm use <Older Version>

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM