Open
Description
After upgrade from 2.0.0 to 3.0.0, I'm getting this:
$ bundle exec aws_lambda_ric main.go
--
Init error when loading handler
{
"errorMessage": "Invalid handler [], must be of form FILENAME.METHOD or FILENAME.CLASS.METHOD where FILENAME corresponds with an existing Ruby source file FILENAME.rb, CLASS is an optional module/class namespace and METHOD is a callable method. If using CLASS, METHOD must be a class-level method.",
"errorType": "Init<ArgumentError>",
"stackTrace": [
"/usr/local/bundle/gems/aws_lambda_ric-3.0.0/lib/aws_lambda_ric/lambda_handler.rb:16:in 'LambdaHandler#initialize'",
"/usr/local/bundle/gems/aws_lambda_ric-3.0.0/lib/aws_lambda_ric.rb:45:in 'Class#new'",
"/usr/local/bundle/gems/aws_lambda_ric-3.0.0/lib/aws_lambda_ric.rb:45:in 'AwsLambdaRIC::LambdaRunner#run'",
"/usr/local/bundle/gems/aws_lambda_ric-3.0.0/lib/aws_lambda_ric.rb:219:in 'AwsLambdaRIC::Bootstrap#bootstrap_handler'",
"/usr/local/bundle/gems/aws_lambda_ric-3.0.0/lib/aws_lambda_ric.rb:201:in 'AwsLambdaRIC::Bootstrap#start'",
"/usr/local/bundle/gems/aws_lambda_ric-3.0.0/bin/aws_lambda_ric:9:in '<top (required)>'",
"/usr/local/bundle/bin/aws_lambda_ric:25:in 'Kernel#load'",
"/usr/local/bundle/bin/aws_lambda_ric:25:in '<top (required)>'",
"/usr/local/lib/ruby/3.4.0/bundler/cli/exec.rb:59:in 'Kernel.load'",
"/usr/local/lib/ruby/3.4.0/bundler/cli/exec.rb:59:in 'Bundler::CLI::Exec#kernel_load'",
"/usr/local/lib/ruby/3.4.0/bundler/cli/exec.rb:23:in 'Bundler::CLI::Exec#run'",
"/usr/local/lib/ruby/3.4.0/bundler/cli.rb:452:in 'Bundler::CLI#exec'",
It seems that in 3.0.0 I should call it like this:
$ _HANDLER=main.go bundle exec aws_lambda_ric
Maybe the README should be updated?
Activity
maxday commentedon Apr 25, 2025
hi @yegor256
Thanks for reaching out!
Can you clarify a bit the situation? It seems that you're using the
ruby
gem with ago
file?Thanks
yegor256 commentedon Apr 26, 2025
@maxday
main.go
is not the name of the file, but the coordinates of Ruby method. Here,main
is the name of the file (main.rb
) andgo
is the name of the method (go()
) in this file. See: https://github.com/aws/aws-lambda-ruby-runtime-interface-client/blob/main/lib/aws_lambda_ric/lambda_handler.rb#L10-L17