-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: sam build and local invoke fail with NuGet error when using nuget.config with private feeds #6320
Comments
Hi, thanks for bringing up the issue. I am having trouble replicating the error on my own machine, mainly due to not being able to create a private feed on azure. I was however able to create a github one that built fine. Is there an example project that you can provide for me to replicate the issue on? In the meanwhile, I have a couple ideas to try that may fix the issue. The first is running the |
Hi Jay, Thanks a ton for getting back to me and looking at this issue. I'm not sure what to do about the private feed other than adding an account of yours to our organization so that you can pull from the Azure Artifacts in our feed. I can provide an example project but, without being able to pull from the private Azure feed, I'm not sure how helpful that will be. Do you still want me to provide the sample project? I'll look into whether or not we could get you access to the private feed. In the meantime, though, I tried your other two suggestions. Removing Amazon.Lambda.ToolsI read through the docs which you linked and I found that it was installed:
Then I removed the package with the following command:
After that, I re-ran the SAM build command. I didn't restart or log out or anything. I don't know if that's important or not. Here's the output from the command:
It looks like it's still got the same error. There's some problem that it has with that private Azure Nuget feed. Like I mentioned earlier, that Nuget feed was working for a long time with the SAM tool. I was able to BTW, Building in a containerBuilding in a container was an interesting idea that I hadn't thought of. I gave that a try and it seemed to work, but then I got a pop up from the C# extension for VS Code after the build saying that it had failed and it provided some error logs. I'm going to paste my build command and its logs below and then, after that, I'll post the error message that was shown by the C# extension.
The output above makes it look like everything worked but, right as that finished running, the C# extension showed a pop-up directing me to the C# logs and this is what they had:
So I'm not sure if the build was actually successful or not. It looks like the files were built but, based on the error message, was it actually successful? Hopefully something in all of this information helps to point us in the right direction toward the issue and a resolution. |
Thanks, Im still taking a look at your response, but I see that after building it container it ran properly, could you test |
Description:
When I use
sam build
orsam local invoke
to build or locally debug a lambda function in a solution with a nuget.config file, I get a NuGet error which comes from the build step where Amazon.Lambda.Tools is installed. This only happens with thesam
cli commands. When I build and/or restore withdotnet
, no error occurs. We have a number of libraries in a private Azure Artifacts feed which need to be used with our solution so not using a private NuGet feed is not an option. This error originally popped up while I was trying to upgrade a stack to use .NET 6 from .NET 3.1. The whole build and invoke process was working correctly previously but, after upgrading the .NET SDK and the SAM CLI, all of a sudden the sam cli commands started having errors. I am pretty sure that I have isolated this down to an issue with the sam cli.This seems like it might be related to #1970 but I'm not sure.
I have tried using the same nuget.config file in another "non-sam" project and I am able to use and retrieve packages from the private Azure feed without any issues.
Here is the nuget.config file's contents:
Steps to reproduce:
sam init
sam build
. The stack builds without any problems.sam build
. The stack builds without any problems.sam build
. The stack has an error.In the example above, I am not even referencing any of the libraries from the private NuGet feed; just the presence of the private NuGet feed in the nuget.config file causes this issue to occur.
Observed result:
Expected result:
To be able to use private feeds in a nuget.config file and have
sam build
andsam local invoke
work.Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
sam --version
:SAM CLI, version 1.103.0
The text was updated successfully, but these errors were encountered: