anycable-rails: Docker with ruby alpine image throws error

I am getting the following when running bundle exec anycable. I guess that some library is missing in ruby alpine?

Edit: it does not only happen with alpine, I tried slim image too, same error

-- Control frame information -----------------------------------------------
c:0027 p:---- s:0158 e:000157 CFUNC  :add_http2_port
c:0026 p:0029 s:0152 e:000151 METHOD /usr/local/lib/ruby/2.6.0/forwardable.rb:230
c:0025 p:0012 s:0145 e:000144 BLOCK  /usr/local/bundle/gems/anycable-0.6.1/lib/anycable/server.rb:121 [FINISH]
c:0024 p:---- s:0141 e:000140 CFUNC  :tap
c:0023 p:0018 s:0137 e:000136 METHOD /usr/local/bundle/gems/anycable-0.6.1/lib/anycable/server.rb:120
c:0022 p:0047 s:0132 e:000131 METHOD /usr/local/bundle/gems/anycable-0.6.1/lib/anycable/server.rb:73 [FINISH]
c:0021 p:---- s:0124 e:000123 CFUNC  :new
c:0020 p:0196 s:0119 e:000118 METHOD /usr/local/bundle/gems/anycable-0.6.1/lib/anycable/cli.rb:51
c:0019 p:0033 s:0112 e:000111 TOP    /usr/local/bundle/gems/anycable-0.6.1/bin/anycable:7 [FINISH]
c:0018 p:---- s:0107 e:000106 CFUNC  :load
c:0017 p:0109 s:0102 e:000101 TOP    /usr/local/bundle/bin/anycable:23 [FINISH]
c:0016 p:---- s:0097 e:000096 CFUNC  :load
c:0015 p:0129 s:0092 e:000091 METHOD /usr/local/lib/ruby/2.6.0/bundler/cli/exec.rb:74
c:0014 p:0075 s:0083 e:000082 METHOD /usr/local/lib/ruby/2.6.0/bundler/cli/exec.rb:28
c:0013 p:0026 s:0078 e:000077 METHOD /usr/local/lib/ruby/2.6.0/bundler/cli.rb:463
c:0012 p:0064 s:0073 e:000072 METHOD /usr/local/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor/command.rb:27
c:0011 p:0047 s:0065 e:000064 METHOD /usr/local/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor/invocation.rb:126
c:0010 p:0261 s:0058 e:000057 METHOD /usr/local/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor.rb:387
c:0009 p:0009 s:0045 e:000044 METHOD /usr/local/lib/ruby/2.6.0/bundler/cli.rb:27
c:0008 p:0064 s:0040 e:000039 METHOD /usr/local/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor/base.rb:466
c:0007 p:0009 s:0033 e:000032 METHOD /usr/local/lib/ruby/2.6.0/bundler/cli.rb:18
c:0006 p:0076 s:0027 e:000026 BLOCK  /usr/local/lib/ruby/gems/2.6.0/gems/bundler-1.17.2/exe/bundle:30
c:0005 p:0002 s:0021 e:000020 METHOD /usr/local/lib/ruby/2.6.0/bundler/friendly_errors.rb:124
c:0004 p:0048 s:0016 E:000750 TOP    /usr/local/lib/ruby/gems/2.6.0/gems/bundler-1.17.2/exe/bundle:22 [FINISH]
c:0003 p:---- s:0013 e:000012 CFUNC  :load
c:0002 p:0109 s:0008 E:000ad0 EVAL   /usr/local/bin/bundle:23 [FINISH]
c:0001 p:0000 s:0003 E:000e70 (none) [FINISH]

-- Ruby level backtrace information ----------------------------------------
/usr/local/bin/bundle:23:in `<main>'
/usr/local/bin/bundle:23:in `load'
/usr/local/lib/ruby/gems/2.6.0/gems/bundler-1.17.2/exe/bundle:22:in `<top (required)>'
/usr/local/lib/ruby/2.6.0/bundler/friendly_errors.rb:124:in `with_friendly_errors'
/usr/local/lib/ruby/gems/2.6.0/gems/bundler-1.17.2/exe/bundle:30:in `block in <top (required)>'
/usr/local/lib/ruby/2.6.0/bundler/cli.rb:18:in `start'
/usr/local/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
/usr/local/lib/ruby/2.6.0/bundler/cli.rb:27:in `dispatch'
/usr/local/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
/usr/local/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/usr/local/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/usr/local/lib/ruby/2.6.0/bundler/cli.rb:463:in `exec'
/usr/local/lib/ruby/2.6.0/bundler/cli/exec.rb:28:in `run'
/usr/local/lib/ruby/2.6.0/bundler/cli/exec.rb:74:in `kernel_load'
/usr/local/lib/ruby/2.6.0/bundler/cli/exec.rb:74:in `load'
/usr/local/bundle/bin/anycable:23:in `<top (required)>'
/usr/local/bundle/bin/anycable:23:in `load'
/usr/local/bundle/gems/anycable-0.6.1/bin/anycable:7:in `<top (required)>'
/usr/local/bundle/gems/anycable-0.6.1/lib/anycable/cli.rb:51:in `run'
/usr/local/bundle/gems/anycable-0.6.1/lib/anycable/cli.rb:51:in `new'
/usr/local/bundle/gems/anycable-0.6.1/lib/anycable/server.rb:73:in `initialize'
/usr/local/bundle/gems/anycable-0.6.1/lib/anycable/server.rb:120:in `build_server'
/usr/local/bundle/gems/anycable-0.6.1/lib/anycable/server.rb:120:in `tap'
/usr/local/bundle/gems/anycable-0.6.1/lib/anycable/server.rb:121:in `block in build_server'
/usr/local/lib/ruby/2.6.0/forwardable.rb:230:in `add_http2_port'
/usr/local/lib/ruby/2.6.0/forwardable.rb:230:in `add_http2_port'

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 18 (7 by maintainers)

Most upvoted comments

I was getting:

/usr/local/bundle/gems/google-protobuf-3.12.2/lib/google/protobuf.rb:51:in `require': Error relocating /usr/local/bundle/gems/google-protobuf-3.12.2/lib/google/protobuf_c.so: __va_copy: symbol not found - /usr/local/bundle/gems/google-protobuf-3.12.2/lib/google/protobuf_c.so (LoadError)
	from /usr/local/bundle/gems/google-protobuf-3.12.2/lib/google/protobuf.rb:51:in `rescue in <top (required)>'
	from /usr/local/bundle/gems/google-protobuf-3.12.2/lib/google/protobuf.rb:48:in `<top (required)>'
	from -e:1:in `require'
	from -e:1:in `<main>'
/usr/local/bundle/gems/google-protobuf-3.12.2/lib/google/protobuf.rb:49:in `require': cannot load such file -- google/2.7/protobuf_c (LoadError)
	from /usr/local/bundle/gems/google-protobuf-3.12.2/lib/google/protobuf.rb:49:in `<top (required)>'
	from -e:1:in `require'
	from -e:1:in `<main>'

Adding this, helped:

RUN bundle config build.google-protobuf --with-cflags=-D__va_copy=va_copy
RUN BUNDLE_FORCE_RUBY_PLATFORM=1 bundle install

But still getting error, initially discussed in this thread 😦 ** Works in Docker, just had problems with docker-compose setup…

Hi @palkan yes, I did see that example and I had the same basically. I didn’t want to waste too much time with it so I switched back to Debian and all is good. Thanks