Skip to content

_HANDLER is not documented in the README #42

Open
@yegor256

Description

@yegor256

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

maxday commented on Apr 25, 2025

@maxday
Member

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

yegor256 commented on Apr 26, 2025

@yegor256
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @yegor256@maxday

        Issue actions

          _HANDLER is not documented in the README · Issue #42 · aws/aws-lambda-ruby-runtime-interface-client