Bug 976742 - passenger-status command is not found when executed from user's ruby-1.8 application shell
Summary: passenger-status command is not found when executed from user's ruby-1.8 appl...
Keywords:
Status: CLOSED DEFERRED
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Containers
Version: 1.2.0
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: ---
Assignee: Brenton Leanhardt
QA Contact: libra bugs
URL:
Whiteboard:
Depends On: 846108
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-06-21 10:57 UTC by Johnny Liu
Modified: 2017-03-08 17:35 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: The passenger-status command was left out of rubygem-passenger-3.0.4-15.el6_3.x86_64 Consequence: Ruby 1.8 application developers cannot use passenger-status with their applications. Fix: Result:
Clone Of: 846108
Environment:
Last Closed: 2013-08-15 14:59:55 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Johnny Liu 2013-06-21 10:57:32 UTC
+++ This bug was initially created as a clone of Bug #846108 +++

Description of problem:

When executing the passenger-status command from a user's Ruby 1.9 application shell,
an exception is thrown.

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


How reproducible:

Create a new Ruby 1.9 application, SSH into the shell, and attempt
to execute the command.


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

An exception is thrown (see attachment).

Expected results:

Typical passenger-status output.

Additional info:

This exception is specific to the ruby-1.9 cartridge; everything is fine
with ruby-1.8.

--- Additional comment from Ram Ranganathan on 2012-08-15 15:41:26 EDT ---

Assigning this to Troy as the passenger rpm (3.0.12) [some utilities inside it]  require fastthread and daemon_controller.


To get this working I needed to run this on devenv:
  root# scl enable ruby193 bash
  scl# gem install fastthread
  scl# gem install daemon_controller

Once those 2 gems are installed (fastthread + daemon_controller) into ruby1.9 gems, I can then ssh into my ruby-1.9 app and run 'passenger-status' or passenger-memory-stats.

--- Additional comment from Ram Ranganathan on 2012-08-15 15:44:01 EDT ---

Also changing sev/pri to low/low as it just affects us internally.

--- Additional comment from Troy Dawson on 2012-08-15 17:09:43 EDT ---

ruby193-rubygem-daemon_controller is already in the li repo.
All you have to do is yum install ruby193-rubygem-daemon_controller to fix that problem.

As far as fastthread, it isn't needed in ruby1.9.
http://www.ruby-forum.com/topic/132022
"Fastthread corrected problems on Ruby 1.8 implementation of array,
mutex and synchronize.

These corrections where merged to trunk and are available under
--disable-fastthread option of configure.

Also, ruby 1.8.6 ships with these changes, so dependency of fastthread
is only required for ruby < 1.8.6"

Could you try it with only the daemon_controller and not fastthread?

--- Additional comment from Troy Dawson on 2012-08-16 15:35:28 EDT ---

I have setup my test, and you are correct, it needs both fastthread and daemon-controller.
Even more interesting, once I have them installed, if I try to remove either of them, gem tells me that it will break passenger.

I am going to try two different things and see which works best

1 - build ruby193 passenger so that it doesn't require fastthread
2 - build ruby193 fastthread (I've already tried and failed for this, but I could try again)

--- Additional comment from Troy Dawson on 2012-08-16 19:24:58 EDT ---

So, in the end, it looks like building ruby193-rubygem-fastthread worked the best.
I have created 

  ruby193-rubygem-fastthread-1.0.7-5.el6_3

And tagged it into the libra-candidate repo.  I think they've already pushed the candidate repo for tonight, so it should go in tomorrow night.

A few things to note, because they were interesting.
1 - In a pure ruby 1.9 enviroment, gem does not build the native fastthread.so library.  I guess it knows it isn't needed or something.
2 - This non-building of the native library was what was breaking the rpmbuilds I was working on before.
3 - rubygem-passenger, in the scl enviroment, doesn't seem to care that the native fastthread.so library is not there.  It just cares that the gem is installed.

So now the question is, what do you think should be pulling in ruby193-rubygem-fastthread and ruby193-rubygem-daemon_controller ?

--- Additional comment from Mrunal Patel on 2012-08-16 19:37:38 EDT ---

cartridge-ruby-1.9.spec should be pulling them in?

--- Additional comment from Ram Ranganathan on 2012-08-17 12:38:37 EDT ---

Thanks Troy -- that was quick.

Yup, the ruby-1.9 cartridge spec should pull that in. 
I'll take care of that + take ownership of this bug.

--- Additional comment from Ram Ranganathan on 2012-08-17 14:35:48 EDT ---

Waiting for pull request to get merged  https://github.com/openshift/crankcase/pull/401

--- Additional comment from Ram Ranganathan on 2012-08-20 13:35:11 EDT ---

Merged and in  devenv_2024

--- Additional comment from Hou Jianwei on 2012-08-20 22:23:36 EDT ---

Verified on INT

Steps:
1.Create a ruby-1.9 application
2.ssh into application
3.Run 'passenger-status'

Results:

[r19-jhou.int.rhcloud.com ~]\> passenger-status
----------- General information -----------
max      = 6
count    = 0
active   = 0
inactive = 0
Waiting on global queue: 0

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

No exception is thrown.

--- Additional comment from Ram Ranganathan on 2012-08-22 13:20:43 EDT ---

Adding a workaround as the issue exists on PROD until the next release rolls out. So if someone's looking at bug in the interim: 

A workaround for now, might be to ssh into your app and do something like:

 GEM_HOME=$OPENSHIFT_DATA_DIR gem install fastthread daemon_controller  
 GEM_HOME=$OPENSHIFT_DATA_DIR  passenger-status


Found this issue during full functional testing, rubygem-passenger-3.0.17-2.el6op.1.x86_64 is installed by OSE.

Comment 2 Brenton Leanhardt 2013-06-24 01:34:01 UTC
Oddly enough this does not appear to be reproducible on OSE 1.2.  This Bug was fixed a long time ago for Online.  Today the v2 Ruby cartridge pulls in both of the libraries that were originally missing for Online.

Comment 3 Johnny Liu 2013-06-24 12:36:34 UTC
Sorry for the confusion.

Indeed passenger-status could be run in ruby-1.9 app successfully. But there is no this command in ruby-1.8 app.

Compare with online devenv, find the following info:

Online devenv:
[root@ip-10-35-66-253 ~]# rpm -qf /usr/bin/passenger-status
rubygem-passenger-3.0.4-15.el6_3.x86_64
[root@ip-10-35-66-253 ~]# rpm -ql rubygem-passenger-3.0.4-15.el6_3.x86_64|grep passenger-status
/usr/bin/passenger-status
/usr/lib/ruby/gems/1.8/gems/passenger-3.0.4/bin/passenger-status
/usr/lib/ruby/gems/1.8/gems/passenger-3.0.4/man/passenger-status.8


OSE-1.2:
[root@node1 ~]# rpm -q rubygem-passenger
rubygem-passenger-3.0.17-2.el6op.1.x86_64
[root@node1 ~]# rpm -ql rubygem-passenger-3.0.17-2.el6op.1.x86_64 |grep passenger-status
/usr/share/man/man8/passenger-status.8.gz

Looks like passenger-status for ruby-1.8 is not installed.

Comment 4 nsun 2013-08-01 10:07:29 UTC
'passenger-status' command existed on Ruby-1.8 app, but exec failed.

OSE—1.2.1:
[root@node ~]# rpm -q rubygem-passenger
rubygem-passenger-3.0.21-3.el6op.x86_64

Created a ruby-1.8 app, login this app and execute 'passenger-status' command, It will be failed with below message:
[ruby3-sun000.osetestv2.com 51f8ca4e6e0f5dacb30000ce]\> passenger-status 
/usr/bin/passenger-status:27:in `require': no such file to load -- phusion_passenger (LoadError)
	from /usr/bin/passenger-status:27

Comment 5 Brenton Leanhardt 2013-08-15 14:59:55 UTC
We'll pick this up with the rebase.


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