Bug 1019562 - [fork][origin_ui_112] Error message show up when add a krb5-principal type sshkey via rhc in ruby-1.8 env
[fork][origin_ui_112] Error message show up when add a krb5-principal type ss...
Status: CLOSED CURRENTRELEASE
Product: OpenShift Online
Classification: Red Hat
Component: Command Line Interface (Show other bugs)
2.x
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Jordan Liggitt
libra bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-16 01:45 EDT by weiwei jiang
Modified: 2015-05-14 22:25 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-01-23 22:24:14 EST
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)

  None (edit)
Description weiwei jiang 2013-10-16 01:45:21 EDT
Description of problem:
when add a krb5-principal type sshkey, error message show up:
"An unexpected error occured: cannot encode Class: Commander::Command::Options"

But web console can add successfully


Version-Release number of selected component (if applicable):
fork_ami_origin_ui_112_907
rhc build from fork_ami_origin_ui_112_907 

How reproducible:
always

Steps to Reproduce:
1.Add a krb5-principal type sshkey 
2.check the output 
3.

Actual results:
# rhc sshkey add dfadf --type krb5-principal --content wjian --confirm --trace
/usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/commands/sshkey.rb:54: warning: Object#type is deprecated; use Object#class
/usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/commands/sshkey.rb:55: warning: Object#type is deprecated; use Object#class
Commander::Command::Options
wjian
/usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/commands/sshkey.rb:56: warning: Object#type is deprecated; use Object#class
The key you are uploading is not recognized.  You may not be able to authenticate to your application through Git or SSH.
/usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/vendor/okjson.rb:426:in `valenc': An unexpected error occured: cannot encode Class: Commander::Command::Options (RHC::Rest::ConnectionException)
	from /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/vendor/okjson.rb:432:in `objenc'
	from /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/rest/client.rb:510:in `map'
	from /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/vendor/okjson.rb:432:in `each'
	from /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/vendor/okjson.rb:432:in `map'
	from /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/vendor/okjson.rb:432:in `objenc'
	from /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/vendor/okjson.rb:418:in `valenc'
	from /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/json.rb:14:in `encode'
	from /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/core_ext.rb:21:in `to_json'
	from /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/rest/client.rb:457:in `new_request'
	from /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/rest/client.rb:272:in `request'
	from /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/rest/client.rb:264:in `attempt'
	from /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/rest/client.rb:263:in `each'
	from /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/rest/client.rb:263:in `attempt'
	from /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/rest/client.rb:270:in `request'
	from /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/rest/base.rb:28:in `rest_method'
	from /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/rest/user.rb:10:in `add_key'
	from /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/rest/client.rb:144:in `add_key'
	from /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/commands/sshkey.rb:79:in `add'
	from /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/commands.rb:285:in `send'
	from /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/commands.rb:285:in `execute'
	from /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/commands.rb:276:in `to_commander'
	from /usr/lib/ruby/gems/1.8/gems/commander-4.0.3/lib/commander/command.rb:180:in `call'
	from /usr/lib/ruby/gems/1.8/gems/commander-4.0.3/lib/commander/command.rb:180:in `call'
	from /usr/lib/ruby/gems/1.8/gems/commander-4.0.3/lib/commander/command.rb:155:in `run'
	from /usr/lib/ruby/gems/1.8/gems/commander-4.0.3/lib/commander/runner.rb:383:in `run_active_command'
	from /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/command_runner.rb:102:in `run!'
	from /usr/lib/ruby/gems/1.8/gems/commander-4.0.3/lib/commander/delegates.rb:7:in `run!'
	from /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/cli.rb:37:in `start'
	from /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/bin/rhc:20
	from /usr/bin/rhc:19:in `load'
	from /usr/bin/rhc:19


Expected results:
It should add successfully

Additional info:
Comment 1 Jordan Liggitt 2013-10-16 11:39:30 EDT
What version of ruby are you using?
Comment 2 Wei Sun 2013-10-17 00:55:08 EDT
Check this bug on fork_ami_origin_ui_112_907,rhc build from fork_ami_origin_ui_112_907.

Could reproduce this bug when ruby version is 1.8
rhc sshkey  add krb5t --type krb5-principal --content krb5testtest
/var/lib/gems/1.8/gems/rhc-1.16.0/lib/rhc/commands/sshkey.rb:54: warning: Object#type is deprecated; use Object#class
/var/lib/gems/1.8/gems/rhc-1.16.0/lib/rhc/commands/sshkey.rb:55: warning: Object#type is deprecated; use Object#class
The provided type and content does not appear to be a recognizable key
(unsupported key type `�-��-'). You may specify the '--confirm' flag to add the
key anyway.

But could not reproduce this bug when ruby version is 1.9/2.0

[wsun@dhcp-8-229 ~]$ rhc sshkey  add krb5t --type krb5-principal --content krb5testtest
RESULT:
SSH key 'krb5t' has been added
Comment 3 Jordan Liggitt 2013-10-17 14:43:47 EDT
Fixed in fork_ami_origin_ui_112_915
Comment 4 Wei Sun 2013-10-17 23:06:30 EDT
Verify this bug on fork_ami_origin_ui_112_915 in ruby-1.8 env,rhc build from fork_ami_origin_ui_112_915.

Result:
openshift@openshift-ubuntu:~$ rhc sshkey add krb5y --type krb5-principal --content krb5test
Please sign in to start a new session to
ec2-107-22-103-112.compute-1.amazonaws.com.
Password: *
 
RESULT:
SSH key 'krb5y' has been added

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