Bug 822933 - Wizard fails during configuring SSH keys
Wizard fails during configuring SSH keys
Status: CLOSED CURRENTRELEASE
Product: OpenShift Origin
Classification: Red Hat
Component: Command Line Interface (Show other bugs)
2.x
Unspecified Unspecified
medium Severity high
: ---
: ---
Assigned To: John (J5) Palmieri
libra bugs
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-18 10:52 EDT by Clayton Coleman
Modified: 2015-05-14 21:54 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-06-08 13:59:29 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)
Whole wizard flow (1.90 KB, text/plain)
2012-05-22 02:59 EDT, Xiaoli Tian
no flags Details

  None (edit)
Description Clayton Coleman 2012-05-18 10:52:54 EDT
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 02:59:18 EDT
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 03:03:25 EDT
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 09:42:00 EDT
I have a fix coming down the pipe
Comment 4 Xiaoli Tian 2012-05-24 23:43:44 EDT
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@redhat.com
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@redhat.com
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 00:35:48 EDT
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@redhat.com
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 04:58:43 EDT
Tried on CentOS6. Result is the following.


$ rhc domain create -n mydomainwiz -l anagy+20120525wiz1@redhat.com -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@redhat.com
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 13:20:17 EDT
(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 13:22:20 EDT
(In reply to comment #1)

This perticular issue was fixed in last nights build
Comment 9 John (J5) Palmieri 2012-05-25 13:32:33 EDT
> 
> 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@redhat.com
> 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-27 22:20:45 EDT
 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 01:40:27 EDT
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 01:45:14 EDT
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.