Foreman Proxy won't start due to ruby load error (Concurrent::Edge::Future)


#1

Problem:
The Foreman proxy systemd job won’t start due to a missing module from the the Concurrent::Future gem.

This was done on a fresh install of the Ubuntu Minimal Server and following the steps from 2.1 in the foreman guide, with additonal plugins when running foreman-install.

Expected outcome:
Foreman Proxy should start
Foreman and Proxy versions:
foreman/bionic,now 1.19.0-1 amd64
foreman-proxy/bionic,bionic,now 1.19.0-1 all

Foreman and Proxy plugin versions:
foreman/bionic,now 1.19.0-1 amd64 [installed,automatic]
foreman-cli/bionic,bionic,now 1.19.0-1 all [installed]
foreman-compute/bionic,bionic,now 1.19.0-1 all [installed,automatic]
foreman-debug/bionic,bionic,now 1.19.0-1 all [installed,automatic]
foreman-ec2/bionic,bionic,now 1.19.0-1 all [installed,automatic]
foreman-installer/bionic,bionic,now 1.19.0-1 all [installed]
foreman-postgresql/bionic,bionic,now 1.19.0-1 all [installed]
foreman-proxy/bionic,bionic,now 1.19.0-1 all [installed,automatic]
foreman-vmware/bionic,bionic,now 1.19.0-1 all [installed]
ruby-foreman-bootdisk/plugins,plugins,now 12.0.0-1 all [installed]
ruby-foreman-deface/plugins,plugins,now 1.2.0-1 all [installed,automatic]
ruby-foreman-discovery/plugins,plugins,now 13.0.1-1 all [installed]
ruby-foreman-docker/plugins,plugins,now 4.1.0-1 all [installed]
ruby-foreman-remote-execution/plugins,plugins,now 1.5.6-1 all [installed]
ruby-foreman-remote-execution-core/bionic,bionic,now 1.1.3-1 all [installed,automatic]
ruby-foreman-setup/plugins,plugins,now 6.0.0-1 all [installed]
ruby-foreman-tasks/plugins,plugins,now 0.13.2-1 all [installed]
ruby-foreman-tasks-core/bionic,bionic,now 0.2.5-1 all [installed,automatic]
ruby-foreman-templates/plugins,plugins,now 6.0.3-1 all [installed]
ruby-hammer-cli-foreman/bionic,bionic,now 0.14.0-1 all [installed,automatic]

Other relevant data:

[ INFO 2018-10-20T19:24:06 verbose]  Class[Foreman_proxy::Service]: Scheduling refresh of Service[foreman-proxy]
[ERROR 2018-10-20T19:24:09 verbose]  /Stage[main]/Foreman_proxy::Service/Service[foreman-proxy]: Failed to call refresh: Systemd restart for foreman-proxy failed!
[ERROR 2018-10-20T19:24:09 verbose] journalctl log for foreman-proxy:
[ERROR 2018-10-20T19:24:09 verbose] -- Logs begin at Tue 2018-10-02 23:10:24 PDT, end at Sat 2018-10-20 19:24:09 PDT. --
[ERROR 2018-10-20T19:24:09 verbose] Oct 20 19:24:06 foreman systemd[1]: Stopping Foreman Proxy...
[ERROR 2018-10-20T19:24:09 verbose] Oct 20 19:24:07 foreman systemd[1]: Stopped Foreman Proxy.
[ERROR 2018-10-20T19:24:09 verbose] Oct 20 19:24:07 foreman systemd[1]: Starting Foreman Proxy...
[ERROR 2018-10-20T19:24:09 verbose] Oct 20 19:24:09 foreman smart-proxy[17308]: /usr/lib/ruby/vendor_ruby/dynflow/director.rb:16:in `block in <class:Director>': uninitialized constant Concurrent::Edge::Future (NameError)
[ERROR 2018-10-20T19:24:09 verbose] Oct 20 19:24:09 foreman smart-proxy[17308]: Did you mean?  Concurrent::Future
[ERROR 2018-10-20T19:24:09 verbose] Oct 20 19:24:09 foreman smart-proxy[17308]:         from /usr/lib/ruby/vendor_ruby/algebrick/dsl.rb:35:in `instance_exec'
[ERROR 2018-10-20T19:24:09 verbose] Oct 20 19:24:09 foreman smart-proxy[17308]:         from /usr/lib/ruby/vendor_ruby/algebrick/dsl.rb:35:in `initialize'
[ERROR 2018-10-20T19:24:09 verbose] Oct 20 19:24:09 foreman smart-proxy[17308]:         from /usr/lib/ruby/vendor_ruby/algebrick/dsl.rb:89:in `new'
[ERROR 2018-10-20T19:24:09 verbose] Oct 20 19:24:09 foreman smart-proxy[17308]:         from /usr/lib/ruby/vendor_ruby/algebrick/dsl.rb:89:in `type'
[ERROR 2018-10-20T19:24:09 verbose] Oct 20 19:24:09 foreman smart-proxy[17308]:         from /usr/lib/ruby/vendor_ruby/dynflow/director.rb:12:in `<class:Director>'
[ERROR 2018-10-20T19:24:09 verbose] Oct 20 19:24:09 foreman smart-proxy[17308]:         from /usr/lib/ruby/vendor_ruby/dynflow/director.rb:9:in `<module:Dynflow>'
[ERROR 2018-10-20T19:24:09 verbose] Oct 20 19:24:09 foreman smart-proxy[17308]:         from /usr/lib/ruby/vendor_ruby/dynflow/director.rb:1:in `<top (required)>'
[ERROR 2018-10-20T19:24:09 verbose] Oct 20 19:24:09 foreman smart-proxy[17308]:         from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
[ERROR 2018-10-20T19:24:09 verbose] Oct 20 19:24:09 foreman smart-proxy[17308]:         from /usr/lib/ruby/vendor_ruby/dynflow.rb:43:in `<module:Dynflow>'
[ERROR 2018-10-20T19:24:09 verbose] Oct 20 19:24:09 foreman smart-proxy[17308]:         from /usr/lib/ruby/vendor_ruby/dynflow.rb:19:in `<top (required)>'
[ERROR 2018-10-20T19:24:09 verbose] Oct 20 19:24:09 foreman smart-proxy[17308]:         from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
[ERROR 2018-10-20T19:24:09 verbose] Oct 20 19:24:09 foreman smart-proxy[17308]:         from /usr/lib/ruby/vendor_ruby/smart_proxy_dynflow_core.rb:1:in `<top (required)>'
[ERROR 2018-10-20T19:24:09 verbose] Oct 20 19:24:09 foreman smart-proxy[17308]:         from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
[ERROR 2018-10-20T19:24:09 verbose] Oct 20 19:24:09 foreman smart-proxy[17308]:         from /usr/lib/ruby/vendor_ruby/bundler_ext/runtime.rb:41:in `block in system_require'
[ERROR 2018-10-20T19:24:09 verbose] Oct 20 19:24:09 foreman smart-proxy[17308]:         from /usr/lib/ruby/vendor_ruby/bundler_ext/runtime.rb:37:in `each'
[ERROR 2018-10-20T19:24:09 verbose] Oct 20 19:24:09 foreman smart-proxy[17308]:         from /usr/lib/ruby/vendor_ruby/bundler_ext/runtime.rb:37:in `system_require'
[ERROR 2018-10-20T19:24:09 verbose] Oct 20 19:24:09 foreman smart-proxy[17308]:         from /usr/lib/ruby/vendor_ruby/bundler_ext.rb:19:in `block in system_require'
[ERROR 2018-10-20T19:24:09 verbose] Oct 20 19:24:09 foreman smart-proxy[17308]:         from /usr/lib/ruby/vendor_ruby/bundler_ext.rb:14:in `each'
[ERROR 2018-10-20T19:24:09 verbose] Oct 20 19:24:09 foreman smart-proxy[17308]:         from /usr/lib/ruby/vendor_ruby/bundler_ext.rb:14:in `system_require'
[ERROR 2018-10-20T19:24:09 verbose] Oct 20 19:24:09 foreman smart-proxy[17308]:         from /usr/share/foreman-proxy/lib/bundler_helper.rb:22:in `require_groups'
[ERROR 2018-10-20T19:24:09 verbose] Oct 20 19:24:09 foreman smart-proxy[17308]:         from /usr/share/foreman-proxy/lib/smart_proxy_main.rb:33:in `<top (required)>'
[ERROR 2018-10-20T19:24:09 verbose] Oct 20 19:24:09 foreman smart-proxy[17308]:         from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
[ERROR 2018-10-20T19:24:09 verbose] Oct 20 19:24:09 foreman smart-proxy[17308]:         from /usr/share/foreman-proxy/bin/smart-proxy:5:in `<main>'
[ERROR 2018-10-20T19:24:09 verbose] Oct 20 19:24:09 foreman systemd[1]: foreman-proxy.service: Main process exited, code=exited, status=1/FAILURE
[ERROR 2018-10-20T19:24:09 verbose] Oct 20 19:24:09 foreman systemd[1]: foreman-proxy.service: Failed with result 'exit-code'.
[ERROR 2018-10-20T19:24:09 verbose] Oct 20 19:24:09 foreman systemd[1]: Failed to start Foreman Proxy.
[ERROR 2018-10-20T19:24:09 verbose]  /Stage[main]/Foreman_proxy::Service/Service[foreman-proxy]: Systemd restart for foreman-proxy failed!


Service[foreman-proxy]: Systemd restart for foreman-proxy failed!
#2

This is a known issue, stemming from the way the concurrent(-edge) gems are kept in one git repo, resulting in two gems and the (upstream) Debian packaging vs. gem packaging. Long story short: I didn’t have time, yet, to solve this, it will still take while and the solution is not going to be pretty.


#3

Looking at the latest stable release of concurrent-ruby, Concurrent::Future::Edge doesn’t exist, nor does it exist in the master branch.

I changed all the references of Concurrent::Edge::Future to Concurrent::Future in dynproxy and now smart-proxy starts.

Not sure it what this changes, I’m not familiar with either projects.


#4

That might have unblocked you for now, but I’m quite sure this will (depending on your usage) cause more issue down the road. As far as I know the interface changed much more than just renaming Concurrent::Edge::Future to Concurrent::Future.

So far the only parts that use Dynflow on the smart-proxy are ansible and remote-execution. So if you don’t use those, you’ll be fine.


#5

Is there another workaround? I’m new to foreman and hit this issue as well installing remote execution on the same smart proxy everything else is on on foreman host. Would it function if I deployed a new smart proxy on another OS for ansible / remote execution? Older debian package on that other host? Foreman was deployed to Ubuntu 18.04 fwiw. Just trying to see what my options are, if any, as I’m pretty new to foreman ecosystem.


#6

As far as I know deployments on EL-derivatives don’t suffer from this issue. Using older debian packages should work in theory, if you can find them somewhere.


Missing packages ruby-concurrent*?
#7

Is there any work-a-round for installing foreman-proxy? Just ran into this issue while trying to install foreman 1.20. Now I can’t revert back to 1.19 due to this error.


#8

Any updates to this or any way to install foreman-proxy 1.20 on Ubuntu 16.04? Thanks


#9

Happy New Year. I still have this problem, is there any work-a-round?


#10

I found this issue which has a work-a-round! Its now working for me.
https://projects.theforeman.org/issues/25716


Service[foreman-proxy]: Systemd restart for foreman-proxy failed!
#11

Hey @Conzar, this appears to be unrelated to the error message seen here. Can you confirm what your situation was?


#12

The foreman proxy failed to start. Installation is managed by the foreman puppet modules not the foreman installer script. Ensuring the package ‘ruby-logging’ installed fixed the problem with foreman proxy from not being able to start. Hope that answers your question.


#13

Okay it’s just that while the symptom is the same, e.g. the proxy isn’t starting, the error is different.

Here it’s…
smart-proxy[977]: /usr/lib/ruby/vendor_ruby/dynflow/director.rb:16:in \`block in <class:Director>': uninitialized constant Concurrent::Edge::Future (NameError)

While in solution you linked to, it’s…
smart-proxy[7075]: /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- logging (LoadError)

So while the workaround worked for you, it’s not related to fixing this issue. I think. :stuck_out_tongue:

We seem to have overlapping discussion with Service[foreman-proxy]: Systemd restart for foreman-proxy failed!.


#14

Is there any news on this issue? Today I upgraded our foreman instance to 1.20.2, hoping we could finally start using the tasks, but sadly I still get the same Concurrent::Edge::Future on Debian 9.8.

A work-around would also be fine. The only solution I found was removing the foreman-task package.


#15

i confirm having the same issue with Ubuntu 18.04.
Foreman version 1.21.2

/usr/lib/ruby/vendor_ruby/dynflow/director.rb:16:in `block in
class:Director’: uninitialized constant Concurrent::Edge::Future
(NameError)`


#16

Hi!
Is there any progress on this issue?

I’ve read on the ruby-concurrency github page “Features developed in concurrent-ruby-edge are expected to move to concurrent-ruby when final.”

So, I assumed that in recent Debian 9 / Ubuntu 18.04 LTS packages, where concurrent-ruby-edge are not available any more, that it could have been declared final by the devs.
I’ve successfully started foreman-proxy, by replacing every occurance of “Concurrent::Edge::Future” by
“Concurrent::Future”.
In Detail:
/usr/lib/ruby/vendor_ruby/dynflow/director.rb +16
/usr/lib/ruby/vendor_ruby/dynflow/world.rb +135
/usr/lib/ruby/vendor_ruby/dynflow/dispatcher/client_dispatcher.rb +7

I’m not a ruby programmer, and also don’t know how to get this fixed upstream.


#17

Getting the same error after upgrading. Unfortunately replacing these instances only allowed me to start the foreman-proxy service, now when the proxy is getting queried I am getting a new error. Will there be a fix soon? It seems like the latest version is completely broken for Debian/Ubuntu.

2019-05-09T14:15:07 [D] accept: 10.240.3.65:35976
2019-05-09T14:15:07 [D] Rack::Handler::WEBrick is invoked.
W, [2019-05-09T14:15:07.186187 #9502] WARN – : Could not open DB for dynflow at ‘’, will keep data in memory. Restart will drop all dynflow data.
2019-05-09T14:15:07 [W] Error details
NoMethodError: undefined method future' for Concurrent:Module /usr/lib/ruby/vendor_ruby/dynflow/world.rb:365:inspawn_and_wait’
/usr/lib/ruby/vendor_ruby/dynflow/world.rb:24:in initialize' /usr/lib/ruby/vendor_ruby/smart_proxy_dynflow_core/core.rb:18:innew’
/usr/lib/ruby/vendor_ruby/smart_proxy_dynflow_core/core.rb:18:in create_world' /usr/lib/ruby/vendor_ruby/smart_proxy_dynflow_core/core.rb:6:ininitialize’
/usr/lib/ruby/vendor_ruby/smart_proxy_dynflow_core/core.rb:74:in new' /usr/lib/ruby/vendor_ruby/smart_proxy_dynflow_core/core.rb:74:inensure_initialized’
/usr/lib/ruby/vendor_ruby/smart_proxy_dynflow_core/core.rb:101:in block in web_console' /usr/lib/ruby/vendor_ruby/dynflow/web.rb:10:ininstance_exec’
/usr/lib/ruby/vendor_ruby/dynflow/web.rb:10:in block in setup' /usr/lib/ruby/vendor_ruby/sinatra/base.rb:2024:inclass_eval’
/usr/lib/ruby/vendor_ruby/sinatra/base.rb:2024:in new' /usr/lib/ruby/vendor_ruby/dynflow/web.rb:10:insetup’
/usr/lib/ruby/vendor_ruby/smart_proxy_dynflow_core/core.rb:89:in web_console' /usr/lib/ruby/vendor_ruby/smart_proxy_dynflow_core/launcher.rb:40:inblock in route_mapping’
/usr/lib/ruby/vendor_ruby/rack/builder.rb:55:in instance_eval' /usr/lib/ruby/vendor_ruby/rack/builder.rb:55:ininitialize’
/usr/lib/ruby/vendor_ruby/rack/builder.rb:160:in new' /usr/lib/ruby/vendor_ruby/rack/builder.rb:160:inblock in generate_map’
/usr/lib/ruby/vendor_ruby/rack/builder.rb:160:in each' /usr/lib/ruby/vendor_ruby/rack/builder.rb:160:ingenerate_map’
/usr/lib/ruby/vendor_ruby/rack/builder.rb:145:in to_app' /usr/lib/ruby/vendor_ruby/rack/builder.rb:160:inblock in generate_map’
/usr/lib/ruby/vendor_ruby/rack/builder.rb:160:in each' /usr/lib/ruby/vendor_ruby/rack/builder.rb:160:ingenerate_map’
/usr/lib/ruby/vendor_ruby/rack/builder.rb:145:in to_app' /usr/lib/ruby/vendor_ruby/rack/builder.rb:153:incall’
/usr/lib/ruby/vendor_ruby/rack/handler/webrick.rb:88:in service' /usr/lib/ruby/2.5.0/webrick/httpserver.rb:140:inservice’
/usr/lib/ruby/2.5.0/webrick/httpserver.rb:96:in run' /usr/lib/ruby/2.5.0/webrick/server.rb:307:inblock in start_thread’
/usr/lib/ruby/vendor_ruby/logging/diagnostic_context.rb:474:in block in create_with_logging_context' 2019-05-09T14:15:07 [E] undefined methodfuture’ for Concurrent:Module (NoMethodError)
2019-05-09T14:15:07 [D] close: 10.240.3.65:35976


#18

Hi,
I manage to avoid the problem (not to solve it) doing this steps:

  • Changing “Concurrent::Edge::Future” by “Concurrent::Future” as sseitz said in those files
  • Disabling dynflow, edit /etc/foreman-proxy/settings.d/dynflow.yml and change :enabled: to false
  • Restart foreman-proxy service
  • run foreman-installer --no-enable-foreman-proxy-plugin-dynflow

I think that all this concurrent::future stuff is directly related to dynflow console, and disabling it avoids the problem, but, take into consideration that this may also disables other features.

Hope that this helps