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

fpm is broken on Alpine 3.8 #1534

Closed
alexzorin opened this issue Jul 31, 2018 · 4 comments · Fixed by #1745
Closed

fpm is broken on Alpine 3.8 #1534

alexzorin opened this issue Jul 31, 2018 · 4 comments · Fixed by #1745

Comments

@alexzorin
Copy link

Upgrading to 3.8:

FROM alpine:3.7

leads to errors:

/ # fpm
Traceback (most recent call last):
        12: from /usr/bin/fpm:23:in `<main>'
        11: from /usr/bin/fpm:23:in `load'
        10: from /usr/lib/ruby/gems/2.5.0/gems/fpm-1.10.2/bin/fpm:4:in `<top (required)>'
         9: from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
         8: from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
         7: from /usr/lib/ruby/gems/2.5.0/gems/fpm-1.10.2/lib/fpm.rb:13:in `<top (required)>'
         6: from /usr/lib/ruby/gems/2.5.0/gems/backports-3.11.3/lib/backports/std_lib.rb:9:in `require_with_backports'
         5: from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
         4: from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
         3: from /usr/lib/ruby/gems/2.5.0/gems/fpm-1.10.2/lib/fpm/package/puppet.rb:5:in `<top (required)>'
         2: from /usr/lib/ruby/gems/2.5.0/gems/backports-3.11.3/lib/backports/std_lib.rb:9:in `require_with_backports'
         1: from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
/usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require': cannot load such file -- etc (LoadError)

I am not sure how to interpret the stack trace or what the significance of -- etc is.

@sbocinec
Copy link

Explanation of the error is following:

  • puppet.rb module /usr/lib/ruby/gems/2.5.0/gems/fpm-1.10.2/lib/fpm/package/puppet.rb tries to load etc module: require "etc".
  • etc gem should be part of the default ruby gems since ruby 2.5: https://stdgems.org/
  • however, ruby 2.5.1 shipped with alpine 3.8 does not provide the etc gem:
$ docker run -it --rm alpine ash
/ # apk add ruby
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/community/x86_64/APKINDEX.tar.gz
(1/9) Installing ca-certificates (20171114-r3)
(2/9) Installing gmp (6.1.2-r1)
(3/9) Installing ncurses-terminfo-base (6.1_p20180818-r1)
(4/9) Installing ncurses-terminfo (6.1_p20180818-r1)
(5/9) Installing ncurses-libs (6.1_p20180818-r1)
(6/9) Installing readline (7.0.003-r0)
(7/9) Installing yaml (0.1.7-r0)
(8/9) Installing ruby-libs (2.5.1-r2)
(9/9) Installing ruby (2.5.1-r2)
Executing busybox-1.28.4-r1.trigger
Executing ca-certificates-20171114-r3.trigger
OK: 25 MiB in 22 packages
/ # ruby -v
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux-musl]
/ # gem list

*** LOCAL GEMS ***

cmath (default: 1.0.0)
csv (default: 1.0.0)
date (default: 1.0.0)
fcntl (default: 1.0.0)
fileutils (default: 1.0.2)
ipaddr (default: 1.2.0)
openssl (default: 2.1.0)
psych (default: 3.0.2)
scanf (default: 1.0.0)
stringio (default: 0.0.1)
strscan (default: 1.0.0)
zlib (default: 1.0.0)
  • puppet.rb expects this gems is installed, but it's not

Not sure if this is an alpine's ruby packaging bug (missing default gems) or the wrong assumption of the puppet.rb that all the distributions have etc gem installed as part of the ruby 2.5..

@jordansissel
Copy link
Owner

I'd love to help fix this, but I'm not well versed in Alpine's behaviors. Is this a bug in Alpine's ruby package?

@jordansissel
Copy link
Owner

Alternately, we could try loading etc and if it fails, we can disable whatever requires it in fpm -- this would at least let you do most of fpm's work in the absence of etc library.

@alexzorin
Copy link
Author

Another potential solution seem to be to install the ruby-etc Alpine package in the Dockerfile.

I suppose the fact that a separate Alpine package exists suggests that this is not an Alpine bug but rather an intentional exclusion.

So if you ever upgrade the Dockerfile to 3.8, that could be the way to go.

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

Successfully merging a pull request may close this issue.

3 participants