Error Running PushCommand In AWS Lambda
hounddog22030 opened this issue · 2 comments
Attempting to run PushCommand.RunAsync we are getting a error of "Required environment variable 'HOME' is not set." (see below)
This seems to be related to Nuget. Is there some initialization code we need to call?
Where should HOME point to? What is the meaning of it?
Thanks,
System.InvalidOperationException: Required environment variable 'HOME' is not set. Try setting 'DOTNET_CLI_HOME' or 'HOME' and running the operation
at NuGet.Common.NuGetEnvironment.GetValueOrThrowMissingEnvVarsDotnet(Func1 getValue, String home, String dotnetHome) at NuGet.Common.NuGetEnvironment.GetHome() at NuGet.Common.NuGetEnvironment.<>c.<.cctor>b__15_0() at System.Lazy
1.ViaFactory(LazyThreadSafetyMode mode)
at System.Lazy1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor) at System.Lazy
1.CreateValue()
at System.Lazy1.get_Value() at NuGet.Common.NuGetEnvironment.GetFolderPath(SpecialFolder folder) at NuGet.Common.NuGetEnvironment.GetFolderPath(NuGetFolderPath folder) at NuGet.Common.PathUtility.CheckIfFileSystemIsCaseInsensitive() at System.Lazy
1.ViaFactory(LazyThreadSafetyMode mode)
at System.Lazy1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor) at System.Lazy
1.CreateValue()
at System.Lazy1.get_Value() at NuGet.Common.PathUtility.get_IsFileSystemCaseInsensitive() at NuGet.Common.PathUtility.GetStringComparerBasedOnOS() at Sleet.PushCommand.GetPackagePaths(List
1 inputs) in D:\a\1\s\src\SleetLib\Commands\PushCommand.cs:line 263
at Sleet.PushCommand.RunAsync(LocalSettings settings, ISleetFileSystem source, List`1 inputs, Boolean force, Boolean skipExisting, ILogger log) in D:\a\1\s\src\SleetLib\Commands\PushCommand.cs:line 24
at YadaYada.Bisque.Aws.Lambda.NugetFunctions.SleetFunction.PrimeAsync(SleetRequest request, LocalSettings newSettings, AmazonS3FileSystem newFileSystem)
If you just do this, it succeeds....
System.Environment.SetEnvironmentVariable("HOME", Directory.GetCurrentDirectory());
Sleet relies on libraries from the NuGet client. HOME
refers to the user home directory ~
. For the case sensitivity check using the current directory should be fine.
Sleet isn't trying to use this directly, it's just happening as part of loading the internal NuGet config for those libraries.