Closed FizzBuzz791 closed 1 year ago
Hi @FizzBuzz791,
Good morning.
As the error indicates, you need to have zip
package installed. On Debian based Linux distributions, the zip
package could be installed using sudo apt install zip
(this assumes that you have sudo
access).
Are you running this inside the Docker container? If yes, then refer https://stackoverflow.com/questions/41651145/docker-container-not-able-to-locate-zip-packages for possible solution.
Also, you mentioned that you want to use ZIP archive in future steps of the CI/CD pipeline. I think dotnet lambda package-ci would be more suitable for the scenario.
Kindly note that ZIP
package is OS level package and is installed differently in various Linux distributions. Hence, .NET CLI Extensions tooling delegates that responsibility to the user.
Thanks, Ashish
Hrmm OK, dotnet lambda package-ci
is probably correct, but it's a bigger change than I'm willing to invest in right now. At present, we bundle it up and then use npx sls deploy
to get the job done.
The mentioned steps for running inside Docker seem to work, however I'm still trying to understand why there's no dependency management here or at least why there's no warning on install? It warns me about the path not being set correctly, but not that zip isn't installed?
Hrmm OK,
dotnet lambda package-ci
is probably correct, but it's a bigger change than I'm willing to invest in right now. At present, we bundle it up and then usenpx sls deploy
to get the job done.The mentioned steps for running inside Docker seem to work, however I'm still trying to understand why there's no dependency management here or at least why there's no warning on install? It warns me about the path not being set correctly, but not that zip isn't installed?
@FizzBuzz791 This is probably a feature request to warn about missing tool dependencies and needs review with the team. I'm unsure if it would be prioritized, but would post any update here.
Closing this in fvor of https://github.com/aws/aws-extensions-for-dotnet-cli/issues/253
Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.
Describe the bug
I'm trying to package a lambda using the
dotnet lambda package
command so that it can be saved as an artifact and used in future steps of the CI/CD pipeline, but the command says:Expected Behavior
dotnet lambda package
runs to completion.Current Behavior
Tool gets to the zip step and fails.![image](https://user-images.githubusercontent.com/2747764/199423986-85f02742-4bc2-48b3-a638-04f0862a4522.png)
Reproduction Steps
mcr.microsoft.com/dotnet/sdk:6.0
dotnet tool install -g Amazon.Lambda.Tools
export PATH="$PATH:/root/.dotnet/tools"
dotnet lambda package --project-location "./src/" --configuration Release --output-package artifacts/package.zip --framework net6.0
Possible Solution
No response
Additional Information/Context
This is an upgrade from .Net2.1 to .Net 6.0, I followed all the steps listed at this page: https://aws.amazon.com/blogs/compute/introducing-the-net-6-runtime-for-aws-lambda/
The repro steps run fine on my local WSL2 instance (Ubuntu LTS) where
zip
is available. Confirmed viawhereis zip
.Targeted .NET platform
6.0.402
CLI extension version
Package Id Version Commands
amazon.lambda.tools 5.5.0 dotnet-lambda
Environment details (OS name and version, etc.)
mcr.microsoft.com/dotnet/sdk:6.0