Re: OpenSSL v0.9.8 in CF Ruby Buildpack 1.4


Mike Dalessio
 

Hi Daya,

I can't reproduce what you're seeing in a rootfs container -- I reproduced
your Gemfile and the app deploys without error. I'm assuming this means
that I'm not accurately reproducing what you're doing.

Can you help me reproduce this without having to set up Jenkins? It still
sounds to me like you're running these processes on a stemcell, and not in
a container rootfs. If that's the case, you probably shouldn't be using the
buildpack.

-m

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

Hi Mike,

We are running this ruby app on the container rootfs not on bare VM.

Our use case is built around our need to run Jenkins
<http://jenkins-ci.org/> Master and Slaves on different containers. The
build job is configured on Jenkins Master, and the build is then run on
Jenkins Slave. In this specific case the build job is configured for a MRI
Ruby project, the first step of that build job is to download the
dependencies using ```bundle install``` from https://rubygems.org
followed by running automated tests

CF Ruby Build Pack is used so that end user configuring the build job does
not have to install Ruby platform on the build slaves to run their ruby web
app and tests against it.


Please let me know if further explanation is needed.

Thanks,
-daya

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

OK, that makes sense.

It sounds like you're installing the web app on the bare VM, and not in a
container rootfs. This isn't really a supported use case for the Buildpack,
which is going to make assumptions that you're running in either the
`lucid64` or `cflinuxfs` rootfs.

Can you explain a bit more about what you're trying to do, and why you're
using the ruby buildpack?



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

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.