Skip to content
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

command-[dotnet lambda package] throws "Unknown error executing command: No such file or directory" #592

Closed
murthyc opened this issue Mar 1, 2020 · 2 comments
Labels
guidance Question that needs advice or information.

Comments

@murthyc
Copy link

murthyc commented Mar 1, 2020

Running command "dotnet lambda package"
throws "Unknown error executing command: No such file or directory"
MacOS-dotnet --version -2.1.804

Amazon Lambda Tools for .NET Core applications (3.3.1)
Project Home: https://github.com/aws/aws-extensions-for-dotnet-cli, https://github.com/aws/aws-lambda-dotnet

Executing publish command
... invoking 'dotnet publish', working folder '/Users/...../MyProject/bin/Debug/netcoreapp2.1/publish'
... Disabling compilation context to reduce package size. If compilation context is needed pass in the "/p:PreserveCompilationContext=false" switch.
Unknown error executing command: No such file or directory
at Interop.Sys.ForkAndExecProcess(String filename, String[] argv, String[] envp, String cwd, Boolean redirectStdin, Boolean redirectStdout, Boolean redirectStderr, Boolean setUser, UInt32 userId, UInt32 groupId, Int32& lpChildPid, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean shouldThrow)
at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at Amazon.Lambda.Tools.LambdaDotNetCLIWrapper.Publish(LambdaToolsDefaults defaults, String projectLocation, String outputLocation, String targetFramework, String configuration, String msbuildParameters, IList1 publishManifests) in C:\codebuild\tmp\output\src838309283\src\src\Amazon.Lambda.Tools\LambdaDotNetCLIWrapper.cs:line 266 at Amazon.Lambda.Tools.LambdaPackager.CreateApplicationBundle(LambdaToolsDefaults defaults, IToolLogger logger, String workingDirectory, String projectLocation, String configuration, String targetFramework, String msbuildParameters, Boolean disableVersionCheck, LayerPackageInfo layerPackageInfo, String& publishLocation, String& zipArchivePath) in C:\codebuild\tmp\output\src838309283\src\src\Amazon.Lambda.Tools\LambdaPackager.cs:line 76 at Amazon.Lambda.Tools.Commands.PackageCommand.PerformActionAsync() at Amazon.Common.DotNetCli.Tools.Commands.BaseCommand1.ExecuteAsync() in C:\codebuild\tmp\output\src838309283\src\src\Amazon.Common.DotNetCli.Tools\Commands\BaseCommand.cs:line 44

@klaytaybai klaytaybai added needs-triage This issue or PR still needs to be triaged. guidance Question that needs advice or information. and removed needs-triage This issue or PR still needs to be triaged. labels Mar 3, 2020
@klaytaybai
Copy link

It seems like this is an issue with the working directory

@murthyc
Copy link
Author

murthyc commented Mar 7, 2020

Dotnet path was causing the issue. Below 1) or 2) worked for me.

  1. MyProject $ export PATH=/usr/local/share/dotnet:$PATH

Symlink : -f to force, else throws” File Exists”
2) MyProject $ ln -sf /usr/local/share/dotnet/dotnet /usr/local/bin/

@murthyc murthyc closed this as completed Mar 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
guidance Question that needs advice or information.
Projects
None yet
Development

No branches or pull requests

2 participants