Closed AlexGascon closed 3 years ago
Adding the full error trace, in case it contains anything else that can be useful
Could not open library 'libcurl': libcurl: cannot open shared object file: No such file or directory.
Could not open library 'libcurl.so': libcurl.so: cannot open shared object file: No such file or directory.
Could not open library 'libcurl.so.4': libcurl.so.4: cannot open shared object file: No such file or directory
WARNING: Unable to require "bundler/setup"
There may be something funny with your ruby and bundler setup.
You can try upgrading bundler and rubygems:
gem update --system
gem install bundler
Here are some links that may be helpful:
* https://bundler.io/blog/2019/01/03/announcing-bundler-2.html
* https://community.rubyonjets.com/t/jets-1-9-8-install-issue-bundler-setup-missing/185/2
Also, running bundle exec in front of your command may remove this message.
START RequestId: b78c372f-bc17-42b1-9e65-5f4a5f5c9b25 Version: $LATEST
RubyError: NameError: uninitialized constant TestJob::YNAB
/var/task/app/jobs/test_job.rb:5:in `run'
/opt/ruby/gems/2.7.0/gems/jets-3.0.9/lib/jets/job/base.rb:25:in `process'
app/jobs/test_job.rb:1:in `run'
/opt/ruby/gems/2.7.0/gems/jets-3.0.9/lib/jets/processors/main_processor.rb:32:in `instance_eval'
/opt/ruby/gems/2.7.0/gems/jets-3.0.9/lib/jets/processors/main_processor.rb:32:in `run'
/opt/ruby/gems/2.7.0/gems/jets-3.0.9/lib/jets/core.rb:120:in `process'
/var/task/handlers/jobs/test_job.rb:6:in `run'
/var/runtime/lib/lambda_handler.rb:26:in `call_handler'
/var/runtime/lib/runtime.rb:99:in `<main>'
Critical exception from handler
{
"errorMessage": "uninitialized constant TestJob::YNAB",
"errorType": "Function<NameError>",
"stackTrace": [
]
}
END RequestId: b78c372f-bc17-42b1-9e65-5f4a5f5c9b25
REPORT RequestId: b78c372f-bc17-42b1-9e65-5f4a5f5c9b25 Duration: 23.42 ms Billed Duration: 24 ms Memory Size: 1536 MB Max Memory Used: 154 MB Init Duration: 2552.57 ms
Unknown application error occurred
Function<NameError>
So this gem relies on libcurl system package but it doesn't specify it in its gemspec. Hence, jets does not detect that it's a native gem that requires some system packages.
Did a couple of things to make this happened, including adding an api call to the serverlessgems service for these special case gems. Jets will be better able to detect these special cases now and use a pre-compiled gem with the external package if possible. The ynab gem should work now.
Note: You will need Jets 3.0.11+
It works perfectly now, thanks a million for the help!
Checklist
jets upgrade
command that makes this a simple task. There's also an Upgrading Guide: http://rubyonjets.com/docs/upgrading/My Environment
Expected Behaviour
When the YNAB gem is in the Gemfile, it's loaded correctly into the project
Current Behavior
Trying to use the gem results in an error
Step-by-step reproduction instructions
jets new example-project
)gem "ynab"
to your Gemfilejets deploy
I checked the Lambda layer and confirmed that the YNAB gem is there, so it's not a problem of Layer generation. Also, I use multiple other gems, but the YNAB one is the only that presents this problem. Additionally, I was already using the YNAB gem ~2 months ago and I didn't have any problem. I stopped executing that code path until 15-20 days ago, and then is when I started getting the errors.
The code that uses the gem has multiple tests, and those run perfectly fine both locally and in my CI environment (CircleCI). The problem is only present in Lambda.
Let me know if there is any additional information I can provide to help. Thanks in advance!