aws/aws-toolkit-eclipse

Getting Cannot run program "/usr/local/bin/sam": error=2, No such file or directory

mac10046 opened this issue · 1 comments

I am trying to debug / run a AWS lambda project in eclipse

I have
ubuntu 20
aws --version is "aws-cli/1.18.69 Python/3.8.5 Linux/5.4.0-62-generic botocore/1.16.19"
docker --version is "Docker version 20.10.2, build 2291f61"

The lambda code build is successful but then eclipse aws error pop up comes up with the above error line.

This is the eclipse error log provided

`eclipse.buildId=4.16.0.I20200604-0540
java.version=1.8.0_275
java.vendor=Private Build
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_IN
Framework arguments:  -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.jee.product

This is a continuation of log file /home/abdeali/eclipse-workspace/.metadata/.bak_2.log
Created Time: 2021-01-30 11:08:32.780

com.amazonaws.eclipse.lambda
Error
Sun Jan 31 11:00:39 IST 2021
Failed to launch SAM Local.

com.amazonaws.eclipse.core.exceptions.AwsActionException: Cannot run program "/usr/local/bin/sam": error=2, No such file or directory
	at com.amazonaws.eclipse.lambda.launching.SamLocalDelegate.launch(SamLocalDelegate.java:159)
	at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:807)
	at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:718)
	at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1021)
	at org.eclipse.debug.internal.ui.DebugUIPlugin$2.run(DebugUIPlugin.java:1224)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.io.IOException: Cannot run program "/usr/local/bin/sam": error=2, No such file or directory
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
	at com.amazonaws.eclipse.core.util.CliUtil.buildProcess(CliUtil.java:50)
	at com.amazonaws.eclipse.lambda.launching.SamLocalDelegate.launch(SamLocalDelegate.java:109)
	... 5 more
Caused by: java.io.IOException: error=2, No such file or directory
	at java.lang.UNIXProcess.forkAndExec(Native Method)
	at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)
	at java.lang.ProcessImpl.start(ProcessImpl.java:134)
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
	... 7 more
`

This is the Session Data
eclipse.buildId=4.16.0.I20200604-0540 java.version=1.8.0_275 java.vendor=Private Build BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_IN Framework arguments: -product org.eclipse.epp.package.jee.product Command-line arguments: -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.jee.product

Tried searching on the net - but found nothing on this.

Did you ever find a solution to this? I'm encountering the same issue.