简体   繁体   中英

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 do.net 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.

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.

在此处输入图像描述

I have the same problem, it was because my antivirus detect the executable build-lambda-zip.exe, then delete it.

I restore the executable from my antivirus, or restore dotnet tools with the command:

dotnet tool update -g Amazon.Lambda.Tools

I also faced the same issue, This is because the "build-lambda-zip.exe" file is getting removed by the McAfee Antivirus.

For the permanent fix, you need to follow the below steps.

Step 1

Go to McAfee Settings >> Quarantined Items

You will find the "build-lambda-zip.exe" file there. Restore it to the original location.

Now If you will try to publish, the error won't get displayed. But again on the next scan, the file will get removed.

Step 2

We need to Exclude this file from getting Scanned and removed. So for that,

Go to McAfee Settings >> Real-Time Scanning and Add the "build-lambda-zip.exe" file in the Excluded files list.

For the file path of "build-lambda-zip.exe" got to C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\Extensions\ and search for the file name.

在此处输入图像描述

Maybe you should try reinstalling the AWS Tool Kit and before you make deployments please turn off your antivirus protection. I was troubbling the same issue and my antivirus(McAfee) was deleting build-lambda-zip.exe file when I did deployment first time.

I'm curious about the state of the extension installation. Can you go to VS's extension directory in Windows explorer C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\Extensions and in the search box search for AWSToolkitPackage.dll .

在此处输入图像描述

Ideally it should only show one instance of that file. Assuming it finds a single instance right click on the file and select "Open File Location". Now that you are in the root folder of the AWS extension check the Resources folder and see if it contains the file build-lambda-zip.exe .

在此处输入图像描述

I know the question is in a windows system, but under a linux system, in my case the following command was needed:

sudo apt-get -y install zip

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM