Skip to content
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

BIO_up_ref: symbol not found (docker) #55

Open
Shelvak opened this issue Feb 6, 2019 · 4 comments
Open

BIO_up_ref: symbol not found (docker) #55

Shelvak opened this issue Feb 6, 2019 · 4 comments

Comments

@Shelvak
Copy link

Shelvak commented Feb 6, 2019

Hi there, I'm trying to test iodine in my env, and I'm having problems in docker (my prod env). Any thoughts in what could I do about that, or if i need to install any extra lib?

Tested in => CodeFresh && locally with Docker version 18.09.0-ce, build 4d60db472b
Alpine => 3.7
Ruby => 2.5.3
iodine => (0.7.21)

Step 16/24 : RUN bundle exec rails assets:precompile
 ---> Running in 432016e7bd79
rails aborted!
LoadError: Error relocating /usr/src/app/vendor/bundle/ruby/2.5.0/gems/iodine-0.7.21/lib/iodine/iodine.so: BIO_up_ref: symbol not found - /usr/src/app/vendor/bundle/ruby/2.5.0/gems/iodine-0.7.21/lib/iodine/iodine.so
[0m[91m/usr/src/app/vendor/bundle/ruby/2.5.0/gems/iodine-0.7.21/lib/iodine.rb:5:in `require'
/usr/src/app/vendor/bundle/ruby/2.5.0/gems/iodine-0.7.21/lib/iodine.rb:5:in `<top (required)>'
/usr/local/bundle/gems/bundler-2.0.1/lib/bundler/runtime.rb:81:in `require'
/usr/local/bundle/gems/bundler-2.0.1/lib/bundler/runtime.rb:81:in `block (2 levels) in require'
/usr/local/bundle/gems/bundler-2.0.1/lib/bundler/runtime.rb:76:in `each'
/usr/local/bundle/gems/bundler-2.0.1/lib/bundler/runtime.rb:76:in `block in require'
/usr/local/bundle/gems/bundler-2.0.1/lib/bundler/runtime.rb:65:in `each'
/usr/local/bundle/gems/bundler-2.0.1/lib/bundler/runtime.rb:65:in `require'
/usr/local/bundle/gems/bundler-2.0.1/lib/bundler.rb:114:in `require'
/usr/src/app/config/application.rb:11:in `<top (required)>'
/usr/src/app/Rakefile:4:in `require'
/usr/src/app/Rakefile:4:in `<top (required)>'
/usr/src/app/vendor/bundle/ruby/2.5.0/gems/railties-5.1.6/lib/rails/commands/rake/rake_command.rb:20:in `block in perform'
/usr/src/app/vendor/bundle/ruby/2.5.0/gems/railties-5.1.6/lib/rails/commands/rake/rake_command.rb:18:in `perform'
/usr/src/app/vendor/bundle/ruby/2.5.0/gems/railties-5.1.6/lib/rails/command.rb:46:in `invoke'
/usr/src/app/vendor/bundle/ruby/2.5.0/gems/railties-5.1.6/lib/rails/commands.rb:16:in `<top (required)>'
bin/rails:4:in `require'
bin/rails:4:in `<main>'
(See full trace by running task with --trace)
Removing intermediate container 432016e7bd79
The command '/bin/sh -c bundle exec rails assets:precompile' returned a non-zero code: 1
[SYSTEM] Error: Failed to build image: caused by NonZeroExitCodeError: Container    for step title: Building Docker Image, step type: build, operation: Building image failed with exit code: 1

I tried to start up the server instead of the precompile and getting the same error.

If you need any extra data just tell me 👍

@Shelvak
Copy link
Author

Shelvak commented Feb 6, 2019

You can close this issue, because I figured it out that I need openssl1.1 either use TLS or not...
My positive tests to startup iodine:

  • NO_SSL=true bundle install # I saw that in the extconf.rb
  • Start the Dockerfile with alpine-3.9 and install openssl (1.1.1a)

It'ld be super helpfully if you add in the readme that we need openssl1.1 independently of the use of TLS.

Cheers 👍

@boazsegev
Copy link
Owner

boazsegev commented Feb 6, 2019

Hi @Shelvak ,

Thank you for opening this issue!

This might be a bug in the OpenSSL detection code. I'm not sure why, but the installer recognized a matching OpenSSL version and linked against it.

I don't really use Docker, so I'm not sure how that happened.

Do you know which OpenSSL version you have installed or if LibreSSL is installed (and which version)?

Kindly,
Bo.

@Shelvak
Copy link
Author

Shelvak commented Feb 6, 2019

yeah I tried with

  • libssl1.0.2q-r0 (just for dependency of other things) => not work
  • openssl 1.0.2q-r0 => not work
  • libressl 2.6.5-r0 (tried after your answer) => not work

All the tests were installing (or not) the packages before the bundle install

And iodine works with both libressl(2.7.4) and openssl(1.1.1a) in alpine3.9.

~~ If you tell me how can I do to get the puts output in the extconf.rb (because bundle --verbose doesn't show it) I can provide more context. ~~
With gem install iodine --verbose I can see the output:


# alpine 3.7 with libressl and openssl (both shows the same)
# here I tried to force `apk del libressl` and then `openssl version #=>OpenSSL 1.0.2q  20 Nov 2018 `
Detected OpenSSL library, testing for version.
Confirmed OpenSSL to be version 1.1.0 or above (LibreSSL 2.6.5)... # maybe here's the problem
* Compiling with HAVE_OPENSSL.

# Alpine 3.7 (explicit install openssl before anything else at least that fails, but with the same version for libressl instead of openssl)
Detected OpenSSL library, testing for version.
FAILED: OpenSSL version not supported (LibreSSL 2.6.5 is too old).

# Alpine 3.9 with openssl
Detected OpenSSL library, testing for version.
Confirmed OpenSSL to be version 1.1.0 or above (OpenSSL 1.1.1a  20 Nov 2018)...
* Compiling with HAVE_OPENSSL.

The list of *ssl packages installed for 3.7 and openssl are:

libcrypto1.0-1.0.2q-r0 x86_64 {openssl} (openssl) [installed]
libressl2.6-libcrypto-2.6.5-r0 x86_64 {libressl} (custom) [installed]
openssl-dev-1.0.2q-r0 x86_64 {openssl} (openssl) [installed]
libressl2.6-libtls-2.6.5-r0 x86_64 {libressl} (custom) [installed]
ssl_client-1.27.2-r11 x86_64 {busybox} (GPL2) [installed]
libssl1.0-1.0.2q-r0 x86_64 {openssl} (openssl) [installed]
libressl2.6-libssl-2.6.5-r0 x86_64 {libressl} (custom) [installed]
openssl-1.0.2q-r0 x86_64 {openssl} (openssl) [installed]

If you want to try with docker, you can add this to a Dockerfile in your repo and then test with docker build -t tmp . && docker run -it tmp bash and then rails c and check if that works.

FROM ruby:2.5.3-alpine3.7  # If you then change this line to `alpine3.9` you will see that with openssl1.1 works

# Patch to get global bins
ENV BUNDLE_BIN="$GEM_HOME/bin"
ENV PATH $BUNDLE_BIN:$PATH
RUN mkdir -p "$BUNDLE_BIN"
RUN chmod 777 "$BUNDLE_BIN"

RUN echo "gem: --no-rdoc --no-ri" >> ~/.gemrc \
    && apk --update add --virtual build-dependencies build-base \
    && apk --update add libpq bash nodejs libxml2 libxml2-dev libxml2-utils libxslt \
                        zlib tzdata git openssh file  \
    && gem install bundler 

WORKDIR /tmp

COPY Gemfile Gemfile.lock ./

RUN apk --update add openssl

RUN bundle install --deployment --jobs 5 

ADD . ./

EXPOSE 3000

CMD rails server

@boazsegev
Copy link
Owner

I'll look into this a bit more when I have a decent internet connection. I'm currently in a jungle retreat in Costa Rica, where a VM download might take a couple of days.

Thanks again!

I'll keep you posted.

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

2 participants