Skip to content

Wrong number of arguments error in send_error_response #15

Closed

Description

@brunze

When my functions raise errors I get the following additional error printed out to the logs:

}
  Init error when loading handler
  {
    "errorMessage": "wrong number of arguments (given 4, expected 2..3)",
    "errorType": "Init<ArgumentError>",
    "stackTrace": [
      "/usr/local/bundle/gems/aws_lambda_ric-1.0.2/lib/aws_lambda_ric.rb:109:in `send_error_response'",
      "/usr/local/bundle/gems/aws_lambda_ric-1.0.2/lib/aws_lambda_ric.rb:98:in `rescue in run_user_code'",
      "/usr/local/bundle/gems/aws_lambda_ric-1.0.2/lib/aws_lambda_ric.rb:77:in `run_user_code'",
      "/usr/local/bundle/gems/aws_lambda_ric-1.0.2/lib/aws_lambda_ric.rb:59:in `start_runtime_loop'",
      "/usr/local/bundle/gems/aws_lambda_ric-1.0.2/lib/aws_lambda_ric.rb:42:in `run'",
      "/usr/local/bundle/gems/aws_lambda_ric-1.0.2/lib/aws_lambda_ric/bootstrap.rb:35:in `bootstrap_handler'",
      "/usr/local/bundle/gems/aws_lambda_ric-1.0.2/lib/aws_lambda_ric/bootstrap.rb:8:in `start'",
      "/usr/local/bundle/gems/aws_lambda_ric-1.0.2/bin/aws_lambda_ric:10:in `<top (required)>'",
      "/usr/local/bundle/bin/aws_lambda_ric:23:in `load'",
      "/usr/local/bundle/bin/aws_lambda_ric:23:in `<main>'"
    ]
}

I'm using the RIC with the Ruby Alpine docker images. Ruby version is 2.7.3p183.

It looks like a method signature mismatch in:

def send_error_response(lambda_invocation, err, exit_code = nil, runtime_loop_active: true)

I monkey patched it to def send_error_response(lambda_invocation, err, exit_code = nil, runtime_loop_active = true) (last parameter converted to positional parameter) and that seemed to fix it.

Either that or the call sites for send_error_response need to change.

Activity

  1. djpate commented on Aug 20, 2021

    @djpate
    Contributor

    Had to fork it as well Could this be addressed?

  2. avgerin0s commented on Sep 14, 2022

    @avgerin0s

    Are there any plans on releasing a version with the fix?

  3. jordan-brough commented on Sep 27, 2023

    @jordan-brough
    Contributor

    This was fixed over a year ago in #16 but a new version of the gem hasn't been published still.

  4. mullermp commented on Feb 23, 2025

    @mullermp
    Contributor

    Closing as a new gem version had been published.

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

      Issue actions