Re: OpenSSL v0.9.8 in CF Ruby Buildpack 1.4


Daya Sharma <dsharma@...>
 

Hi Mike,

the line

```gem 'jruby-openssl', :platforms => :jruby ```

means jruby-openssl gem will be downloaded by bundler if and only if JRuby
platform is detected, I am using MRI not JRuby.

The OpenSSL error happens even before any dependency is downloaded or
resolved, it happens because Gemfile has this line

```source 'https://rubygems.org'``` to fulfill https needs system tries to
load OpenSSL 0.9.8 library which is not found on the virtual machine.

To further clarify the problem if I install OpenSSL 0.9.8 on the virtual
machine the problem disappears even though a higher version of OpenSSL
1.0.1f is already installed as shown in the log output.

-daya

On Tue, May 12, 2015 at 2:45 PM, Mike Dalessio <mdalessio(a)pivotal.io> wrote:

Hi Daya,

I'm a bit confused, as it looks from your Gemfile like you're trying to
load a JRuby openssl gem while running MRI ruby.

What happens if you remove your dependency on the `jruby-openssl` gem?

On Tue, May 12, 2015 at 12:24 PM, Daya Sharma <dsharma(a)cloudbees.com>
wrote:

testing_openssl.rb mentioned previously is here
https://gist.github.com/daya/71a589f9b83f9ff57608

CloudFoundry Ruby Build Pack 1.4
https://github.com/cloudfoundry/ruby-buildpack/releases/tag/v1.4.0

On Tue, May 12, 2015 at 1:32 AM, Daya Sharma <dsharma(a)cloudbees.com>
wrote:

Hi

There is a OpenSSL version/dependency mismatch as far as Ruby BuildPack
and Stemcells are concerned

Our bosh-lite environment is

*StemCell*:

Name: bosh-warden-boshlite-ubuntu-trusty-go_agent
Version: 2776
CID: 3241e75c-e0ae-4c81-4c3e-69ef5545dcfe
OpenSSL: 1.0.1f

*CF Ruby BuildPack*:

Version
​:​
1.4
OpenSSL: 0.9.8

*Gemfile*: here
<https://github.com/daya/active_merchant/blob/master/Gemfile> refers to
Ruby 2.2.2

*Problem*: When sourcing cf_buildpack followed by bundle install with
https://rubygems.orginvokes Ruby version 2.2.2 which is built against
OpenSSL version 0.9.8 but vm based on above mentioned StemCell has OpenSSL
version 1.0.0 causing *ruby app failures*.

Following are the relevant outputs from a jenkins CI job


-------> Buildpack version 1.4.0
-----> Compiling Ruby
-----> Using Ruby version: ruby-2.2.2
-----> Installing dependencies using 1.7.12
Running: bundle install --without none --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
Could not load OpenSSL.
You must recompile Ruby with OpenSSL support or change the sources in your
Gemfile from 'https' to 'http'. Instructions for compiling with OpenSSL using
RVM are available at http://rvm.io/packages/openssl.
Bundler Output:
Could not load OpenSSL.
You must recompile Ruby with OpenSSL support or change the sources in your
Gemfile from 'https' to 'http'. Instructions for compiling with OpenSSL using
RVM are available at http://rvm.io/packages/openssl.

Steps to Reproduce:

Using file testing_openssl.rb

On VM


root(a)21d7bdc5-cbd5-4cdb-80cc-25c654549d3e:~# /var/vcap/store/jenkins_slave/workspace/ruby-buildpack-test/vendor/ruby-2.2.2/bin/ruby -v
ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]
root(a)21d7bdc5-cbd5-4cdb-80cc-25c654549d3e:~# /var/vcap/store/jenkins_slave/workspace/ruby-buildpack-test/vendor/ruby-2.2.2/bin/ruby -W2 /var/vcap/store/jenkins_slave/workspace/ruby-buildpack-test/testing_openssl.rb
/var/vcap/store/jenkins_slave/workspace/ruby-buildpack-test/testing_openssl.rb:9: warning: assigned but unused variable - response
/var/vcap/store/jenkins_slave/workspace/ruby-buildpack-test/vendor/ruby-2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': libssl.so.0.9.8: cannot open shared object file: No such file or directory - /var/vcap/store/jenkins_slave/workspace/ruby-buildpack-test/vendor/ruby-2.2.2/lib/ruby/2.2.0/x86_64-linux/openssl.so (LoadError)
from /var/vcap/store/jenkins_slave/workspace/ruby-buildpack-test/vendor/ruby-2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /var/vcap/store/jenkins_slave/workspace/ruby-buildpack-test/vendor/ruby-2.2.2/lib/ruby/2.2.0/openssl.rb:17:in `<top (required)>'
from /var/vcap/store/jenkins_slave/workspace/ruby-buildpack-test/vendor/ruby-2.2.2/lib/ruby/2.2.0/net/http.rb:574:in `start'
from /var/vcap/store/jenkins_slave/workspace/ruby-buildpack-test/testing_openssl.rb:5:in `<main>'

root(a)21d7bdc5-cbd5-4cdb-80cc-25c654549d3e:~# apt-cache showpkg openssl
Package: openssl
Versions:
1.0.1f-1ubuntu2.7

Any ideas on how to best solve this problem.

Thanks,

-daya


_______________________________________________
cf-bosh mailing list
cf-bosh(a)lists.cloudfoundry.org
https://lists.cloudfoundry.org/mailman/listinfo/cf-bosh

Join cf-bosh@lists.cloudfoundry.org to automatically receive all group messages.