adam-stokes / juju-layer-ruby

Juju charms.reactive layer for Ruby
MIT License
3 stars 3 forks source link

Install failed with "cannot run /bin/bash tool/config.sub" #15

Closed mthaddon closed 5 years ago

mthaddon commented 5 years ago

I've got a charm that's using the ruby layer (cs:~mthaddon/discourse-1), and failing on install with the following error:

2019-09-04 09:29:46 INFO juju-log Running compile command: env RUBY_CFLAGS="-O3" ./configure --prefix=/usr --disable-install-rdoc 2019-09-04 09:29:47 INFO juju-log Problem with Ruby: ['configure: error: cannot run /bin/bash tool/config.sub'] 2019-09-04 09:29:47 ERROR juju.worker.uniter.operation runhook.go:132 hook "install" failed: exit status 1 2019-09-04 09:29:47 INFO juju.worker.uniter resolver.go:126 awaiting error resolution for "install" hook

I tried adding ruby to the packages to be installed after seeing a similar error in https://github.com/rubyomr-preview/rubyomr-preview/issues/22 that suggested ruby needs ruby to install, and that gets a bit further but fails because my environment doesn't have access to https://raw.githubusercontent.com/gcc-mirror/gcc/master/config.guess/.

Rather than opening access to this first I've logged this issue to confirm what the right solution is.

adam-stokes commented 5 years ago

Thanks for the report, what do you think of allowing both ability to compile ruby from source and just use whatever is in the archives for the series you are deploying to? I'd like to fix the compile issue but I also want to unblock you

mthaddon commented 5 years ago

Unfortunately the version in the archive (for bionic) is 2.5.1 and in this case discourse seems to need at least 2.5.2, so that wouldn't work for us.

adam-stokes commented 5 years ago

ok, lemme take a look

adam-stokes commented 5 years ago

The new layer has been released, @mthaddon can you re-run your charm to see if things are working?

mthaddon commented 5 years ago

Seeing the following:

Traceback (most recent call last):
  File "/var/lib/juju/agents/unit-discourse-0/.venv/lib/python3.6/site-packages/charms/reactive/__init__.py", line 74, in main
    bus.dispatch(restricted=restricted_mode)
  File "/var/lib/juju/agents/unit-discourse-0/.venv/lib/python3.6/site-packages/charms/reactive/bus.py", line 390, in dispatch
    _invoke(other_handlers)
  File "/var/lib/juju/agents/unit-discourse-0/.venv/lib/python3.6/site-packages/charms/reactive/bus.py", line 359, in _invoke
    handler.invoke()
  File "/var/lib/juju/agents/unit-discourse-0/.venv/lib/python3.6/site-packages/charms/reactive/bus.py", line 181, in invoke
    self._action(*args)
  File "/var/lib/juju/agents/unit-discourse-0/charm/reactive/discourse.py", line 117, in install_discourse
    bundle('install')
  File "lib/charms/layer/ruby.py", line 46, in bundle
    from sh import bundler as _bundler_internal
ImportError: cannot import name 'bundler'

As discussed IRL should be "bundle" rather than "bundler".

mthaddon commented 5 years ago

I believe this issue is now resolved.