Bug 999384

Summary: passenger-status command is not found when executed from user's ruby-1.8 application shell
Product: OpenShift Online Reporter: Wei Sun <wsun>
Component: ContainersAssignee: Michal Fojtik <mfojtik>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.xCC: blentz, chunchen, dmcphers, jhonce, johan, mfojtik, ssnodgra, tdawson, xtian
Target Milestone: ---Keywords: Regression
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-01-30 00:48:23 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:
Attachments:
Description Flags
Updated rubygem-passenger spec file none

Description Wei Sun 2013-08-21 09:03:44 UTC
Description of problem:
When executing the passenger-status command from a user's Ruby 1.8 application shell,could not execute successfully.,it shows "bash: passenger-status: command not found"

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

How reproducible:
Always

Steps to Reproduce:
1. Create a new ruby-1.8 application
2. Log in to the application's shell as the user
3. Execute 'passenger-status'

Actual results:
[r8-wsunint.int.rhcloud.com 52146ece6cec0e434300023e]\> passenger-status
bash: passenger-status: command not found


Expected results:
Could execute this command

Additional info:
For ruby-1.9 application,can execute this command
[r9-wsunint.int.rhcloud.com 521479986cec0e84cb000031]\> passenger-status
----------- General information -----------
max      = 6
count    = 0
active   = 0
inactive = 0
Waiting on global queue: 0

----------- Application groups -----------

Comment 1 Michal Fojtik 2013-08-21 12:06:42 UTC
I did some investigation on this and I found that the 'bin/' directory is excluded in rubygem-passenger-3.0.21-5.el6oso which is the version we are currently using for ruby-1.8.

The reason, from the RPM spec file is:

# XXX: removing everything in bin until daemon_controller >= 1.0.0
%{__rm} -rf %{buildroot}%{gem_instdir}/bin

This change was brought in by Brett Lentz (CC'ing this bug) and I guess the reason was that the passenger-status and probably other commands won't work with daemon_controller < 1.0 (currently not available for RHEL).

Comment 2 Brett Lentz 2013-08-21 12:58:19 UTC
I've fixed the daemon_controller spec and will be building it for EPEL and OpenShift Online. Once that is done, we can restore the bin/ directory in the passenger package.

Comment 3 Wei Sun 2013-08-22 05:10:05 UTC
Check this bug on devenv-stage_448 ,still can reproduce this bug.

Comment 4 Michal Fojtik 2013-08-22 13:13:26 UTC
Wei Sun, we need to wait until Brett build the updated passenger package with bin/ dir enabled.

Comment 5 Brett Lentz 2013-08-22 15:48:02 UTC
Packages for rubygem-daemon_controller and rubygem-passenger are now built.

Comment 6 Wei Sun 2013-08-23 03:31:20 UTC
Check this bug on STG(devenv-stage_452),devenv-stage_452,devenv_3691.Still can reproduce this bug.

Result:
[r8-wsunstg.stg.rhcloud.com 5216cd842587c85f4a0000ef]\> passenger-status
bash: passenger-status: command not found

Comment 7 Michal Fojtik 2013-08-23 12:19:24 UTC
Wei, can you please retry? I think it takes 1d or so for mirrors to sync... The package was pushed to stable just yesterday. Also make sure you have the latest rubygem-passenger installed.

Comment 8 chunchen 2013-09-02 04:24:54 UTC
This issue is reproduced and met "Phusion Passenger doesn't seem to be running" errors on devenv_3734, please refer to the following results:

1. Run "passenger-status" directly
1) SSH into instance and check the rubygem-passenger version
rubygem-passenger-3.0.21-5.el6oso.x86_64
2) Create a ruby-1.8 app and ssh into this app to execute "passenger-status"
\> passenger-status
bash: passenger-status: command not found

2. Run "passenger-status" after gem install "passenger"
1) Create a ruby-1.8 app and ssh into this app
2) Install "passenger" by gem
\> gem install passenger
Building native extensions.  This could take a while...
Successfully installed daemon_controller-1.1.5
Successfully installed passenger-4.0.14
2 gems installed
Installing ri documentation for daemon_controller-1.1.5...
Installing ri documentation for passenger-4.0.14...
Installing RDoc documentation for daemon_controller-1.1.5...
Installing RDoc documentation for passenger-4.0.14...
3) Execute "passenger-status"
\> passenger-status
*** Phusion Passenger: no passenger_native_support.so found for the current Ruby interpreter. Downloading precompiled binary from the Phusion server (set PASSENGER_DOWNLOAD_NATIVE_SUPPORT_BINARY=0 to disable)...
cp /var/lib/openshift/52240346f80f2e7353000288/.gem/gems/passenger-4.0.14/download_cache/rubyext-ruby-1.8.7-x86_64-linux.tar.gz /tmp/passenger-native-support-1iroydr/rubyext-ruby-1.8.7-x86_64-linux.tar.gz
# tar xzf rubyext-ruby-1.8.7-x86_64-linux.tar.gz
# rm -f rubyext-ruby-1.8.7-x86_64-linux.tar.gz
Checking whether downloaded binary is usable...
# /usr/bin/ruby -I. test.rb
Binary is usable.
# mkdir -p /var/lib/openshift/52240346f80f2e7353000288/.gem/gems/passenger-4.0.14/buildout/ruby/ruby-1.8.7-x86_64-linux
# cd /var/lib/openshift/52240346f80f2e7353000288/.gem/gems/passenger-4.0.14/buildout/ruby/ruby-1.8.7-x86_64-linux
# Installing passenger_native_support.so
ERROR: Phusion Passenger doesn't seem to be running.

Comment 9 Michal Fojtik 2013-09-09 16:15:21 UTC
The update should be now pushed, could you please re-test?

Comment 10 Michal Fojtik 2013-09-09 16:29:05 UTC
chunsen:

The script should be now installed in '/usr/share/rubygems/gems/passenger-3.0.21/bin/passenger-status'.

I'll work on adding this to $OPENSHIFT_RUBY_PATH_ELEMENT tomorrow morning so this command will become available without specifying the whole path.

Comment 11 Michal Fojtik 2013-09-10 08:06:23 UTC
So after some investigation, the passenger-status command is not the right one :(

[root@ip-10-242-66-32 ~]# /usr/share/rubygems/gems/passenger-3.0.21/bin/passenger-status

/usr/lib/ruby/site_ruby/1.8/rubygems.rb:779:in `report_activate_error': Could not find RubyGem passenger (>= 0) (Gem::LoadError)
	from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:214:in `activate'
	from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:1082:in `gem'
	from /usr/share/rubygems/gems/passenger-3.0.21/bin/passenger-status:18

This is because the 'passenger-status' script is just a runner for the real script:

if ARGV.first =~ /^_(.*)_$/ and Gem::Version.correct? $1 then
  version = $1
  ARGV.shift
end

gem 'passenger', version
load Gem.bin_path('passenger', 'passenger-status', version

Comment 12 Brett Lentz 2013-09-10 16:46:43 UTC
Can you explain what you mean by "not the right one" ?

The passenger-status command is what ships with the passenger tarball.

Comment 13 Michal Fojtik 2013-09-10 17:12:45 UTC
rubygems basically create an 'launcher' script upon the gem install that is placed to the $PATH (/usr/bin usually)... This launcher then points to the 'original' ruby script/binary which is located in the $GEM_HOME (/usr/share/rubygems/.../passenger-xyz/bin) 

The current passenger RPM installs the launcher into $GEM_HOME and the original ('right one' ;-) file is not being installed. So this launcher points to a file which does not exists in RPM...

The 'passenger-status' command is definitely present in passenger-xyz.gem (gem unpack passenger.gem).

I'll check this out tomorrow morning as first thing.

Comment 14 Michal Fojtik 2013-09-11 08:51:53 UTC
Created attachment 796296 [details]
Updated rubygem-passenger spec file

I tried to fix this by adding a 'suffix' to the passenger commands (as they might conflict with the SCL ones...)

So for now all commands are installed into _bindir and suffixed by '-3'. We might consider using different suffix, like '-mri18' or something similar.

Comment 16 Brett Lentz 2013-10-02 21:41:18 UTC
I found the issue. Our spec file was using the wrong %gem_dir for el6.

Confirmed fixed in rubygem-passenger-3.0.21-10.el6oso.

Comment 17 Wei Sun 2013-10-08 05:24:21 UTC
Will verify this bug after rubygem-passenger is rubygem-passenger-3.0.21-10.el6oso

Comment 18 Xiaoli Tian 2013-10-09 10:50:56 UTC
(In reply to Brett Lentz from comment #16)
> I found the issue. Our spec file was using the wrong %gem_dir for el6.
> 
> Confirmed fixed in rubygem-passenger-3.0.21-10.el6oso.

On the latest devenv(devenv_3884) and latest devenv-stage(devenv-stage_488),  rubygem-passenger is still not upgraded to above version, please help double confirming: 

devenv_3874
[root@ip-10-140-13-160 ~]# rpm -qa|grep passenger
ruby193-rubygem-passenger-devel-3.0.21-2.el6_4.x86_64
ruby193-rubygem-passenger-3.0.21-2.el6_4.x86_64
ruby193-rubygem-passenger-native-libs-3.0.21-2.el6_4.x86_64
rubygem-passenger-3.0.21-7.el6oso.x86_64
rubygem-passenger-native-3.0.21-7.el6oso.x86_64
ruby193-rubygem-passenger-native-3.0.21-2.el6_4.x86_64
rubygem-passenger-native-libs-3.0.21-7.el6oso.x86_64


devenv-stage_488

[root@ip-10-204-47-115 ~]# rpm -qa|grep passenger
ruby193-rubygem-passenger-native-libs-3.0.21-2.el6_4.x86_64
rubygem-passenger-native-libs-3.0.21-6.el6oso.x86_64
ruby193-rubygem-passenger-devel-3.0.21-2.el6_4.x86_64
rubygem-passenger-3.0.21-6.el6oso.x86_64
ruby193-rubygem-passenger-native-3.0.21-2.el6_4.x86_64
ruby193-rubygem-passenger-3.0.21-2.el6_4.x86_64
rubygem-passenger-native-3.0.21-6.el6oso.x86_64
ruby193-mod_passenger-3.0.21-2.el6_4.x86_64


yum update  rubygem-passenger does not find any updates as well.

Comment 19 Brett Lentz 2013-10-10 16:02:25 UTC
The package has been synced. It should now be available in devenv.

Comment 20 Wei Sun 2013-10-11 06:05:09 UTC
Checked this bug on devenv_3886 with rubygem-passenger-3.0.21-10.el6oso.x86_64,but still got error:

1.[r8-wsundev3886.dev.rhcloud.com 525790201c0a3cb0f4000009]\> passenger-status
/usr/lib/ruby/site_ruby/1.8/rubygems.rb:779:in `report_activate_error': Could not find RubyGem daemon_controller (>= 1.0.0) (Gem::LoadError)
	from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:214:in `activate'
	from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:249:in `activate'
	from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:248:in `each'
	from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:248:in `activate'
	from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:1082:in `gem'
	from /usr/bin/passenger-status:18
[r8-wsundev3886.dev.rhcloud.com 525790201c0a3cb0f4000009]\> gem list|grep passenger
passenger (3.0.21)

2.[r8-wsundev3886.dev.rhcloud.com 525790201c0a3cb0f4000009]\> /usr/lib/ruby/gems/1.8/gems/passenger-3.0.21/bin/passenger-status
----------- General information -----------
max      = 6
count    = 0
active   = 0
inactive = 0
Waiting on global queue: 0

----------- Application groups -----------

Comment 21 Brett Lentz 2013-10-11 14:36:51 UTC
'Require: rubygem-daemon_controller' was commented out for some reason.

Fixed in rubygem-passenger-3.0.21-11.el6oso

Comment 22 Steve Snodgrass 2013-10-17 14:37:22 UTC
I've encountered this bug myself.  I'd like to test the fix, but I've been googling like mad and I can't figure out what "devenv" is or how to get the updated packages.  My apologies for my ignorance of the development process.  If someone could point me to the packages or any docs about how to use devenv, I'd be grateful.

Comment 23 Brett Lentz 2013-10-17 18:56:00 UTC
(In reply to Steve Snodgrass from comment #22)
> I've encountered this bug myself.  I'd like to test the fix, but I've been
> googling like mad and I can't figure out what "devenv" is or how to get the
> updated packages.  My apologies for my ignorance of the development process.
> If someone could point me to the packages or any docs about how to use
> devenv, I'd be grateful.


Steve -

What you're seeing is a discussion of packages used to run OpenShift Online. The packages being mentioned aren't available for public consumption. These packages will eventually also be a part of a future OpenShift Enterprise release.

I'll be updating the EPEL packages to incorporate these changes, also. As soon as that happens, you'll be able to consume the EPEL version.

Comment 24 Steve Snodgrass 2013-10-18 01:45:09 UTC
OK.  Is there a different bug ID for EPEL or should I just keep following this one?

Comment 25 Wei Sun 2013-10-18 02:48:44 UTC
Check devenv_3912,rubygem-passenger is rubygem-passenger-3.0.21-10.el6oso.x86_64,will verify this bug when rubygem-passenger is rubygem-passenger-3.0.21-11.el6oso

Comment 26 Brett Lentz 2013-10-18 15:53:00 UTC
(In reply to Steve Snodgrass from comment #24)
> OK.  Is there a different bug ID for EPEL or should I just keep following
> this one?

Go ahead and continue following this bug. I'll update it when I push the new build to EPEL.

Comment 27 Xiaoli Tian 2013-10-21 09:44:34 UTC
Since it's still not ready for QE to test, move it back to Assigned.

Comment 28 Michal Fojtik 2013-10-23 13:51:56 UTC
Xiaoli: It looks to me that the changes are now available in latest devenv:

[ruby01-mfojtik.dev.rhcloud.com 5267d3fe9b1d09a7d7000027]\> passenger-status 
----------- General information -----------
max      = 3
count    = 0
active   = 0
inactive = 0
Waiting on global queue: 0

----------- Application groups -----------

Comment 29 Wei Sun 2013-10-24 00:12:18 UTC
Verified on devenv_3937 with  rubygem-passenger-3.0.21-11.el6oso.x86_64

Result:
[r8-wsundev3937.dev.rhcloud.com 526864f8ec1063a77200003d]\>  passenger-status
----------- General information -----------
max      = 3
count    = 0
active   = 0
inactive = 0
Waiting on global queue: 0

----------- Application groups -----------

Comment 30 Steve Snodgrass 2013-11-01 21:08:43 UTC
Any word on getting this in EPEL?  Even having it in epel-testing would be really helpful.

Comment 31 Brett Lentz 2013-11-07 21:34:44 UTC
(In reply to Steve Snodgrass from comment #30)
> Any word on getting this in EPEL?  Even having it in epel-testing would be
> really helpful.

Here you go:
https://admin.fedoraproject.org/updates/rubygem-passenger-3.0.21-11.el6

Comment 32 Johan De Wit 2014-01-17 15:29:11 UTC
Any change on promoting this version (3.0.21-11.el6) to the EPEL stable repo.

I tested everything and it works with this version on centos6.5.

The current stable version (3.0.21-5.el6) is broken, and should be replaced with the working one.

Comment 33 Troy Dawson 2014-01-17 15:48:36 UTC
I've marked it as stable.  It should make it into EPEL6 stable in a day or two.  (However long it takes for stable packages to make it in.)