Bug 861556

Summary: [US2597][fork]the open4 module is not supported in win7-ruby-1.9 env
Product: OKD Reporter: Rony Gong 🔥 <qgong>
Component: ocAssignee: Fabiano Franz <ffranz>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: high Docs Contact:
Priority: high    
Version: 2.xCC: ccoleman, ffranz, johnp, pruan
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: fork_ami_US2597_US2599_US2813_US2817_US2872_US2816_US2814_226 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-11-06 18:48:07 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Rony Gong 🔥 2012-09-29 07:06:31 UTC
Description of problem:
use: rhc app create qjboss jbossas-7 --enable-jenkins in win7-ruby-1.9 env
could create jenkins and application success, but show exception.

This error only happens on win7-ruby-1.9 env


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

How reproducible:
always


Steps to Reproduce:
1.rhc app create qjboss jbossas-7 --enable-jenkins
2.
3.
  
Actual results:
C:\Users\Win7x64>rhc app create qjboss jbossas-7 --enable-jenkins
Password:

Creating application 'qjboss'
=============================

  Namespace: qgong11
  Cartridge: jbossas-7
  Gear Size: default
  Scaling:   no

Your application's domain name is being propagated worldwide (this might
take a minute)...
Your application's domain name is being propagated worldwide (this might
take a minute)...
C:/Ruby193/lib/ruby/gems/1.9.1/gems/open4-1.3.0/lib/open4.rb:58:in `fork': fork(
) function is unimplemented on this machine (NotImplementedError)
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/open4-1.3.0/lib/open4.rb:58:in
`do_popen'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/open4-1.3.0/lib/open4.rb:30:in
`popen4'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.99.3/lib/rhc/git_helper.r
b:37:in `block in git_clone_repo'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.99.3/lib/rhc/helpers.rb:2
16:in `call'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.99.3/lib/rhc/helpers.rb:2
16:in `section'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.99.3/lib/rhc/helpers.rb:2
33:in `paragraph'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.99.3/lib/rhc/git_helper.r
b:36:in `git_clone_repo'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.99.3/lib/rhc/commands/app
.rb:312:in `run_git_clone'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.99.3/lib/rhc/commands/app
.rb:83:in `create'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.99.3/lib/rhc/commands.rb:
129:in `block (3 levels) in to_commander'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/commander-4.1.2/lib/commander/c
ommand.rb:180:in `call'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/commander-4.1.2/lib/commander/c
ommand.rb:180:in `call'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/commander-4.1.2/lib/commander/c
ommand.rb:155:in `run'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/commander-4.1.2/lib/commander/r
unner.rb:402:in `run_active_command'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.99.3/lib/rhc/command_runn
er.rb:48:in `run!'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/commander-4.1.2/lib/commander/d
elegates.rb:11:in `run!'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.99.3/lib/rhc/cli.rb:40:in
 `start'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.99.3/bin/rhc:21:in `<top
(required)>'
        from C:/Ruby193/bin/rhc:23:in `load'
        from C:/Ruby193/bin/rhc:23:in `<main>'



Expected results:


Additional info:

Comment 1 John (J5) Palmieri 2012-10-01 15:48:23 UTC
Output on windows won't be as nice because we had to combine the stderr and stdout streams but it works now

Comment 2 Peter Ruan 2012-10-03 23:09:23 UTC
verified with rhc-0.99.3.gem


Peter Ruan@PRUAN-WIN7 ~
$ rhc app create -a myapp -t php-5.3 -pvostok08 -d
Submitting form:
rhlogin: pruan
debug: true
Contacting https://ec2-107-20-89-18.compute-1.amazonaws.com
Creating application: myapp in pp1234
Contacting https://ec2-107-20-89-18.compute-1.amazonaws.com
Response from server:
DEBUG:


Exit Code: 0
api_c: ["placeholder"]
broker_c: ["namespace", "rhlogin", "ssh", "app_uuid", "debug", "alter",
"cartrid
ge", "cart_type", "action", "app_name", "api"]
API version:    1.1.3
DEBUG: 'myapp' creation returned success.
Now your new domain name is being propagated worldwide (this might take a
minute
)...
Pulling new repo down
git clone
ssh://4e0a331aa863495f90c05e09139f2f5d.rhcloud.com/~
/git/myapp.git/ myapp
Checking if the application is available #1
Application myapp is available at: http://myapp-pp1234.dev.rhcloud.com/
  Git URL:
  ssh://4e0a331aa863495f90c05e09139f2f5d.rhcloud.com/~
  /git/myapp.git/
  To make changes to 'myapp', commit to myapp/.
  Successfully created application: myapp

Comment 3 Rony Gong 🔥 2012-10-08 03:03:14 UTC
Retest on fork_ami_US2597_US2599_US2813_US2817_US2872_US2816_US2814_209, failed
and my git version is git version 1.7.11.msysgit.1 , in my win7_ruby_1.9

C:\Users\Win7x64>rhc app create q3jboss jbossas-7
Password:


**********
Creating application 'q3jboss'
==============================

  Namespace: qgong1
  Cartridge: jbossas-7
  Gear Size: default
  Scaling:   no

Your application's domain name is being propagated worldwide (this might
take a minute)...
The authenticity of host 'q3jboss-qgong1.dev.rhcloud.com (50.19.31.106)' can't b
e established.
RSA key fingerprint is 4a:31:0a:9f:0e:55:d0:98:b0:b3:75:64:82:81:a1:62.
Are you sure you want to continue connecting (yes/no)? yes
Cloning into 'q3jboss'...
Warning: Permanently added 'q3jboss-qgong1.dev.rhcloud.com' (RSA) to the
list of known hosts.
Error while adding config values to git - error: wrong number of arguments
usage: git config [options]

Config file location
    --global              use global config file
    --system              use system config file
    --local               use repository config file
    -f, --file <file>     use given config file

Action
    --get                 get value: name [value-regex]
    --get-all             get all values: key [value-regex]
    --get-regexp          get values for regexp: name-regex [value-regex]
    --replace-all         replace all matching variables: name value
[value_regex]
    --add                 adds a new variable: name value
    --unset               removes a variable: name [value-regex]
    --unset-all           removes all matches: name [value-regex]
    --rename-section      rename section: old-name new-name
    --remove-section      remove a section: name
    -l, --list            list all
    -e, --edit            opens an editor
    --get-color <slot>    find the color configured: [default]
    --get-colorbool <slot>
                          find the color setting: [stdout-is-tty]

Type
    --bool                value is "true" or "false"
    --int                 value is decimal number
    --bool-or-int         value is --bool or --int
    --path                value is a path (file or directory name)

Other
    -z, --null            terminate values with NUL byte
    --includes            respect include directives on lookup

C:/Ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.99.4/lib/rhc/commands/app.rb:388:in `r
un_nslookup': undefined local variable or method `rest_app' for #<RHC::Commands:
:App:0x3114420> (NameError)
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.99.4/lib/rhc/commands/app
.rb:401:in `windows_nslookup_bug?'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.99.4/lib/rhc/commands/app
.rb:88:in `rescue in create'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.99.4/lib/rhc/commands/app
.rb:84:in `create'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.99.4/lib/rhc/commands.rb:
129:in `block (3 levels) in to_commander'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/commander-4.1.2/lib/commander/c
ommand.rb:180:in `call'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/commander-4.1.2/lib/commander/c
ommand.rb:180:in `call'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/commander-4.1.2/lib/commander/c
ommand.rb:155:in `run'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/commander-4.1.2/lib/commander/r
unner.rb:402:in `run_active_command'
 from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.99.4/lib/rhc/command_runn
er.rb:48:in `run!'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/commander-4.1.2/lib/commander/d
elegates.rb:11:in `run!'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.99.4/lib/rhc/cli.rb:40:in
 `start'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.99.4/bin/rhc:21:in `<top
(required)>'
        from C:/Ruby193/bin/rhc:23:in `load'
        from C:/Ruby193/bin/rhc:23:in `<main>'

C:\Users\Win7x64>git --version
git version 1.7.11.msysgit.1

Comment 4 Clayton Coleman 2012-10-10 16:31:51 UTC
popen4 requires additional gems on Windows, and fork is not supported in all envs.  Seems like there needs to be a fallback here.

Comment 5 John (J5) Palmieri 2012-10-10 18:43:39 UTC
That isn't the issue anymore.  The problem right now is the windows shell doesn't execute "cmd; cmd" the same way a unix shell does - that is easy to fix.  There also seems to be a traceback, most likely from a typo  in the windows nslookup path that is being triggered by the git-config command failure.

Comment 6 Fabiano Franz 2012-10-10 21:57:26 UTC
Fixed in fork_ami_US2597_US2599_US2813_US2817_US2872_US2816_US2814_226.

Comment 7 Rony Gong 🔥 2012-10-11 02:02:41 UTC
Verified on fork_ami_US2597_US2599_US2813_US2817_US2872_US2816_US2814_226.

Win7x64@WIN7X64-PC ~
$rhc app create qs2ruby19 ruby-1.9 -s
Creating application 'qs2ruby19'
================================

  Namespace: qgong5
  Cartridge: ruby-1.9
  Gear Size: default
  Scaling:   yes

Your application's domain name is being propagated worldwide (this might take a minute)...
Cloning into 'qs2ruby19'...
Warning: Permanently added 'qs2ruby19-qgong5.dev.rhcloud.com' (RSA) to the list of known hosts.
qs2ruby19 @ http://qs2ruby19-qgong5.dev.rhcloud.com/
====================================================
Created: Oct 10  9:53 PM
   UUID: 8ca06b4c74224ce1af80e7cc1d549871
Git URL: ssh://8ca06b4c74224ce1af80e7cc1d549871.rhcloud.com/~/git/qs2ruby19.git/
SSH URL: ssh://8ca06b4c74224ce1af80e7cc1d549871.rhcloud.com

Cartridges:
  ruby-1.9
  haproxy-1.4
RESULT:
Application qs2ruby19 was created.