Bug 846108 - passenger-status command throws exception when executed from user's application shell
passenger-status command throws exception when executed from user's applicati...
Status: CLOSED CURRENTRELEASE
Product: OpenShift Origin
Classification: Red Hat
Component: Containers (Show other bugs)
2.x
Unspecified Unspecified
low Severity low
: ---
: ---
Assigned To: Ram Ranganathan
libra bugs
: Triaged
Depends On:
Blocks: 976742
  Show dependency treegraph
 
Reported: 2012-08-06 16:32 EDT by Dan Mace
Modified: 2015-05-14 18:57 EDT (History)
5 users (show)

See Also:
Fixed In Version: devenv_2024
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 976742 (view as bug list)
Environment:
Last Closed: 2012-09-17 17:30:10 EDT
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)
passenger-status exception log (2.17 KB, text/plain)
2012-08-06 16:32 EDT, Dan Mace
no flags Details

  None (edit)
Description Dan Mace 2012-08-06 16:32:10 EDT
Created attachment 602579 [details]
passenger-status exception log

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.
Comment 1 Ram Ranganathan 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.
Comment 2 Ram Ranganathan 2012-08-15 15:44:01 EDT
Also changing sev/pri to low/low as it just affects us internally.
Comment 3 Troy Dawson 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?
Comment 4 Troy Dawson 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)
Comment 5 Troy Dawson 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 ?
Comment 6 Mrunal Patel 2012-08-16 19:37:38 EDT
cartridge-ruby-1.9.spec should be pulling them in?
Comment 7 Ram Ranganathan 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.
Comment 8 Ram Ranganathan 2012-08-17 14:35:48 EDT
Waiting for pull request to get merged  https://github.com/openshift/crankcase/pull/401
Comment 9 Ram Ranganathan 2012-08-20 13:35:11 EDT
Merged and in  devenv_2024
Comment 10 Jianwei Hou 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.
Comment 11 Ram Ranganathan 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

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