Skip to content

Wrong number of arguments error in send_error_response #15

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

Closed
brunze opened this issue May 12, 2021 · 4 comments
Closed

Wrong number of arguments error in send_error_response #15

brunze opened this issue May 12, 2021 · 4 comments

Comments

@brunze
Copy link

brunze commented May 12, 2021

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.

@djpate
Copy link
Contributor

djpate commented Aug 20, 2021

Had to fork it as well Could this be addressed?

@avgerin0s
Copy link

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

@jordan-brough
Copy link
Contributor

jordan-brough commented Sep 27, 2023

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

@mullermp
Copy link
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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants