Bug 1135062 - SCL mongodb commands aren't in PATH for gears using mongodb-2.4 cart
Summary: SCL mongodb commands aren't in PATH for gears using mongodb-2.4 cart
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Containers
Version: 2.1.0
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: ---
: ---
Assignee: John W. Lamb
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks: 1135938
TreeView+ depends on / blocked
 
Reported: 2014-08-28 18:38 UTC by John W. Lamb
Modified: 2014-09-17 17:03 UTC (History)
8 users (show)

Fixed In Version: openshift-origin-cartridge-mongodb-1.19.3.4-1.el6op
Doc Type: Bug Fix
Doc Text:
The MongoDB cartridge did not properly include the PATH and LD_LIBRARY_PATH entries provided by Red Hat Software Collections (SCL) in the cartridge environment, and did not publish the appropriate PATH elements for scaled cartridges. This caused the appropriate PATH and LD_LIBRARY_PATH entries for the mongo support binaries provided by SCL, such as mongoimport, to not be set, and were therefore not available to gear action hooks. This bug fix updates the MongoDB cartridge to include the appropriate PATH and LD_LIBRARY_PATH entries for non-scaled cartridges. It also provides a new connection hook that publishes OPENSHIFT_MONGODB_LD_LIBRARY_PATH_ELEMENT and OPENSHIFT_MONGODB_PATH_ELEMENT, included by scaled cartridges in the primary cartridge's PATH and LD_LIBRARY_PATH environment variable. As a result, the correct mongo binaries are now available from the command line and gear action hooks for scaled and non-scaled applications. See https://access.redhat.com/articles/1179613 for instructions on applying this fix to existing gears.
Clone Of:
: 1135938 (view as bug list)
Environment:
Last Closed: 2014-09-11 20:06:55 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2014:1183 0 normal SHIPPED_LIVE Red Hat OpenShift Enterprise 2.1.6 bug fix and enhancement update 2014-09-12 00:06:21 UTC

Description John W. Lamb 2014-08-28 18:38:31 UTC
Description of problem:

The gear PATH variable doesn't reference the correct directory for the binaries included with SCL MongoDB package mongodb24-mongodb.

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

openshift-origin-cartridge-mongodb-1.19.3.2-1.el6op.noarch

How reproducible:

100%

Steps to Reproduce:
1. Create an app with a mongo cartridge
# rhc app-create -s mongoapp1 diy-0.1 mongodb-2.4 --no-git --no-dns
2. SSH into the primary gear
# rhc ssh mongoapp1
3. Try to run any mongodb binary other than "mongo" (which is provided as an alias in rhcsh):
[mongoapp1 53abcd]\> mongoimport --version

Actual results:
On systems with the non-scl "mongodb" package installed (e.g. all-in-one broker/node hosts):
[mongoapp1 53abcd]\> mongoimport --version
mongoimport version 2.4.6
[mongoapp1 53abcd]\> type mongoimport
mongoimport is hashed (/usr/bin/mongoimport)

On systems with only the scl "mongodb24-mongodb" package installed (e.g. typical standalone node setup):
[mongoapp1 53abcd]\> mongoimport --version
bash: mongoimport: command not found

Expected results:
The mongoimport version should be 2.4.9, and the path should be the SCL-set path "/opt/rh/mongodb24/root/usr/bin":
[mongoapp1 53abcd]\> mongoimport --version
mongoimport version 2.4.9
[mongoapp1 53abcd]\> type mongoimport
mongoimport is hashed (/opt/rh/mongodb24/root/usr/bin/mongoimport)

Additional info:
This can be worked around by using the scl tools:
[mongoapp1 53abcd]\> scl enable mongodb24 "mongoimport --version"
mongoimport version 2.4.9

Comment 5 Anping Li 2014-08-29 06:21:25 UTC
Verified and pass on puddle-2014-08-28.1
For the new create apps, mongoimport works. 
For old apps with mongodb-2.4, after reloaded cartridges and executed the mongodb connection-hooks, mongoimport works.

Comment 6 Anping Li 2014-08-29 06:43:10 UTC
I reloaded cartridge using oo-cartridge rather than oo-admin-upgrade. 
oo-admin-upgrade doesn't work since the mongodb cartridge version doesn't changed. Shall we update the cartridge version?

Comment 7 John W. Lamb 2014-08-29 14:25:50 UTC
(In reply to Anping Li from comment #6)
> I reloaded cartridge using oo-cartridge rather than oo-admin-upgrade. 
> oo-admin-upgrade doesn't work since the mongodb cartridge version doesn't
> changed. Shall we update the cartridge version?

Good catch; will take care of that today

Comment 8 Jason DeTiberus 2014-09-02 14:09:12 UTC
http://etherpad.corp.redhat.com/puddle-2-1-2014-08-29

Comment 9 Anping Li 2014-09-03 05:26:50 UTC
Verified and pass on puddle-2-1-2014-08-29

1. Update Openshift to ose-2.16 from ose-2.15
1).  update to puddle-2-1-2014-08-29 from ose-2.15 
    #yum update
2).  import new cartridges to broker
    #oo-admin-ctl-cartridge -c import-node --activate
3).  load new version of cartridge for all gears
    #oo-admin-upgrade upgrade-node  --version=2.16
4).  run run-mongodb-connection-hooks.rb
    #wget https://raw.githubusercontent.com/dobbymoodge/openshift-extras/sclmongo/admin/run-mongodb-connection-hooks.rb
    #chmod +x run-mongodb-connection-hooks.rb
    #./run-mongodb-connection-hooks.rb

2. "mongoimport --version" take effect on new created app.

3. "mongoimport --version" take effect on apps created in ose-2.15

Comment 11 errata-xmlrpc 2014-09-11 20:06:55 UTC
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.

http://rhn.redhat.com/errata/RHBA-2014-1183.html


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