Bug 1154063

Summary: "Permission denied" for /bin/rpm when run "gear restart" inside gear
Product: OpenShift Container Platform Reporter: Brenton Leanhardt <bleanhar>
Component: ContainersAssignee: Brenton Leanhardt <bleanhar>
Status: CLOSED ERRATA QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.2.0CC: adellape, cryan, jhonce, jokerman, libra-bugs, libra-onpremise-devel, mfojtik, mmccomas, wjiang, wzheng, xiama
Target Milestone: ---Keywords: Upstream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openshift-origin-util-scl-1.20.1.1-1 Doc Type: Bug Fix
Doc Text:
Previously, attempting to restart a gear from within an SSH session failed with a permission error. This issue was due to the gear restart process using the oo-exec-ruby command, which used the rpm command to check the Ruby version. This bug fix updates the oo-exec-ruby command to use the "/usr/bin/ruby --version" command instead of the rpm command, and as a result gears can now be restarted successfully from within an SSH session.
Story Points: ---
Clone Of: 1153889 Environment:
Last Closed: 2014-12-10 13:24:26 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1153889    
Bug Blocks:    

Description Brenton Leanhardt 2014-10-17 12:32:59 UTC
+++ This bug was initially created as a clone of Bug #1153889 +++

Description:
Below information appears when run "gear restart" inside gear:
[php-w.dev.rhcloud.com 5440bda64079701da0000025]\> gear restart
/usr/bin/oo-exec-ruby: line 8: /bin/rpm: Permission denied
Cart to restart?
1. php-5.4
?  1
Restarting PHP 5.4 cartridge (Apache+mod_php)
Application directory "/" selected as DocumentRoot
/usr/bin/oo-exec-ruby: line 8: /bin/rpm: Permission denied
/usr/bin/oo-exec-ruby: line 8: /bin/rpm: Permission denied
/usr/bin/oo-exec-ruby: line 8: /bin/rpm: Permission denied
/usr/bin/oo-exec-ruby: line 8: /bin/rpm: Permission denied
/usr/bin/oo-exec-ruby: line 8: /bin/rpm: Permission denied

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

How reproducible:
always

steps to Reproduce:
1. Create an app
2. SSH to the app and run "gear restart"

Actual results:
There will a permission denied warning appears.

Expected results:
It should run without warning

Additional info:
1. [php-w.dev.rhcloud.com 5440bda64079701da0000025]\> ls -al /bin/rpm
-rwxr-x---. 1 root wheel 30600 Sep 12  2013 /bin/rpm
2. This permission warning also appears during git push.

--- Additional comment from weiwei jiang on 2014-10-17 04:15:07 EDT ---

This issue also can be reproduced when git push back to app head gear.

$ git push 
Counting objects: 5, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 270 bytes, done.
Total 3 (delta 2), reused 0 (delta 0)
remote: /usr/bin/oo-exec-ruby: line 8: /bin/rpm: Permission denied
remote: Stopping Python 2.6 cartridge
remote: Waiting for stop to finish
remote: Waiting for stop to finish
remote: Waiting for stop to finish
remote: Stopping MySQL 5.1 cartridge
remote: /usr/bin/oo-exec-ruby: line 8: /bin/rpm: Permission denied
remote: Building git ref 'master', commit b0d19f1
remote: /usr/bin/oo-exec-ruby: line 8: /bin/rpm: Permission denied
remote: Activating virtenv
remote: Running setup.py script..
remote: running develop
remote: running egg_info
remote: creating YourAppName.egg-info
remote: writing requirements to YourAppName.egg-info/requires.txt
remote: writing YourAppName.egg-info/PKG-INFO
remote: writing top-level names to YourAppName.egg-info/top_level.txt
remote: writing dependency_links to YourAppName.egg-info/dependency_links.txt
remote: writing requirements to YourAppName.egg-info/requires.txt
remote: writing YourAppName.egg-info/PKG-INFO
remote: writing top-level names to YourAppName.egg-info/top_level.txt
remote: writing dependency_links to YourAppName.egg-info/dependency_links.txt
remote: writing manifest file 'YourAppName.egg-info/SOURCES.txt'
remote: reading manifest file 'YourAppName.egg-info/SOURCES.txt'
remote: writing manifest file 'YourAppName.egg-info/SOURCES.txt'
remote: running build_ext
remote: Creating /var/lib/openshift/5440f498ef46d6d849000001/app-root/runtime/dependencies/python/virtenv/lib/python2.6/site-packages/YourAppName.egg-link (link to .)
remote: Adding YourAppName 1.0 to easy-install.pth file
remote: 
remote: Installed /var/lib/openshift/5440f498ef46d6d849000001/app-root/runtime/repo
remote: Processing dependencies for YourAppName==1.0
remote: Searching for Django==1.4
remote: Best match: Django 1.4
remote: Processing Django-1.4-py2.6.egg
<-...............->
remote: Preparing build for deployment
remote: Deployment id is 42c7419f
remote: Activating deployment
remote: Starting MySQL 5.1 cartridge
remote: /usr/bin/oo-exec-ruby: line 8: /bin/rpm: Permission denied
remote: Script 
<-................->
remote: 73 static files copied.
remote: Starting Python 2.6 cartridge (Apache+mod_wsgi)
remote: Application directory "wsgi/" selected as DocumentRoot
remote: Application "wsgi/application" selected as default WSGI entry point
remote: /usr/bin/oo-exec-ruby: line 8: /bin/rpm: Permission denied
remote: /usr/bin/oo-exec-ruby: line 8: /bin/rpm: Permission denied
remote: -------------------------
remote: Git Post-Receive Result: success
remote: Activation status: success
remote: Deployment completed with status: success
To ssh://5440f498ef46d6d849000001.rhcloud.com/~/git/py26.git/
   d6e350e..b0d19f1  master -> master

--- Additional comment from Michal Fojtik on 2014-10-17 07:19:02 EDT ---

https://bugzilla.redhat.com/show_bug.cgi?id=1153975#c1

Comment 4 Ma xiaoqiang 2014-12-02 01:40:54 UTC
Check on puddle [2.2.2/2014-11-26.3]

1. create an app
#rhc app create testapp php-5.4
2. SSH to the app and run "gear restart"
> gear restart
Cart to restart?
1. php-5.4
?  1
Restarting PHP 5.4 cartridge (Apache+mod_php)
Application directory "/" selected as DocumentRoot

Comment 6 errata-xmlrpc 2014-12-10 13:24:26 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.

https://rhn.redhat.com/errata/RHBA-2014-1979.html