Bug 856202 - Can not port-forward an application with ruby-1.8
Can not port-forward an application with ruby-1.8
Status: CLOSED CURRENTRELEASE
Product: OpenShift Origin
Classification: Red Hat
Component: Command Line Interface (Show other bugs)
2.x
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Fabiano Franz
libra bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-11 08:38 EDT by Jianwei Hou
Modified: 2015-05-14 22:04 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-09-17 17:29:01 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 Jianwei Hou 2012-09-11 08:38:10 EDT
Description of problem:
Can not port-forward an app successfully with ruby-1.8

Version-Release number of selected component (if applicable):
On Mac OS X, Fedora 16, Ubuntu 12.04
ruby 1.8.7
rhc-0.98.13

How reproducible:
Always

Steps to Reproduce:
1. Create a non-scaling application
   rhc app create -a php1 -t php-5.3
2. run rhc port-forward
   rhc port-forward -a php-5.3

  
Actual results:
For Fedora 16 and Ubuntu 12.04, This message is returned:
Error trying to forward ports. You can try to forward manually by running:
ssh -N eaea6d5956a746398aa7eb319deda016@php1-jhou.dev.rhcloud.com

On Mac OS X:
OpenShiftmatoMacBook-Pro:~ OpenShift$ rhc port-forward -a php1
Password: **
 
Checking available ports...
Binding httpd -> 127.0.250.129:8080...
Forwarding ports, use ctl + c to stop
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/net-ssh-2.0.4/lib/net/ssh/service/forward.rb:63:in `initialize': Can't assign requested address - bind(2) (Errno::EADDRNOTAVAIL)
        from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/net-ssh-2.0.4/lib/net/ssh/service/forward.rb:63:in `new'
        from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/net-ssh-2.0.4/lib/net/ssh/service/forward.rb:63:in `local'
        from /Library/Ruby/Gems/1.8/gems/rhc-0.98.13/lib/rhc/commands/port-forward.rb:56:in `run'
        from /Library/Ruby/Gems/1.8/gems/rhc-0.98.13/lib/rhc/commands/port-forward.rb:54:in `each'
        from /Library/Ruby/Gems/1.8/gems/rhc-0.98.13/lib/rhc/commands/port-forward.rb:54:in `run'
        from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/net-ssh-2.0.4/lib/net/ssh.rb:189:in `start'
        from /Library/Ruby/Gems/1.8/gems/rhc-0.98.13/lib/rhc/commands/port-forward.rb:52:in `run'
        from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/net-ssh-2.0.4/lib/net/ssh.rb:189:in `start'
        from /Library/Ruby/Gems/1.8/gems/rhc-0.98.13/lib/rhc/commands/port-forward.rb:30:in `run'
        from /Library/Ruby/Gems/1.8/gems/rhc-0.98.13/lib/rhc/commands.rb:103:in `send'
        from /Library/Ruby/Gems/1.8/gems/rhc-0.98.13/lib/rhc/commands.rb:103:in `to_commander'
        from /Library/Ruby/Gems/1.8/gems/commander-4.1.2/lib/commander/command.rb:180:in `call'
        from /Library/Ruby/Gems/1.8/gems/commander-4.1.2/lib/commander/command.rb:180:in `call'
        from /Library/Ruby/Gems/1.8/gems/commander-4.1.2/lib/commander/command.rb:155:in `run'
        from /Library/Ruby/Gems/1.8/gems/commander-4.1.2/lib/commander/runner.rb:402:in `run_active_command'
        from /Library/Ruby/Gems/1.8/gems/rhc-0.98.13/lib/rhc/command_runner.rb:30:in `run!'
        from /Library/Ruby/Gems/1.8/gems/commander-4.1.2/lib/commander/delegates.rb:7:in `run!'
        from /Library/Ruby/Gems/1.8/gems/rhc-0.98.13/lib/rhc/cli.rb:36:in `start'
        from /Library/Ruby/Gems/1.8/gems/rhc-0.98.13/bin/rhc:61
        from /usr/bin/rhc:23:in `load'
        from /usr/bin/rhc:23

Expected results:
should port-forward successfully

Additional info:
Comment 1 John (J5) Palmieri 2012-09-11 12:53:40 EDT
A couple of error conditions weren't caught so I have fixed that but that does not fix the issue that you can't port forward.  Can you run these commands and paste the output:

rhc port-forward -a php1
rhc-port-forward -a php1

When the output tells you to run the ssh command manually, can you also run that and paste the output here? If they are all the same then there is an issue with port-forwarding selecting ports that are already in use.  I notice that 8080 is used and that is a popular port for local web services (along with 8000 and 8888) so it may be the issue that all those systems are currently running services on those ports and this is a deeper issue.
Comment 2 John Poelstra 2012-09-11 13:03:15 EDT
working on now, incremental fix has been checked in and requesting more info from QE. blocking US2833. expect to have fixed by tomrrow
Comment 3 Fabiano Franz 2012-09-11 13:04:10 EDT
(In reply to comment #1)
> A couple of error conditions weren't caught so I have fixed that but that
> does not fix the issue that you can't port forward.  Can you run these
> commands and paste the output:
> 
> rhc port-forward -a php1
> rhc-port-forward -a php1

It would be useful to use debug flag:

rhc port-forward -a php1 -d
rhc-port-forward -a php1 -d

Also, on the Mac platform you probably need the following workaround, please try that:

https://access.redhat.com/knowledge/docs/en-US/OpenShift/2.0/html/User_Guide/sect-User_Guide-Application_Maintenance_Monitoring_and_Troubleshooting-Performing_Application_Maintenance_from_Your_Workstation.html#sect-User_Guide-Port_Forwarding-Port_Forwarding_on_Mac_OS_X


> 
> When the output tells you to run the ssh command manually, can you also run
> that and paste the output here? If they are all the same then there is an
> issue with port-forwarding selecting ports that are already in use.  I
> notice that 8080 is used and that is a popular port for local web services
> (along with 8000 and 8888) so it may be the issue that all those systems are
> currently running services on those ports and this is a deeper issue.
Comment 4 Meng Bo 2012-09-11 22:48:24 EDT
Checked this bug with rhc-0.98.14, issue has been fixed.

rhc port-forward works well on Fedora16/Ubuntu/MacOSX with ruby-1.8.
and works well on Windows7/Fedora17 with ruby-1.9.

Mark the bug as verified.

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