rubyonjets / jets

Ruby on Jets
http://rubyonjets.com
MIT License
2.6k stars 181 forks source link

`Jets.once` sometime stuck with “Init<Seahorse::Client::NetworkingError>” error on AWS lambda #297

Closed krishnarama12 closed 5 years ago

krishnarama12 commented 5 years ago

Checklist

My Environment

Software Version
Operating System AWS Lambda
Jets 1.9.9
Ruby 2.5.0

Expected Behaviour

Lambda Function should return simple string

Current Behavior

{
“errorMessage”: “execution expired”,
“errorType”: “InitSeahorse::Client::NetworkingError”,
“stackTrace”: [
“/var/lang/lib/ruby/2.5.0/net/http.rb:937:in initialize'", "/var/lang/lib/ruby/2.5.0/net/http.rb:937:inopen’”,
“/var/lang/lib/ruby/2.5.0/net/http.rb:937:in block in connect'", "/var/lang/lib/ruby/2.5.0/timeout.rb:103:intimeout’”,
“/var/lang/lib/ruby/2.5.0/net/http.rb:935:in connect'", "/var/lang/lib/ruby/2.5.0/net/http.rb:920:indo_start’”,
“/var/lang/lib/ruby/2.5.0/net/http.rb:915:in start'", "/var/lang/lib/ruby/2.5.0/delegate.rb:83:inmethod_missing’”,
“/opt/ruby/gems/2.5.0/gems/aws-sdk-core-3.54.1/lib/seahorse/client/net_http/connection_pool.rb:297:in 
...

Step-by-step reproduction instructions

Jets deploy the project with lambda gateway code given in code sample. Also put AWS Lambda function inside VPC with privileges (subnets etc...) to access public internet. The error happens intermittently so sometime function will work fine and sometime it fails.

`Jets.once` sometime stuck with “Init” error on AWS lambda ...Simple Ruby/Jets AWS lambda function which is running under VPC with all the privileges to access public internet, sometime fails to execute with “InitSeahorse::Client::NetworkingError” . The function do not have any code except to return simple string...

Code Sample

require "bundler/setup"
require "jets"
Jets.once  # runs once in lambda execution context
def index(event:, context:)
    return "Success"
end

Solution Suggestion

tongueroo commented 5 years ago

Handled in #298 Released in v1.9.20