Bug 834813 - rhc port-forward fails on Ruby 1.9.x
rhc port-forward fails on Ruby 1.9.x
Status: CLOSED CURRENTRELEASE
Product: OpenShift Origin
Classification: Red Hat
Component: Command Line Interface (Show other bugs)
2.x
Unspecified Unspecified
unspecified Severity high
: ---
: ---
Assigned To: Fabiano Franz
libra bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-23 17:06 EDT by Nam Duong
Modified: 2015-05-14 21:59 EDT (History)
5 users (show)

See Also:
Fixed In Version: rhc-0.95.4-1+
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-07-13 19:43:43 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)

  None (edit)
Description Nam Duong 2012-06-23 17:06:10 EDT
Description of problem:
This was reported by a user on the forums:  https://openshift.redhat.com/community/forums/openshift/not-able-to-do-port-forwarding

I was able to reproduce this with Ruby 1.9.2 on my Mac OSX with the full error here:

rhc port-forward -a wordpress2
Password: ********

Checking available ports...
/Users/nduong/.rvm/gems/ruby-1.9.2-p290/gems/rhc-0.93.19/bin/rhc-port-forward:133:in `block (2 levels) in <top (required)>': undefined method `each' for "127.7.71.129:3306\n127.7.71.129:8080\n":String (NoMethodError)
	from /Users/nduong/.rvm/gems/ruby-1.9.2-p290/gems/net-ssh-2.5.2/lib/net/ssh/connection/session.rb:326:in `call'
	from /Users/nduong/.rvm/gems/ruby-1.9.2-p290/gems/net-ssh-2.5.2/lib/net/ssh/connection/session.rb:326:in `block (3 levels) in exec'
	from /Users/nduong/.rvm/gems/ruby-1.9.2-p290/gems/net-ssh-2.5.2/lib/net/ssh/connection/channel.rb:568:in `call'
	from /Users/nduong/.rvm/gems/ruby-1.9.2-p290/gems/net-ssh-2.5.2/lib/net/ssh/connection/channel.rb:568:in `do_data'
	from /Users/nduong/.rvm/gems/ruby-1.9.2-p290/gems/net-ssh-2.5.2/lib/net/ssh/connection/session.rb:556:in `channel_data'
	from /Users/nduong/.rvm/gems/ruby-1.9.2-p290/gems/net-ssh-2.5.2/lib/net/ssh/connection/session.rb:456:in `dispatch_incoming_packets'
	from /Users/nduong/.rvm/gems/ruby-1.9.2-p290/gems/net-ssh-2.5.2/lib/net/ssh/connection/session.rb:213:in `preprocess'
	from /Users/nduong/.rvm/gems/ruby-1.9.2-p290/gems/net-ssh-2.5.2/lib/net/ssh/connection/session.rb:197:in `process'
	from /Users/nduong/.rvm/gems/ruby-1.9.2-p290/gems/net-ssh-2.5.2/lib/net/ssh/connection/session.rb:161:in `block in loop'
	from /Users/nduong/.rvm/gems/ruby-1.9.2-p290/gems/net-ssh-2.5.2/lib/net/ssh/connection/session.rb:161:in `loop'
	from /Users/nduong/.rvm/gems/ruby-1.9.2-p290/gems/net-ssh-2.5.2/lib/net/ssh/connection/session.rb:161:in `loop'
	from /Users/nduong/.rvm/gems/ruby-1.9.2-p290/gems/net-ssh-2.5.2/lib/net/ssh/connection/channel.rb:269:in `wait'
	from /Users/nduong/.rvm/gems/ruby-1.9.2-p290/gems/net-ssh-2.5.2/lib/net/ssh/connection/session.rb:355:in `exec!'
	from /Users/nduong/.rvm/gems/ruby-1.9.2-p290/gems/rhc-0.93.19/bin/rhc-port-forward:109:in `block in <top (required)>'
	from /Users/nduong/.rvm/gems/ruby-1.9.2-p290/gems/net-ssh-2.5.2/lib/net/ssh.rb:193:in `start'
	from /Users/nduong/.rvm/gems/ruby-1.9.2-p290/gems/rhc-0.93.19/bin/rhc-port-forward:107:in `<top (required)>'
	from /Users/nduong/.rvm/gems/ruby-1.9.2-p290/bin/rhc-port-forward:19:in `load'
	from /Users/nduong/.rvm/gems/ruby-1.9.2-p290/bin/rhc-port-forward:19:in `<main>'
Comment 1 Fabiano Franz 2012-06-24 09:47:27 EDT
Fixed on 0.95.1-1+, please test.

https://github.com/openshift/os-client-tools/commit/d024909472dee1024065b59565513382dd59e355
Comment 2 Xiaoli Tian 2012-06-24 21:38:06 EDT
Verified it on rhc-0.95.4, it works for non-scaling app, but failed for scaling app:

[root@F17x64-openshift client]# ruby -v
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]


[root@F17x64-openshift client]# rhc port-forward -a phpapp2 -l xtian+test2@redhat.com 
Checking available ports...

Binding httpd -> 127.10.124.129:8080...
Use ctl + c to stop

[root@F17x64-openshift client]# rhc port-forward -a scalejboss  -l xtian+test1@redhat.com -p 123456
Checking available ports...
/usr/local/share/gems/gems/rhc-0.95.4/bin/rhc-port-forward:174:in `block (4 levels) in <top (required)>': undefined method `each' for #<String:0x00000002779668> (NoMethodError)
	from /usr/local/share/gems/gems/net-ssh-2.5.2/lib/net/ssh/connection/session.rb:326:in `call'
	from /usr/local/share/gems/gems/net-ssh-2.5.2/lib/net/ssh/connection/session.rb:326:in `block (3 levels) in exec'
	from /usr/local/share/gems/gems/net-ssh-2.5.2/lib/net/ssh/connection/channel.rb:568:in `call'
	from /usr/local/share/gems/gems/net-ssh-2.5.2/lib/net/ssh/connection/channel.rb:568:in `do_data'
	from /usr/local/share/gems/gems/net-ssh-2.5.2/lib/net/ssh/connection/session.rb:556:in `channel_data'
	from /usr/local/share/gems/gems/net-ssh-2.5.2/lib/net/ssh/connection/session.rb:456:in `dispatch_incoming_packets'
	from /usr/local/share/gems/gems/net-ssh-2.5.2/lib/net/ssh/connection/session.rb:213:in `preprocess'
	from /usr/local/share/gems/gems/net-ssh-2.5.2/lib/net/ssh/connection/session.rb:197:in `process'
	from /usr/local/share/gems/gems/net-ssh-2.5.2/lib/net/ssh/connection/session.rb:161:in `block in loop'
	from /usr/local/share/gems/gems/net-ssh-2.5.2/lib/net/ssh/connection/session.rb:161:in `loop'
	from /usr/local/share/gems/gems/net-ssh-2.5.2/lib/net/ssh/connection/session.rb:161:in `loop'
	from /usr/local/share/gems/gems/net-ssh-2.5.2/lib/net/ssh/connection/channel.rb:269:in `wait'
	from /usr/local/share/gems/gems/net-ssh-2.5.2/lib/net/ssh/connection/session.rb:355:in `exec!'
	from /usr/local/share/gems/gems/rhc-0.95.4/bin/rhc-port-forward:157:in `block (3 levels) in <top (required)>'
	from /usr/local/share/gems/gems/net-ssh-2.5.2/lib/net/ssh.rb:193:in `start'
	from /usr/local/share/gems/gems/rhc-0.95.4/bin/rhc-port-forward:155:in `block (2 levels) in <top (required)>'
	from /usr/local/share/gems/gems/rhc-0.95.4/bin/rhc-port-forward:151:in `each'
	from /usr/local/share/gems/gems/rhc-0.95.4/bin/rhc-port-forward:151:in `block in <top (required)>'
	from /usr/local/share/gems/gems/net-ssh-2.5.2/lib/net/ssh.rb:193:in `start'
	from /usr/local/share/gems/gems/rhc-0.95.4/bin/rhc-port-forward:107:in `<top (required)>'
	from /usr/local/bin/rhc-port-forward:23:in `load'
	from /usr/local/bin/rhc-port-forward:23:in `<main>'
Comment 3 Fabiano Franz 2012-06-25 10:19:13 EDT
Fixed on rhc-0.95.4-1+, thanks.
Comment 4 Meng Bo 2012-06-26 01:29:51 EDT
Git clone the latest os-client-tool from github, and replace the rhc-port-forward script in OS with the latest one. 
Check the rhc-port-forward command with both ruby 1.8 and ruby 1.9. 
It works well for both scalable apps and non-scalable apps.
Comment 5 Meng Bo 2012-06-28 04:44:24 EDT
Checked this issue with rhc-0.95.5, rhc port-forward works well on ruby 1.9 for both scalable and non-scalable apps.

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