Bug 907742 - can not port-forward for database's ports on scaling app
Summary: can not port-forward for database's ports on scaling app
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OKD
Classification: Red Hat
Component: oc
Version: 2.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Hiro Asari
QA Contact: libra bugs
URL:
Whiteboard:
: 979591 (view as bug list)
Depends On:
Blocks: 917502
TreeView+ depends on / blocked
 
Reported: 2013-02-05 07:36 UTC by chunchen
Modified: 2015-05-15 02:13 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 917502 (view as bug list)
Environment:
Last Closed: 2013-03-15 14:13:08 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description chunchen 2013-02-05 07:36:55 UTC
Description of problem:
cannot port-forward for DB's ports on scaling app

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

How reproducible:
always

Steps to Reproduce:
1.Create a scalable app
  rhc app create -a php0s0 -t php-5.3 --scaling
2. Add mysql to the application
  rhc app cartridge add -a php0s0 -c mysql-5.1
3. Add mongodb to the application
  rhc app cartridge add -a php0s0 -c mongodb-2.2
4. Add postgresql to the application
  rhc app cartridge add -a php0s0 -c postgresql-8.4
5. Port-forward
  rhc port-forward -a php0s0  

  
Actual results:
Checking available ports...
Forwarding ports
  Service Connect to          Forward to
  ======= ============== ==== ==============
  haproxy 127.1.2.2:8080  =>  127.1.2.2:8080
  haproxy 127.1.2.3:8080  =>  127.1.2.3:8080
  httpd   127.1.2.1:8080  =>  127.1.2.1:8080
Press CTRL-C to terminate port forwarding


Expected results:
Should also show DB's ports, like:
Checking available ports...
Forwarding ports
  Service Connect to          Forward to
  ======= ============== ==== ==============
  haproxy 127.1.2.2:8080  =>  127.1.2.2:8080
  haproxy 127.1.2.3:8080  =>  127.1.2.3:8080
  httpd   127.1.2.1:8080  =>  127.1.2.1:8080
  mongod 127.NNN.NNN.NNN:27017 => 127.NNN.NNN.NNN:27017
  mysqld 127.NNN.NNN.NNN:3306 => 127.NNN.NNN.NNN:3306
  postgres 127.NNN.NNN.NNN:5432 => 127.NNN.NNN.NNN:5432
Press CTRL-C to terminate port forwarding

Additional info:

Comment 1 Xiaoli Tian 2013-02-05 07:42:08 UTC
This bug should be a feature request to track port-forward features for database ports in scaling app since node bug https://bugzilla.redhat.com/show_bug.cgi?id=876247 is fixed now.

Comment 2 Hiro Asari 2013-02-05 16:31:06 UTC
Adding jhonce to the CC, since he's fixing 876247.

Comment 3 Hiro Asari 2013-02-05 17:53:31 UTC
https://bugzilla.redhat.com/show_bug.cgi?id=876247 is now ON_QA.

Comment 4 chunchen 2013-02-06 06:52:38 UTC
it's still not fixed on devenv_2779, since https://bugzilla.redhat.com/show_bug.cgi?id=876247 is fixed. 

[root@fedora17_ccy ~]# rhc app create -a php0s1 -t php-5.3 --scaling
[root@fedora17_ccy ~]# rhc cartridge add mongodb-2.2 -a php0s1
[root@fedora17_ccy ~]# rhc cartridge add mysql-5.1 -a php0s1
[root@fedora17_ccy ~]# rhc cartridge add postgresql-8.4 -a php0s1
[root@fedora17_ccy ~]# rhc port-forward php0s1
Password: 
Checking available ports...
Forwarding ports
  Service Connect to            Forward to
  ======= ================ ==== ================
  haproxy 127.0.252.2:8080  =>  127.0.252.2:8080
  haproxy 127.0.252.3:8080  =>  127.0.252.3:8080
  httpd   127.0.252.1:8080  =>  127.0.252.1:8080
Press CTRL-C to terminate port forwarding

Comment 5 Hiro Asari 2013-02-06 14:24:30 UTC
Ah, I see. I assumed numeric IPv4 address instead of FQDN, which 'rhc-list-ports' returns for the these DB servers.

https://github.com/openshift/rhc/pull/297 addresses this problem.

Comment 6 openshift-github-bot 2013-02-06 15:29:07 UTC
Commit pushed to master at https://github.com/openshift/rhc

https://github.com/openshift/rhc/commit/663e07d6a1538073ff28555d0d5e28f705e2f051
Bug 907742

Fix port forwarding specification matching by relaxing the regular expression to match 'rhc-list-ports' output.

Comment 7 Zhe Wang 2013-02-07 02:40:57 UTC
RE-assigned this bug, since it was reproduced in devenv_2786.

Steps:

1. create a scalable app
$ rhc app create sphp php-5.3 -s -p x

2. embed the three db cartridges (i.e., mysql, mongodb, postgresql) into this app
$ rhc cartridge add postgresql-8.4 -a sphp -p x
$ rhc cartridge add mysql-5.1 -a sphp -p x
$ rhc cartridge add mongodb-2.2 -a sphp -p x

3. port-forward this app
$ rhc port-forward sphp -p x

Restuls:

Forwarding ports
  Service Connect to              Forward to
  ======= ================== ==== ==================
  haproxy 127.0.252.130:8080  =>  127.0.252.130:8080
  haproxy 127.0.252.131:8080  =>  127.0.252.131:8080
  httpd   127.0.252.129:8080  =>  127.0.252.129:8080
Error forwarding some port(s). You can try to forward manually by running:
ssh -N -L 5113117196-dev2786veri.dev.rhcloud.com:35566:5113117196-dev2786veri.dev.rhcloud.com:35566 -L
511312d596-dev2786veri.dev.rhcloud.com:35571:511312d596-dev2786veri.dev.rhcloud.com:35571 -L
5113130496-dev2786veri.dev.rhcloud.com:35576:5113130496-dev2786veri.dev.rhcloud.com:35576
5113106d9675515ef0000001.rhcloud.com

Expected results:

The DB's ports should be forwarded without errors.

Comment 8 Wei Sun 2013-02-07 02:48:35 UTC
client is rhc 1.4.7

Comment 9 Hiro Asari 2013-02-07 04:45:17 UTC
Some ports are probably blocked by the firewall. I'll have to investigate which ports are usable.

Comment 10 Hiro Asari 2013-02-07 21:02:14 UTC
After discussion with Clayton and Fabiano, we decided to use localhost for local port forwarding. https://github.com/openshift/rhc/pull/298

This will not make the dev cut for the current sprint.

There is no ugly logic to differentiate the Mac OS X and the rest, but some documents may need to be updated as a result, since we are effectively changing the way it is done.

Comment 11 Hiro Asari 2013-02-15 22:24:40 UTC
Prior to creating the pull request above, I tested the fix on the Mac OS X and Linux (Fedora 17).

I have now set up a Windows VM, and confirmed that the fix also works on Windows.

Comment 12 openshift-github-bot 2013-02-22 18:56:43 UTC
Commit pushed to master at https://github.com/openshift/rhc

https://github.com/openshift/rhc/commit/5beaa188da1505998891aaaeb295f70886f4db8c
Use 'localhost' exclusively for local port forwarding.

This should fix bug 907742. The behavior change is large enough,
however, that existing documents should be revised.

Comment 13 Wei Sun 2013-02-25 06:10:00 UTC
Seems this bug is fixed on devenv_2854.After marking it as ON_QA ,we will verify this bug.


[root@ip-10-147-154-18 ~]# rhc port-forward -a phps -l wsun+3 -p x -k
You have not yet configured the OpenShift client tools. Please run 'rhc setup'.
Checking available ports...
Forwarding ports
  Service    Connect to           Forward to
  ========== =============== ==== ============================================
  haproxy    localhost:8082   =>  127.0.253.130:8080
  haproxy    localhost:8083   =>  127.0.253.131:8080
  httpd      localhost:8084   =>  127.0.253.129:8080
  mongodb    localhost:35576  =>  512afe023a-wsundev2854.dev.rhcloud.com:35576
  mysql      localhost:35581  =>  512afe543a-wsundev2854.dev.rhcloud.com:35581
  postgresql localhost:35571  =>  512afd583a-wsundev2854.dev.rhcloud.com:35571
Press CTRL-C to terminate port forwarding

Comment 14 Zhe Wang 2013-03-01 08:30:26 UTC
This bug is recreated in INT (devenv_2876)

Tested with scalable ruby-1.9 + mongodb-2.2, and the output of port-forwarding was:

Checking available ports...
Forwarding ports
  Service Connect to               Forward to
  ======= =================== ==== ===================
  haproxy 127.3.253.130:8080   =>  127.3.253.130:8080
  haproxy 127.3.253.131:8080   =>  127.3.253.131:8080
  httpd   127.3.253.129:8080   =>  127.3.253.129:8080
  ruby    127.3.253.129:15256  =>  127.3.253.129:15256
Error forwarding some port(s). You can try to forward manually by running:
ssh -N -L 513064e86c-inttst.int.rhcloud.com:43801:513064e86c-inttst.int.rhcloud.com:43801
51304a5f6cec0ee1f00003af.rhcloud.com

Comment 15 Hiro Asari 2013-03-01 18:49:55 UTC
Zhe,

We are not forwarding remote ports. Along with https://bugzilla.redhat.com/show_bug.cgi?id=916122, we will be forwarding ports on 127.0.0.1, so that you will see:

Forwarding ports
  Service Connect to               Forward to
  ======= =================== ==== ===================
  haproxy 127.0.0.1:8080   =>  127.3.253.130:8080
  haproxy 127.0.0.1:8081   =>  127.3.253.131:8080
  httpd   127.0.0.1:8082   =>  127.3.253.129:8080
  ruby    127.0.0.1:15256  =>  127.3.253.129:15256

Comment 16 Zhe Wang 2013-03-04 02:23:44 UTC
Verified in INT(devnev_2886) with rhc-1.5.7

Tested with a scalable ruby app + mongodb-2.2

Result:

Checking available ports...
Forwarding ports
  Service Connect to           Forward to
  ======= =============== ==== =====================================================
  haproxy 127.0.0.1:8080   =>  127.5.35.130:8080
  haproxy 127.0.0.1:8081   =>  127.5.35.131:8080
  httpd   127.0.0.1:8082   =>  127.5.35.129:8080
  ruby    127.0.0.1:28970  =>  127.5.35.129:28970
  mongodb 127.0.0.1:46201  =>  5134038703ef64f381000119-inttst.int.rhcloud.com:46201
Press CTRL-C to terminate port forwarding

Comment 17 Jessica Forrester 2013-07-08 19:00:03 UTC
*** Bug 979591 has been marked as a duplicate of this bug. ***


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