Bug 1277707 - Binaries for customer installed gems will not be found
Binaries for customer installed gems will not be found
Status: CLOSED ERRATA
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Build (Show other bugs)
5.5.0
Unspecified Unspecified
high Severity high
: GA
: 5.5.0
Assigned To: Joe Vlcek
Pete Savage
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-11-03 16:23 EST by Joe Vlcek
Modified: 2015-12-08 08:43 EST (History)
8 users (show)

See Also:
Fixed In Version: 5.5.0.11
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-12-08 08:43:33 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Joe Vlcek 2015-11-03 16:23:37 EST
Description of problem:

If a customer installs a ruby gem that contains binaries the binaries
will not be found in $PATH

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. Boot a CFME appliance.
2. % cd /var/www/miq/vmdb
3. % gem install <any gem that contains a binary>
   e.g.: % gem install gempath
4. % which gempath
   /usr/bin/which: no gempath in<... BLA BLA BLA>

Actual results:

Binary was not found in $PATH

Expected results:

The binary included in the installed gem should be found in $PATH

Additional info:

Work around is to update $PATH as follows:

1. % PATH=$PATH:/opt/rh/rh-ruby22/root/usr/local/bin/
2. % which gempath
   /opt/rh/rh-ruby22/root/usr/local/bin/gempath

3. % gempath ovirt
   /opt/rh/cfme-gemset/gems/ovirt-0.6.0


The fix is to upate PATH in the enable script when it is created
in the RPM spec for cfme-gemset.

On appliance see:
 /opt/rh/cfme-gemset/enable
Comment 2 Jason Frey 2015-11-17 12:52:52 EST
JoeV is writing a fix into the cfme-gemset enable script to add /opt/rh/rh-ruby22/root/usr/local/bin to the PATH, which should solve this issue.

However, the real problem is in the SCL, as *that* package should be adding that to the PATH.  I am going to open a separate ticket with them to get that added.
Comment 3 Joe Vlcek 2015-11-17 13:47:50 EST
The diff to the cfme-gemset.spec:

diff --git a/cfme-gemset.spec b/cfme-gemset.spec
index c108356..4b75bfc 100644
--- a/cfme-gemset.spec
+++ b/cfme-gemset.spec
@@ -2,7 +2,7 @@
 
 Name:      cfme-gemset
 Version:   5.5.0.10
-Release:   beta2.1.1%{?dist}
+Release:   beta2.1.2%{?dist}
 Summary:   CloudForms Management Engine Gemset
 Group:     Applications/System
 License:   "GPLv2+, Apache Public License 2.0, The MIT License and Ruby License"
@@ -20,7 +20,7 @@ cat <<"EOF" > enable
 export APPLIANCE="true"
 export BUNDLE_PATH=/opt/rh/cfme-gemset
 export GEM_PATH=/opt/rh/cfme-gemset:$(gem env path)
-export PATH=/opt/rh/cfme-gemset/bin:$PATH
+export PATH=/opt/rh/cfme-gemset/bin:$PATH:/opt/rh/rh-ruby22/root/usr/local/bin/
 
 [[ -f /var/www/miq/vmdb/Gemfile.lock ]] && rm -f /var/www/miq/vmdb/Gemfile.lock
 ln -s /opt/rh/cfme-gemset/vmdb/Gemfile.lock /var/www/miq/vmdb/Gemfile.lock
@@ -66,6 +66,9 @@ rm -rf $RPM_BUILD_ROOT
 %{app_root}/enable
 
 %changelog
+* Tue Nov 17 2015 Joe VLcek <jvlcek@redhat.com> - 5.5.0.10-beta2.1.2
+- Updated enable script to include /opt/rh/rh-ruby22/root/usr/local/bin/ in PATH
+
 * Tue Nov 10 2015 Satoe Imaishi <simaishi@redhat.com> - 5.5.0.10-beta2.1.1
 - Building 5.5.0.10 beta2.1.1
Comment 5 Joe Vlcek 2015-11-17 15:12:42 EST
Note to QE for how to test this fix:

1. Boot and log into a CFME appliance.
2. % cd /var/www/miq/vmdb
3. % gem install <any gem that contains an executable>
   e.g.: % gem install gempath

   The gempath gem happens to contain an executable with the same name.

4. Use the linux which(1) command to display the path to the executable
   included in the gem.
   e.g.: % which gempath

5. Invoke the executable included in the installed gem:
   e.g.: gempath rake

If steps 4 and 5 are successful the fix is working.

6. Run the full suite of CFME tests against this appliance to confirm
   this fix did not adversely effect the appliance.
Comment 6 Pete Savage 2015-11-20 09:26:19 EST
Verified in 5.5.0.11
Comment 8 errata-xmlrpc 2015-12-08 08:43:33 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2015:2551

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