Skip to content

_HANDLER is not documented in the README #42

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

Open
yegor256 opened this issue Mar 13, 2025 · 2 comments
Open

_HANDLER is not documented in the README #42

yegor256 opened this issue Mar 13, 2025 · 2 comments

Comments

@yegor256
Copy link

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?

@maxday
Copy link

maxday commented 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 a go file?
Thanks

@yegor256
Copy link
Author

@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) and go 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants