Bug 822933 - Wizard fails during configuring SSH keys
Summary: Wizard fails during configuring SSH keys
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OKD
Classification: Red Hat
Component: oc
Version: 2.x
Hardware: Unspecified
OS: Unspecified
medium
high
Target Milestone: ---
: ---
Assignee: John (J5) Palmieri
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-05-18 14:52 UTC by Clayton Coleman
Modified: 2015-05-15 01:54 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-06-08 17:59:29 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Whole wizard flow (1.90 KB, text/plain)
2012-05-22 06:59 UTC, Xiaoli Tian
no flags Details

Description Clayton Coleman 2012-05-18 14:52:54 UTC
We need to gracefully handle unreadable keys from the server.  I have a key with the value "ssh-rsa default" - it should be listed as potentially valid but unprocesseable in the CLI

Created local config file: /home/clayton/.openshift/express.conf
express.conf contains user configuration and can be transferred across clients.
/home/clayton/.rvm/gems/ruby-1.9.3-p194/gems/net-ssh-2.3.0/lib/net/ssh/buffer.rb:259:in `read_keyblob': unsupported key type `���^��'' (NotImplementedError)
	from /home/clayton/.rvm/gems/ruby-1.9.3-p194/gems/net-ssh-2.3.0/lib/net/ssh/buffer.rb:239:in `read_key'
	from /home/clayton/.rvm/gems/ruby-1.9.3-p194/gems/net-ssh-2.3.0/lib/net/ssh/key_factory.rb:96:in `load_data_public_key'
	from /home/clayton/.rvm/gems/ruby-1.9.3-p194/gems/rhc-0.93.3/lib/rhc-common.rb:316:in `block in get_ssh_keys'
	from /home/clayton/.rvm/gems/ruby-1.9.3-p194/gems/rhc-0.93.3/lib/rhc-common.rb:312:in `each'
	from /home/clayton/.rvm/gems/ruby-1.9.3-p194/gems/rhc-0.93.3/lib/rhc-common.rb:312:in `get_ssh_keys'
	from /home/clayton/.rvm/gems/ruby-1.9.3-p194/gems/rhc-0.93.3/lib/rhc/wizard.rb:95:in `ssh_key_uploaded?'
	from /home/clayton/.rvm/gems/ruby-1.9.3-p194/gems/rhc-0.93.3/lib/rhc/wizard.rb:148:in `upload_ssh_key_stage'

Comment 1 Xiaoli Tian 2012-05-22 06:59:18 UTC
Created attachment 585941 [details]
Whole wizard flow

Tried this  with rhc-0.93.3 on windows 7, upload key will have the following error, please see attachment for the whole flow.

Current Keys:

C:/Ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.93.3/lib/rhc/wizard.rb:147:in `upload_
ssh_key': undefined local variable or method `known_key' for #<RHC::Wizard:0x287
6ac0> (NameError)
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.93.3/lib/rhc/wizard.rb:18
5:in `upload_ssh_key_stage'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.93.3/lib/rhc/wizard.rb:39
:in `block in run'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.93.3/lib/rhc/wizard.rb:37
:in `each'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.93.3/lib/rhc/wizard.rb:37
:in `run'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.93.3/lib/rhc-common.rb:12
80:in `default_setup_wizard'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.93.3/bin/rhc:40:in `<top
(required)>'
        from C:/Ruby193/bin/rhc:23:in `load'
        from C:/Ruby193/bin/rhc:23:in `<main>'

Comment 2 Xiaoli Tian 2012-05-22 07:03:25 UTC
For it will always fail for the first experience user on windows, suggest higher priority to fix it.

Comment 3 John (J5) Palmieri 2012-05-22 13:42:00 UTC
I have a fix coming down the pipe

Comment 4 Xiaoli Tian 2012-05-25 03:43:44 UTC
Tested this on rhc-0.93.11 , it will fail on windows and Mac

In Windows 7 x86_64
---------------------------------------------------------------------
C:\Users\Administrator>rhc help
Starting Interactive Setup for OpenShift's command line interface
It looks like you've not used OpenShift on this machine before.  We'll help get
you setup with just a couple of questions. You can skip this in the future by co
pying your config's around:

C:/Users/Administrator/.openshift/express.conf
C:/Users/Administrator/.ssh/
To connect to openshift.redhat.com enter your OpenShift login (email or Red Hat
login id): xtian+1
Password: ******

Created local config file: C:/Users/Administrator/.openshift/express.conf
express.conf contains user configuration and can be transferred across clients.

No SSH Key has been found.  We're generating one for you.

C:/Ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.93.11/lib/rhc-common.rb:1230:in `gener
ate_ssh_key_ruby': uninitialized constant FileUtil (NameError)
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.93.11/lib/rhc/wizard.rb:1
32:in `config_ssh_key_stage'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.93.11/lib/rhc/wizard.rb:4
2:in `block in run'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.93.11/lib/rhc/wizard.rb:4
0:in `each'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.93.11/lib/rhc/wizard.rb:4
0:in `run'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.93.11/lib/rhc-common.rb:1
285:in `default_setup_wizard'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.93.11/bin/rhc:41:in `<top
 (required)>'
        from C:/Ruby193/bin/rhc:23:in `load'
        from C:/Ruby193/bin/rhc:23:in `<main>'
---------------------------------------------------------------------------

In Mac :
-------------------------------------------------
OpenShiftmatoMacBook-Pro:~ root# rhc help

Starting Interactive Setup for OpenShift's command line interface

It looks like you've not used OpenShift on this machine before.  We'll help get you setup with just a couple of questions. You can skip this in the future by copying your config's around:

/var/root/.openshift/express.conf
/var/root/.ssh/

To connect to openshift.redhat.com enter your OpenShift login (email or Red Hat login id): xtian+1
Password: ******

Created local config file: /var/root/.openshift/express.conf
express.conf contains user configuration and can be transferred across clients.

No SSH Key has been found.  We're generating one for you.

    Created: /var/root/.ssh/id_rsa.pub

/Library/Ruby/Gems/1.8/gems/rhc-0.93.11/lib/rhc-common.rb:311:in `get_ssh_keys': undefined method `load_data_public_key' for Net::SSH::KeyFactory:Class (NoMethodError)
	from /Library/Ruby/Gems/1.8/gems/rhc-0.93.11/lib/rhc/wizard.rb:141:in `ssh_key_uploaded?'
	from /Library/Ruby/Gems/1.8/gems/rhc-0.93.11/lib/rhc/wizard.rb:217:in `upload_ssh_key_stage'
	from /Library/Ruby/Gems/1.8/gems/rhc-0.93.11/lib/rhc/wizard.rb:42:in `send'
	from /Library/Ruby/Gems/1.8/gems/rhc-0.93.11/lib/rhc/wizard.rb:42:in `run'
	from /Library/Ruby/Gems/1.8/gems/rhc-0.93.11/lib/rhc/wizard.rb:40:in `each'
	from /Library/Ruby/Gems/1.8/gems/rhc-0.93.11/lib/rhc/wizard.rb:40:in `run'
	from /Library/Ruby/Gems/1.8/gems/rhc-0.93.11/lib/rhc-common.rb:1285:in `default_setup_wizard'
	from /Library/Ruby/Gems/1.8/gems/rhc-0.93.11/bin/rhc:41
	from /usr/bin/rhc:19:in `load'
	from /usr/bin/rhc:19
-----------------------------------------------------------

Comment 5 Xiaoli Tian 2012-05-25 04:35:48 UTC
In RHEL, it will also fail with the following error sometimes:


#rhc help
Starting Interactive Setup for OpenShift's command line interface
It looks like you've not used OpenShift on this machine before.  We'll help get you setup with just a couple of questions. You can skip this in the future by copying your config's around:

/home/xiaoli/.openshift/express.conf
/home/xiaoli/.ssh/

To connect to openshift.redhat.com enter your OpenShift login (email or Red Hat login id): xtian+1
Password: ******

/usr/lib/ruby/gems/1.8/gems/rhc-0.93.11/lib/rhc-rest/client.rb:21:in `initialize': Resource could not be accessed:Connection reset by peer - SSL_connect (Rhc::Rest::ResourceAccessException)
	from /usr/lib/ruby/gems/1.8/gems/rhc-0.93.11/lib/rhc/wizard.rb:93:in `new'
	from /usr/lib/ruby/gems/1.8/gems/rhc-0.93.11/lib/rhc/wizard.rb:93:in `login_stage'
	from /usr/lib/ruby/gems/1.8/gems/rhc-0.93.11/lib/rhc/wizard.rb:42:in `send'
	from /usr/lib/ruby/gems/1.8/gems/rhc-0.93.11/lib/rhc/wizard.rb:42:in `run'
	from /usr/lib/ruby/gems/1.8/gems/rhc-0.93.11/lib/rhc/wizard.rb:40:in `each'
	from /usr/lib/ruby/gems/1.8/gems/rhc-0.93.11/lib/rhc/wizard.rb:40:in `run'
	from /usr/lib/ruby/gems/1.8/gems/rhc-0.93.11/lib/rhc-common.rb:1285:in `default_setup_wizard'
	from /usr/lib/ruby/gems/1.8/gems/rhc-0.93.11/bin/rhc:41
	from /usr/bin/rhc:19:in `load'
	from /usr/bin/rhc:19

Comment 6 Attila Nagy 2012-05-25 08:58:43 UTC
Tried on CentOS6. Result is the following.


$ rhc domain create -n mydomainwiz -l anagy+20120525wiz1 -p redhat

Starting Interactive Setup for OpenShift's command line interface

It looks like you've not used OpenShift on this machine before.  We'll help get you setup with just a couple of questions. You can skip this in the future by copying your config's around:

/home/testuser/.openshift/express.conf
/home/testuser/.ssh/

To connect to ec2-23-22-150-150.compute-1.amazonaws.com enter your OpenShift login (email or Red Hat login id): anagy+20120525wiz1
Password: ******

Created local config file: /home/testuser/.openshift/express.conf
express.conf contains user configuration and can be transferred across clients.

No SSH Key has been found.  We're generating one for you.

/usr/lib/ruby/gems/1.8/gems/rhc-0.93.11/lib/rhc-common.rb:1230:in `generate_ssh_key_ruby': uninitialized constant FileUtil (NameError)
	from /usr/lib/ruby/gems/1.8/gems/rhc-0.93.11/lib/rhc/wizard.rb:132:in `config_ssh_key_stage'
	from /usr/lib/ruby/gems/1.8/gems/rhc-0.93.11/lib/rhc/wizard.rb:42:in `send'
	from /usr/lib/ruby/gems/1.8/gems/rhc-0.93.11/lib/rhc/wizard.rb:42:in `run'
	from /usr/lib/ruby/gems/1.8/gems/rhc-0.93.11/lib/rhc/wizard.rb:40:in `each'
	from /usr/lib/ruby/gems/1.8/gems/rhc-0.93.11/lib/rhc/wizard.rb:40:in `run'
	from /usr/lib/ruby/gems/1.8/gems/rhc-0.93.11/lib/rhc-common.rb:1285:in `default_setup_wizard'
	from /usr/lib/ruby/gems/1.8/gems/rhc-0.93.11/bin/rhc:41
	from /usr/bin/rhc:19:in `load'
	from /usr/bin/rhc:19

Comment 7 John (J5) Palmieri 2012-05-25 17:20:17 UTC
(In reply to comment #6)

This bug should just went into my branch and should be fixed when it gets pulled into master sometime today

Comment 8 John (J5) Palmieri 2012-05-25 17:22:20 UTC
(In reply to comment #1)

This perticular issue was fixed in last nights build

Comment 9 John (J5) Palmieri 2012-05-25 17:32:33 UTC
> 
> In Mac :
> -------------------------------------------------
> OpenShiftmatoMacBook-Pro:~ root# rhc help
> 
> Starting Interactive Setup for OpenShift's command line interface
> 
> It looks like you've not used OpenShift on this machine before.  We'll help
> get you setup with just a couple of questions. You can skip this in the
> future by copying your config's around:
> 
> /var/root/.openshift/express.conf
> /var/root/.ssh/
> 
> To connect to openshift.redhat.com enter your OpenShift login (email or Red
> Hat login id): xtian+1
> Password: ******
> 
> Created local config file: /var/root/.openshift/express.conf
> express.conf contains user configuration and can be transferred across
> clients.
> 
> No SSH Key has been found.  We're generating one for you.
> 
>     Created: /var/root/.ssh/id_rsa.pub
> 
> /Library/Ruby/Gems/1.8/gems/rhc-0.93.11/lib/rhc-common.rb:311:in
> `get_ssh_keys': undefined method `load_data_public_key' for
> Net::SSH::KeyFactory:Class (NoMethodError)
> 	from /Library/Ruby/Gems/1.8/gems/rhc-0.93.11/lib/rhc/wizard.rb:141:in
> `ssh_key_uploaded?'
> 	from /Library/Ruby/Gems/1.8/gems/rhc-0.93.11/lib/rhc/wizard.rb:217:in
> `upload_ssh_key_stage'
> 	from /Library/Ruby/Gems/1.8/gems/rhc-0.93.11/lib/rhc/wizard.rb:42:in `send'
> 	from /Library/Ruby/Gems/1.8/gems/rhc-0.93.11/lib/rhc/wizard.rb:42:in `run'
> 	from /Library/Ruby/Gems/1.8/gems/rhc-0.93.11/lib/rhc/wizard.rb:40:in `each'
> 	from /Library/Ruby/Gems/1.8/gems/rhc-0.93.11/lib/rhc/wizard.rb:40:in `run'
> 	from /Library/Ruby/Gems/1.8/gems/rhc-0.93.11/lib/rhc-common.rb:1285:in
> `default_setup_wizard'
> 	from /Library/Ruby/Gems/1.8/gems/rhc-0.93.11/bin/rhc:41
> 	from /usr/bin/rhc:19:in `load'
> 	from /usr/bin/rhc:19
> -----------------------------------------------------------


This is different.  What version of Net::SSH do you have installed?  Can you run gem list net-ssh?  Thanks.

Comment 10 Xiaoli Tian 2012-05-28 02:20:45 UTC
 gem list net-ssh

*** LOCAL GEMS ***

net-ssh (2.0.4, 1.1.4)
net-ssh-gateway (1.0.0)

Comment 11 Xiaoli Tian 2012-05-28 05:40:27 UTC
In Mac, after updating net-ssh to 2.5.2, it works now, thanks.

 #gem list net-ssh

*** LOCAL GEMS ***

net-ssh (2.5.2, 2.0.4, 1.1.4)
net-ssh-gateway (1.1.0, 1.0.0)

Comment 12 Xiaoli Tian 2012-05-28 05:45:14 UTC
Tested this with rhc-0.93.12 on windows 7 as well, it works now.


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