Bug 1177753 - Enable a configuration in rhc to use a different ssh executable
Summary: Enable a configuration in rhc to use a different ssh executable
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 2.2.0
Hardware: All
OS: Windows
unspecified
high
Target Milestone: ---
: ---
Assignee: Timothy Williams
QA Contact: Yanping Zhang
URL:
Whiteboard:
Depends On:
Blocks: 1273542
TreeView+ depends on / blocked
 
Reported: 2014-12-30 09:27 UTC by Jaspreet Kaur
Modified: 2019-09-12 08:09 UTC (History)
11 users (show)

Fixed In Version: rhc-1.38.4.1-1.el6op
Doc Type: Enhancement
Doc Text:
Security policies within an organization may dictate how SSH must be used, requiring a custom SSH executable to be created and used exclusively. This enhancement enables all `rhc` subcommands that must use an SSH implementation to use an SSH executable specified by the user. Otherwise, these subcommands continue as they did previously, usually using Ruby's Net::SSH implementation. The option `--ssh` is now added as a global option to all commands and is also available for use in the rhc `express.conf` configuration file.
Clone Of:
Environment:
Last Closed: 2015-12-17 17:09:50 UTC
Target Upstream Version:
Embargoed:
erich: needinfo-


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:2666 0 normal SHIPPED_LIVE Important: Red Hat OpenShift Enterprise 2.2.8 security, bug fix, and enhancement update 2015-12-17 22:07:54 UTC

Description Jaspreet Kaur 2014-12-30 09:27:42 UTC
Description of problem:

 In some cases, Customers do not have kerboros capable ssh and has to point to other ssh executable. To use a different ssh executable we can provide --ssh with certain rhc commands but rhc tail even needs ssh login to gear and is not provided with --ssh option. Also, It is not user friendly approach to provide --ssh with each rhc command we use. Hence, a configuration or an environment variable similar as GIT_SSH variable(which is used to point to a different ssh executable in GIT) could be introduced in rhc as well.

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


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

 rhc ssh [--ssh path_to_ssh_executable] [--gears] [<app> --] <command>
 
rhc snapshot and ssh are some of the commands provided with --ssh option but rhc tail is not provided with this option and results in authentiaction failure.

Comment 3 Jaspreet Kaur 2015-07-09 12:46:36 UTC
Hello,

Can you please update on this. If this is acknowledged or not so that I can convey this to customer at early stage itself.

Regards,
Jaspreet

Comment 4 Jaspreet Kaur 2015-08-10 05:13:35 UTC
Hello,

Do we have any update on this. If it going to be acknowledged for OSE 2 or not.

Regards,
Jaspreet

Comment 7 Eric Rich 2015-09-14 18:28:34 UTC
It looks like there are other RHC commands that have this issue as well: 

https://github.com/openshift/rhc/blob/master/lib/rhc/commands/scp.rb

Comment 17 openshift-github-bot 2015-11-09 23:41:35 UTC
Commit pushed to master at https://github.com/openshift/rhc

https://github.com/openshift/rhc/commit/a1bd4e2b9842a7e72512b2a749804105c754bd3f
Allow an ssh executable to be specified globally

Bug 1177753
https://bugzilla.redhat.com/show_bug.cgi?id=1177753

Previously, a `--ssh` option could be passed to a few subcommands to use a seperate ssh executable other than that found in the default PATH. After this commit, this option is now a global options used in all commands utilizing ssh. A `ssh` option is now available in configuration that allows this global option to be set persistently.

The snapshot-restore, snapshot-save, and tail commands will now use the an ssh executable if specified. If no ssh executable is specified, the Net::SSH implementations will continue to be used.

The port-forward command will not attempt to actually forward ports with a custom ssh executable. This is due to how errors reported from a custom ssh executable are unpredictable. If one or more of the port-forwards fails, the error reported is not predictable enough to script a workaround or helpful error message. If a custom ssh executable is specified when port-forward is called, rhc will use the custom ssh executable to gather the ports and services that will need to be forwarded from the application. It will then use this information to construct a command that the user can run to forward the ports themselves. The command structure assumes that the ssh executable uses the same flags as openSSH.

The scp command will not attempt to use any ssh executable. Instead, a helpful error will be reported with an scp command. The user can use the command to upload/download the file themselves. If the client is on windows, no scp command is provided since we cannot assume that the client has an scp executable available. Instead, a helpful error message will be provided instructing the user to investigate 3rd-party alternatives such as FileZilla and WinSCP.

Comment 22 Yanping Zhang 2015-11-19 05:54:25 UTC
There is a typo about the app url in the step 2.5 in Comment 21, update result as below:
2.5 # rhc port-forward ruby1
Checking available ports ... done
You can try forwarding ports manually by running the command:
  /tmp/ssh -N -L 8080:127.11.202.129:8080 -L 24443:127.11.202.129:24443 domzyp-ruby1-1.com.cn
A SSH executable is specified and cannot be used with this command.

# /tmp/ssh -N -L 8080:127.11.202.129:8080 -L 24443:127.11.202.129:24443 domzyp-ruby1-1.com.cn
# curl localhost:8080 |grep Welcome
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
 40 39592   40 16154    0     0   8341      0  0:00:04  0:00:01   <title>Welcome to OpenShift</title>
100 39592  100 39592    0     0  12528      0  0:00:03  0:00:03 --:--:-- 12            <h1>Welcome to your Ruby application on OpenShift</h1>
537

Comment 23 Yanping Zhang 2015-11-19 08:06:27 UTC
Checked the rhc client for windows, found no --ssh option in the version.
$rhc --version
rhc 1.38.4

Looks like we need to wait until the fix is contained, if we want to verify this bug on windows.

Comment 24 Yanping Zhang 2015-11-19 10:29:15 UTC
Timothy,
There is no rhc gem file for windows provided in puddle OpenShiftEnterpriseErrata/2.2/2015-11-17.1, and other rhc gem file, such as from latest stage doesn't contain the fix, 
So we can not have a test on windows unless you provide a gem file.

Comment 25 Timothy Williams 2015-11-19 14:34:28 UTC
Ah, I apologize. I'll attach the built gem to this bugzilla as a private attachment. I did not realize a puddle did not build the gem for us.

Comment 27 Yanping Zhang 2015-11-23 10:27:38 UTC
Tested with rhc 1.38.4.2 on windows 7.
Steps to test:
1.Setup with --ssh option:
$rhc setup --server=<serveraddr> --ssh "/c/Users/Win7x64/Downloads/OpenSSH-Win32/ssh.exe"
After setup, there is --ssh in .openshift/express.conf: ssh="c:/Users/Win7x64/Downloads/OpenSSH-Win32/ssh.exe"

2.Ssh into app:
$rhc ssh ruby1
2.Ssh into app:
Connecting to domtest-ruby1-1.com.cn ...
<--snip-->
Could ssh into ruby1 directly.

3.Do snapshot of app:
3.1$ rhc snapshot save ruby1
Pulling down a snapshot of application 'ruby1' to ruby1.tar.gz ... The system cannot find the path specified.

Error in trying to save snapshot. You can try to save manually by running:
c:/Users/Win7x64/Downloads/OpenSSH-Win32/ssh.exe domtest-ruby1-1.com.cn 'snapshot' > ruby1.tar.gz
3.2$ ls -l ruby1.tar.gz
-rw-r--r--    1 Win7x64  Administ        0 Nov 23 18:14 ruby1.tar.gz
3.3$ c:/Users/Win7x64/Downloads/OpenSSH-Win32/ssh.exe domtest-ruby1-1.com.cn 'snapshot' > ruby1.tar.gz
Creating and sending tar.gz

3.4$ ls -l ruby1.tar.gz
-rw-r--r--    1 Win7x64  Administ   153484 Nov 23 18:16 ruby1.tar.gz

4.Do tail app:
$ rhc tail ruby1

Win7x64@WIN7X64-PC ~
$
$ rhc tail ruby1 --debug
DEBUG: Using config file c:/Users/Win7x64/.openshift/express.conf
DEBUG: Git config '"C:\Program Files (x86)\Git\bin\git.exe" config --get rhc.app-id' returned ''
DEBUG: Git config '"C:\Program Files (x86)\Git\bin\git.exe" config --get rhc.app-name' returned ''
DEBUG: Git config '"C:\Program Files (x86)\Git\bin\git.exe" config --get rhc.domain-name' returned ''
DEBUG: Authenticating with RHC::Auth::Token
DEBUG: Connecting to https://10.66.79.121/broker/rest/api
DEBUG: Getting all domains
DEBUG: Client supports API versions 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7
DEBUG: Created new httpclient
DEBUG: Request GET https://10.66.79.121/broker/rest/api
DEBUG: SSL Verification failed -- Using self signed cert
DEBUG:    code 200 1156 ms
DEBUG: Server supports API versions 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7
DEBUG:    Using API version 1.7
DEBUG: Client API version 1.7 is not current. Refetching API
DEBUG: Request GET https://10.66.79.121/broker/rest/api
DEBUG: SSL Verification failed -- Using self signed cert
DEBUG:    code 200   62 ms
DEBUG: Using token authentication
DEBUG: Request GET https://10.66.79.121/broker/rest/domains
DEBUG: SSL Verification failed -- Using self signed cert
DEBUG:    code 200   62 ms
DEBUG: Using token authentication
DEBUG: Request GET https://10.66.79.121/broker/rest/domain/domtest/application/ruby1?include=cartridges
DEBUG: SSL Verification failed -- Using self signed cert
DEBUG:    code 200   78 ms
DEBUG: Tail in progress for cartridge *
DEBUG: Using user specified SSH: c:/Users/Win7x64/Downloads/OpenSSH-Win32/ssh.exe
DEBUG: Running c:/Users/Win7x64/Downloads/OpenSSH-Win32/ssh.exe -t domtest-ruby1-1.com.cn 'tail */log*/*'
GetConsoleMode failed with 6

5.Do scp to app:
$ rhc scp ruby1 upload ./ca.crt app-root/data/
User specified a ssh executable
On Windows, file transfers to/from a gear can be completed with many different third-party tools such as FileZilla or WinSCP.
Alternatively, omit the --ssh flag and the 'ssh' directive in configuration to utilize the rhc tool's internal scp implementation.
A SSH executable is specified and cannot be used with this command.

6.Do port-forward to app:
$ rhc port-forward ruby1
Checking available ports ... /bin/bash: rhc-list-ports 2>&1: command not found

From the test result, there are still some issues:
Step 3 have prompted info to user, but still generated a empty file according to step3.1.
Step 4 and step 6 failed, and did not act as expected.

Comment 28 openshift-github-bot 2015-11-26 00:26:17 UTC
Commit pushed to master at https://github.com/openshift/rhc

https://github.com/openshift/rhc/commit/25e14a1a8440cf71d38bc998a06499e813d2f9e2
When stderr is redirected to `/dev/null`, no output is seen from `rhc tail` and the command ends immediately. After this change, no redirection will occur when run on windows systems, resolving this issue.

Additionally, the `rhc snapshot-save` and `rhc snapshot-restore` commands were suffering from the same issue. This has been resolved by, again, only adding the stderr redirection to `/dev/null` when not run on windows.

Bug 1177753
https://bugzilla.redhat.com/show_bug.cgi?id=1177753

Comment 30 openshift-github-bot 2015-12-03 22:11:24 UTC
Commit pushed to master at https://github.com/openshift/rhc

https://github.com/openshift/rhc/commit/418952c3de6f8a6567d6ac12d58553f57934b88e
Enable deployment operations to utilize a custom ssh executable

Bug 1177753
https://bugzilla.redhat.com/show_bug.cgi?id=1177753

Deploying a git ref, binary file, or binary file url previously only used ruby's implementation of ssh through the `Net::SSH` library. After this change, these deployment operations will honor the `--ssh` global option or `ssh` configuration directive.

Activating deployments will now also honor a custom ssh executable.

Additionally, the tests have been heavily modifed. Previously, tests that test the various ways `rhc app deploy` is used were located in `spec/rhc/commands/deployment_spec.rb`. This spec file is meant to test `rhc deployment` commands. The new ssh executable code added to the DeploymentHelpers class could not be properly tested from `deployment_spec.rb`. All `rhc app deploy` tests have been moved to their proper home, `spec/rhc/commands/app.rb`, and modified to work appropriately.

Comment 32 Yanping Zhang 2015-12-04 10:21:14 UTC
Timothy, could you provide a rhc gem file again so that we can have a test on windows?

Comment 34 Yanping Zhang 2015-12-07 06:47:41 UTC
Tested on win7 with rhc-1.38.4.3
Steps to test:
1.Setup with --ssh option:
$rhc setup --server=<serveraddr> --ssh "/c/Users/Win7x64/Downloads/OpenSSH-Win32/ssh.exe"
After setup, there is --ssh in .openshift/express.conf: ssh="c:/Users/Win7x64/Downloads/OpenSSH-Win32/ssh.exe"
2.After config app with manual deploy, try to deploy app:
Modify "Welcome to OpenShift" with "Welcome to OpenShift test3" in ruby app's config.ru
$git add .;git commit -am "test three"; git push
2.1 $ rhc app deploy 4a08716 -a rb1
Deployment of git ref '4a08716' in progress for application rb1 ...
Connection to rb1-domzyp.ose22-auto.com.cn closed.
Error deploying git ref. You can try to deploy manually with:
c:/Users/Win7x64/Downloads/OpenSSH-Win32/ssh.exe -t domzyp-rb1-1.com.cn 'gear deploy 4a08716'
GetConsoleMode failed with 6
2.2 $ c:/Users/Win7x64/Downloads/OpenSSH-Win32/ssh.exe -t domzyp-rb1-1.com.cn 'gear deploy 4a08716'
2.3 Check the change has taken effect:
$ curl http://rb1-domzyp.ose22-auto.com.cn |grep Welcome
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1122    0  1122    0     0    613      0 --:--:--  0:00:01 --:--:--  1596  <title>Welcome to OpenShift test3</title>

3.Do rhc deployment-activate to app
3.1 $ rhc deployment list -a rb1
Dec 04  6:09 PM, deployment f701fb5b
Dec 04  6:17 PM, deployment a1d1595f (rolled back)
Dec 04  6:20 PM, deployment edcc5c8f (rolled back)
Dec 04  6:24 PM, deployment f701fb5b (rollback to Dec 04  6:09 PM, rolled back)
1:47 PM, deployment a1d1595f (rollback to Dec 04  6:17 PM)
1:56 PM, deployment 60ef820d
3.2 Try to rollback:
$ rhc deployment-activate edcc5c8f -a rb1
Activating deployment 'edcc5c8f' on application rb1 ...
Connection to rb1-domzyp.ose22-auto.com.cn closed.
Error activating deployment. You can try to activate manually with:
c:/Users/Win7x64/Downloads/OpenSSH-Win32/ssh.exe -t
domzyp-rb1-1.com.cn 'gear activate --all edcc5c8f'
GetConsoleMode failed with 6
3.3 Manually deploy successfully:
$ c:/Users/Win7x64/Downloads/OpenSSH-Win32/ssh.exe -t domzyp-rb1-1.com.cn 'gear activate --all edcc5c8f'
Activating deployment
Stopping Ruby cartridge
Waiting for stop to finish
Waiting for stop to finish
Waiting for stop to finish
Waiting for stop to finish
Waiting for stop to finish
Waiting for stop to finish
Waiting for stop to finish
Waiting for stop to finish
Waiting for stop to finish
Waiting for stop to finish
Compilation of assets is disabled or assets not detected.
Starting Ruby cartridge
Connection to rb1-domzyp.ose22-auto.com.cn closed.
$ curl http://rb1-domzyp.ose22-auto.com.cn|grep Welcome
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1122    0  1122    0     0    897      0 --:--:--  0:00:01 --:--:--  2397  <title>Welcome to OpenShift test2</title>

4.Tail app:
$ rhc tail rb1
GetConsoleMode failed with 6
5.Port-forward app:
$ rhc port-forward rb1
Checking available ports ... /bin/bash: rhc-list-ports 2>&1: command not found

Test results conclusion:
1. According to step 2 and step 3, now rhc deploy and rhc deploy-activate can work under defined ssh executive.
2. According to step 4 and step 5, prompt info for rhc tail shows up, but need enhance with detailed info, because user don't know what happened and what need to be done next. And the failure info for rhc port-forward is still confused as before.

Comment 35 openshift-github-bot 2015-12-09 17:08:02 UTC
Commit pushed to master at https://github.com/openshift/rhc

https://github.com/openshift/rhc/commit/b0faf9dcc35f0d7655d21de6d4d4690ee8a087d1
Return a helpful error message if port-forward fails with custom ssh executable

Bug 1177753
https://bugzilla.redhat.com/show_bug.cgi?id=1177753

Previously, if port-forward failed to run the custom ssh executable specified, only the output from the command run was displayed. After this change, a helpful message should be displayed that includes the output of the command run with the ssh executable.

Comment 37 Timothy Williams 2015-12-09 20:54:36 UTC
I'm not familiar with the error seen from the rhc tail output:
  GetConsoleMode failed with 6

Googling a bit, this looks like an error returned from the windows console. I do not receive this error on my windows 7 system. Could you please re-test on a new system and if you still see the errors, let us know your set-up steps?

The rhc port-forward issue should be resolved now. An error should be properly reported when the rhc-list-ports command is missing, or if there is another problem attempting to gather the list of ports to forward from the gear. When using the --debug flag, the error received from the ssh command should be reported.

Please re-test with the latest gem attached to this BZ.

A puddle has also been created with the latest build for testing on RHEL:

http://buildvm-devops.usersys.redhat.com/puddle/build/OpenShiftEnterpriseErrata/2.2/2015-12-09.1/

Comment 38 Yanping Zhang 2015-12-11 09:49:00 UTC
Hi, Timothy, sorry, I have no other windows system prepared. Still test on my origin win7.
1.About tail command, if we run with --debug, from the output, user will know that he can run the command below manually, it succeeds to get results:
c:/Users/Win7x64/Downloads/OpenSSH-Win32/ssh.exe -t domzyp-rbtest-1.com.cn 'tail */log*/*'
So it is possible to add this command info in the output info of command "rhc tail rbtest"?
1.1
$ rhc tail rbtest --debug
DEBUG: Using config file c:/Users/Win7x64/.openshift/express.conf
DEBUG: Git config '"C:\Program Files (x86)\Git\bin\git.exe" config --get rhc.app-id' returned ''
DEBUG: Git config '"C:\Program Files (x86)\Git\bin\git.exe" config --get rhc.app-name' returned ''
DEBUG: Git config '"C:\Program Files (x86)\Git\bin\git.exe" config --get rhc.domain-name' returned ''
DEBUG: Authenticating with RHC::Auth::Token
DEBUG: Connecting to https://10.66.79.138/broker/rest/api
DEBUG: Getting all domains
DEBUG: Client supports API versions 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7
DEBUG: Created new httpclient

.......

DEBUG: SSL Verification failed -- Using self signed cert
DEBUG:    code 200   78 ms
DEBUG: Tail in progress for cartridge *
DEBUG: Using user specified SSH: c:/Users/Win7x64/Downloads/OpenSSH-Win32/ssh.exe
DEBUG: Running c:/Users/Win7x64/Downloads/OpenSSH-Win32/ssh.exe -t domzyp-rbtest-1.com.cn 'tail */log*/*'
GetConsoleMode failed with 6

1.2
$ c:/Users/Win7x64/Downloads/OpenSSH-Win32/ssh.exe -t domzyp-rbtest-1.com.cn 'tail */log*/*'
[ 2015-12-11 14:15:21.8660 17187/7fcf37753720 agents/HelperAgent/Main.cpp:602 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger/passenger.1.0.17152/generation-1/request
[ 2015-12-11 14:15:21.8727 17192/7f3dcc91c7e0 agents/LoggingAgent/Main.cpp:318 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger/passenger.1.0.17152/generation-1/logging
[ 2015-12-11 14:15:21.8730 17184/7f5a7c0c3720 agents/Watchdog/Main.cpp:631 ]: All Phusion Passenger agents started!
[Fri Dec 11 14:15:21 2015] [notice] Digest: generating secret for digest authentication ...
[Fri Dec 11 14:15:21 2015] [notice] Digest: done
[Fri Dec 11 14:15:21 2015] [notice] Apache/2.2.15 (Unix) Phusion_Passenger/4.0.18 configured -- resuming normal operations
[ 2015-12-11 14:15:24.6961 17187/7fcf3765c700 Pool2/Spawner.h:738 ]: [App 17218 stdout]
- - - [11/Dec/2015:14:15:24 +0800] "HEAD / HTTP/1.1" 200 - "-" "-"
- - - [11/Dec/2015:14:15:24 +0800] "HEAD / HTTP/1.1" 200 - "-" "-"
[ 2015-12-11 14:15:25.1059 17187/7fcf3765c700 Pool2/Spawner.h:738 ]: [App 17236 stdout]


2.About port-forward, manually run command according to the prompt info:
2.1
Win7x64@WIN7X64-PC ~
$ rhc port-forward rbtest
Checking available ports ... /bin/bash: rhc-list-ports 2>&1: command not found

Error attempting to collect ports to forward from app. You can try to forward ports manually.
First, to get the destination ip and port, run the following command:
  c:/Users/Win7x64/Downloads/OpenSSH-Win32/ssh.exe domzyp-rbtest-1.com.cn 'rhc-list-ports 2>&1'
Then, run the following command with the ports and ip substituted:
  c:/Users/Win7x64/Downloads/OpenSSH-Win32/ssh.exe -N -L <local_port>:<gear_ip>:<destination_port>
2.2
Win7x64@WIN7X64-PC ~
$ c:/Users/Win7x64/Downloads/OpenSSH-Win32/ssh.exe domzyp-rbtest-1.com.cn 'rhc-list-ports 2>&1'
httpd -> 127.12.46.1:8080
ruby -> 127.12.46.1:35488
2.3
Win7x64@WIN7X64-PC ~
$ c:/Users/Win7x64/Downloads/OpenSSH-Win32/ssh.exe -N -L 35488:127.12.46.1:35488 -L 8080:127.12.46.1:8080 domzyp-rbtest-1
-auto.com.cn

After run step 2.3, it hangs there without output always. Is the command wrong?

Comment 39 Yanping Zhang 2015-12-11 09:58:41 UTC
Apologize, missed the last step for the port-forward, added here:
2.4 $ curl localhost:8080|grep Welcome
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0  <title>Welcome to OpenShift</title>
            <h1>Welcome to your Ruby application on OpenShift</h1>1
00 39590    0 39590    0     0   613k      0 --:--:-- --:--:-- --:--:--  613k

So the port-forward command can work now.
In "rhc port-forward rbtest"
Suggest modify this output info from:
Then, run the following command with the ports and ip substituted:
  c:/Users/Win7x64/Downloads/OpenSSH-Win32/ssh.exe -N -L <local_port>:<gear_ip>:<destination_port>

to:
Then, run the following command with the ports and ip substituted:
  c:/Users/Win7x64/Downloads/OpenSSH-Win32/ssh.exe -N -L <local_port>:<gear_ip>:<destination_port> domzyp-rbtest-1

Comment 42 Yanping Zhang 2015-12-14 10:16:58 UTC
Hi, Timothy,
Below are programs version on my Win7 Build 7601 :
Win7x64@WIN7X64-PC ~
$ git --version
git version 1.7.11.msysgit.1

Win7x64@WIN7X64-PC ~
$ ruby -v
ruby 1.9.3p0 (2011-10-30) [i386-mingw32]

Deploy OpenSSH-Win32.zip according to Comment 14 under:c:/Users/Win7x64/Downloads/OpenSSH-Win32/ssh.exe

--------------

Have tested on your provided windows7-2.gsslab.rdu2.redhat.com against my ose env server and rhc-1.38.4.4, the "rhc tail" command works as you said indeed.

But I'm not sure what configurations effect the test on my Win7. Maybe the ssh execution tool is different.

--------------

About your modified rhc port-forward code, tested  on linux with rhc rpm from the 12-11.1 puddle, it works well, has no issues. And the latest gem file is still rhc-1.38.4.4.gem, it doesn't contain your modification, right?

Comment 43 Timothy Williams 2015-12-14 15:41:55 UTC
Yanping,

Thank you for pointing out comment #14, it looks like that is the issue. The openssh zip archive Eric instructed you to download from github is an incomplete project with known issues - not yet meant to be used in production applications.

Instead of installing ssh in this manner, we reccomend in the documentation to install ssh alongside git with git-for-windows:

  https://developers.openshift.com/en/getting-started-windows.html#client-tools
  https://git-for-windows.github.io/

Could you please set up the windows environment by installing and using the ssh executable through the recommended installer linked below?

  https://github.com/git-for-windows/git/releases/download/v2.6.3.windows.1/Git-2.6.3-64-bit.exe

I will also upload the latest .gem file so that testing around port-forward can be performed on windows.

Thanks and sorry for this confusion!

Comment 45 Yanping Zhang 2015-12-15 02:47:09 UTC
Tested with rhc-1.38.4.5.gem on win7 using executable ssh according to Comment 43.
Steps to test:
1.Setup with ssh option:
$ rhc setup --server=https://10.66.79.138 --ssh "C:\User\Win7x64\AppData\Local\Programs\Git\usr\bin\ssh.exe"
2.Tail app:
C:\Users\Win7x64>rhc tail rbtest
[ 2015-12-11 14:15:21.8727 17192/7f3dcc91c7e0 agents/LoggingAgent/Main.cpp:318 ]
: PassengerLoggingAgent online, listening at unix:/tmp/passenger/passenger.1.0.1
7152/generation-1/logging
[ 2015-12-11 14:15:21.8730 17184/7f5a7c0c3720 agents/Watchdog/Main.cpp:631 ]: Al
l Phusion Passenger agents started!
[Fri Dec 11 14:15:21 2015] [notice] Digest: generating secret for digest authent
ication ...
[Fri Dec 11 14:15:21 2015] [notice] Digest: done
[Fri Dec 11 14:15:21 2015] [notice] Apache/2.2.15 (Unix) Phusion_Passenger/4.0.1
8 configured -- resuming normal operations
[ 2015-12-11 14:15:24.6961 17187/7fcf3765c700 Pool2/Spawner.h:738 ]: [App 17218
stdout]
- - - [11/Dec/2015:14:15:24 +0800] "HEAD / HTTP/1.1" 200 - "-" "-"
- - - [11/Dec/2015:14:15:24 +0800] "HEAD / HTTP/1.1" 200 - "-" "-"
[ 2015-12-11 14:15:25.1059 17187/7fcf3765c700 Pool2/Spawner.h:738 ]: [App 17236
stdout]
- - - [11/Dec/2015:17:51:50 +0800] "GET / HTTP/1.1" 200 39590 "-" "curl/7.26.0"

3.Port-forward app:
C:\Users\Win7x64>rhc port-forward rbtest
Checking available ports ... done
You can try forwarding ports manually by running the command:
  C:\Users\Win7x64\AppData\Local\Programs\Git\usr\bin\ssh.exe -N -L
8080:127.12.46.1:8080 -L 35488:127.12.46.1:35488
domzyp-rbtest-1.com.cn
A SSH executable is specified and cannot be used with this command.

C:\Users\Win7x64> C:\Users\Win7x64\AppData\Local\Programs\Git\usr\bin\ssh.exe -N
 -L 8080:127.12.46.1:8080 -L 35488:127.12.46.1:35488 domzyp-rbtest-1@rbtest-domz
yp.ose22-auto.com.cn

$ curl localhost:8080 |grep Welcome
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 39590    0 39590    0     0  1247k      0 --:--:-- --:--:-- --:--:-- 2416k
  <title>Welcome to OpenShift</title>
            <h1>Welcome to your Ruby application on OpenShift</h1>

Now all the issues have been fixed, so move the bug to Verified.

Comment 47 errata-xmlrpc 2015-12-17 17:09:50 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2015-2666.html


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