Bug 993250 - Broker plugins and other gem problems lead to recommendation to run "bundle install"
Broker plugins and other gem problems lead to recommendation to run "bundle i...
Product: OpenShift Origin
Classification: Red Hat
Component: Pod (Show other bugs)
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Luke Meyer
libra bugs
Depends On:
Blocks: 993252
  Show dependency treegraph
Reported: 2013-08-05 13:26 EDT by Luke Meyer
Modified: 2015-05-14 22:20 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 993252 (view as bug list)
Last Closed: 2014-01-23 22:21:29 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Luke Meyer 2013-08-05 13:26:44 EDT
Description of problem:
When there is a problem with the broker Gemfile or Gemfile.lock, invocation of Bundler via command line tools based on the broker will fail with a message recommending running "bundle install" which in most cases, is not what we want the user to do - we would like people to use the gems supplied by RPMs we have packaged and tested. "bundle install" installs gems from rubygem.org with unpredictable / unsupportable results.

How reproducible:
This happens frequently during installs when broker plugin conf gets messed up in one way or another (typo, missed RPM install, etc.) and also due to yum update when gem RPMs are updated but the broker not restarted. 

Steps to Reproduce:
1. touch /etc/openshift/plugins.d/openshift-origin-foo.conf
2. Run "oo-admin-clear-pending-ops" or similar
3. rm /etc/openshift/plugins.d/openshift-origin-foo.conf
4. Edit /var/www/openshift/broker/Gemfile.lock and change specific version of a gem, e.g. set bigdecimal (1.2.1)
5. Run "oo-admin-ctl-district" or similar

Actual results:
# oo-admin-clear-pending-ops 
Could not find gem 'openshift-origin-foo (>= 0) ruby' in the gems available on this machine.
Run `bundle install` to install missing gems.

# oo-admin-ctl-district 
Could not find bigdecimal-1.2.1 in any of the sources
Run `bundle install` to install missing gems.

Expected results:
Something telling you that you need to change plugin config, install RPMs, or rm Gemfile.lock (running any of these generates it if it's missing).

Additional info:
Commands that really should give helpful output under these conditions, being frequently used around install/upgrade scenarios:

oo-admin-broker-cache --clear
Comment 1 Luke Meyer 2013-08-05 16:08:22 EDT
https://github.com/openshift/origin-server/pull/3294 should wrap Bundler errors in most situations. However, it actually doesn't for most of the above scripts; but at least they do not recommend "bundle install" which is the most important thing. I am hesitant to make changes to these that would improve the messaging... most would likely break things in under certain scenarios.
Comment 2 openshift-github-bot 2013-08-14 07:07:02 EDT
Commit pushed to master at https://github.com/openshift/origin-server

<broker> improve Gemfile loading + bug 993250

Bundler load failures are wrapped and re-interpreted for OpenShift
  instead of telling the user to "bundle install"
OPENSHIFT_CONF_DIR overrides /etc/openshift base for broker config files
Gemfile loads plugins even if just the -dev.conf file is present
Plugins are loaded in sorted order, in case it matters
Comment 3 Jianwei Hou 2013-11-15 03:45:27 EST
Verified with latest origin build

The user won't be informed to run 'bundle install', instead, they will be adviced to install the rpm packages.

[root@broker ~]# oo-admin-clear-pending-ops
Error while loading gems for the broker:
Could not find gem 'openshift-origin-auth-mongo (>= 0) ruby' in the gems available on this machine.
You may need to install the rubygem-openshift-origin-auth-mongo RPM.
Or, you may need to remove/rename the openshift-origin-auth-mongo conf file(s) in /etc/openshift/plugins.d

Note You need to log in before you can comment on or make changes to this bug.