r-lambda-workflow icon indicating copy to clipboard operation
r-lambda-workflow copied to clipboard

Rscript execution error

Open clemizurieta opened this issue 5 years ago • 4 comments

RESPONSE=$(/opt/R/bin/Rscript /opt/runtime.R $EVENT_DATA)

When you run the lamda function the output from the console in AWS says "Rscript execution error: No such file or directory" eventhough it is in the /opt/R/bin directory.

clemizurieta avatar Dec 28 '19 03:12 clemizurieta

Could you send more details of how you run lambda?

jakubnowicki avatar Dec 31 '19 06:12 jakubnowicki

When I first ran setup_r_instance, the script fails at:

       print("Connecting to server")
       connection = Ssh(ip = my_server_ip, key_path = key_path)

It just says connection failed, so I just logged on to the AWS EC2 instance manually and run the build_runtime and build_r scripts by hand. No problems doing this, and then I installed them as layers into a custom lambda function. No issues there.

The problem happens when you run the lambda function. Does the zipping of the layer (R.zip) possible mess up the internal paths of R? I wonder...

Is there a place where we can see what runtime environments look like for a lambda function? That is, what does the directory structure look like and where are things placed, etc? I created the R zip file with the bootstrap and also without the bootstrap so I could edit the bootstrap myself to see if I could debug better.

Anyway, just trying different things. I am also using a ubuntu 18.04 instance.

clemizurieta avatar Jan 01 '20 21:01 clemizurieta

  1. I don't know, why setup_r_instance.py fails. You can try switching to develop branch and running script with a flag -d - it should print more information.
  2. It seems that you uploaded bare R as a layer. build_runtime.sh script should zip R together with bootstrap and runtime.R files into runtime.zip archive. Please check, if a file that you upload to AWS includes R directory and those two files.

jakubnowicki avatar Jan 02 '20 08:01 jakubnowicki

@clemizurieta I encountered the issue of seeing "connection failed" when running the script, to fix it I had to modify Security Groups inbound rules in the ec2 console and create a custom tcp rule that allows any ip to ssh using port 22.

zekisherif avatar Apr 11 '20 19:04 zekisherif