Hide Forgot
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:
What version of ruby are you using?
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
Fixed in fork_ami_origin_ui_112_915
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