Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Publish to AWS Lamba - Failed to find the "build-lambda-zip" utility

I'm currently trying to publish my AWS lambda functions using Visual Studio 2019 community (v4.8.03752) and leveraging the AWS Toolkit for Visual Studio (v1.20.1.0). After right clicking my project and selecting 'Publish to AWS Lambda' I receive the following error:

- Zipping publish folder C:\Users\Matt\source\repos\programName\programName\.\bin\Release\netcoreapp3.1\publish to C:\Users\Matt\AppData\Local\Temp\HelloWorld-CodeUri-Or-ImageUri-637489827969959200.zip
- Failed to find the "build-lambda-zip" utility. This program is required to maintain Linux file permissions in the zip archive.
- Error packaging up project in C:\Users\Matt\source\repos\programName\programName\. for CloudFormation resource HelloWorld: Failed to find the "build-lambda-zip" utility. This program is required to maintain Linux file permissions in the zip archive.

I've been able to deploy this MANY times over previous months, up until Friday 2/12 when I started receiving this error (after a reboot). What's even more strange is that if I uninstall the AWS Toolkit for VS, then reinstall it, I'm able to publish successfully 1 time. With my 2nd attempt, I begin to receive this error again.

Steps I've taken to attempt to resolve:

  • Repair Visual Studio
  • Uninstall/Reinstall Visual Studio
  • Uninstall and reinstall amazon.lambda.tools using dotnet tool install -g Amazon.Lambda.Tools
  • Uninstall AWS Toolkit for VS, Reinstall toolkit. (This works for first deployment, fails when trying to deploy a 2nd time)

UPDATE:

Per some comments below, it looks like this is being caused by McAfee Real-Time Scanning. In checking the logs during a deployment I noticed a "Virus or threat found" record that points directly to the build-lambda-zip.exe file. To permanently avoid this issue moving forward please follow the steps provided by user2174794 in the comments below.

like image 788
Matthew Cantrell Avatar asked Dec 09 '22 23:12

Matthew Cantrell


1 Answers

I'm having the same issue. Just started happening today. It was working within the last 2 weeks.

Failed to find the "build-lambda-zip" utility. This program is required to maintain Linux file permissions in the zip archive.

Running Windows 10, Visual Studio 2019

My solution for now is to use the .NET Core CLI

https://docs.aws.amazon.com/toolkit-for-visual-studio/latest/user-guide/lambda-cli-publish.html

Specifically, the

dotnet lambda deploy-function

A recent update must have broke the AWS Toolkit For Visual Studio.

enter image description here

like image 192
Jimmy James Avatar answered Apr 17 '23 02:04

Jimmy James