Description of problem: rhc setup failed during upload sshkey. the following message are reported " Unable to complete the requested operation due to: undefined method `[]' for nil:NilClass Reference ID: a3e0683fa1c98799089d55c3ad24193d" Version-Release number of selected component (if applicable): OSE 2.2-2015-05-05.1 How reproducible: Always Steps to Reproduce: 1. install a fresh openshift with latest puddle 2. install the miss rpm "ruby193-rubygem-net-ssh" on broker ( Bug 1218841 had been filed for the missing package) 3. rhc setup Actual results: Step 3 failed with following error, the error log are attached. Your public SSH key must be uploaded to the OpenShift server to access code. Upload now? (yes|no) yes Since you do not have any keys associated with your OpenShift account, your new key will be uploaded as the 'default' key. Unable to complete the requested operation due to: undefined method `[]' for nil:NilClass Reference ID: a3e0683fa1c98799089d55c3ad24193d Expected results: rhc setup succeed. Additional info:
Created attachment 1022483 [details] Production log for this issue
rhc setup works, user domain can be created.Verified and pass in puddle-2-2-2015-05-06
If I understand comment 4 correctly, the problem appears if Rails.application.config.openshift[:minimum_ssh_key_size] is nil, which was happening because production.rb was not initialising it with the value from the MINIMUM_SSH_KEY_SIZE setting in broker.conf. The defect is fixed, and never shipped, in the sense that production.rb correctly initialises Rails.application.config.openshift[:minimum_ssh_key_size] with the value of MINIMUM_SSH_KEY_SIZE. For this reason, I am inclined to mark this Bugzilla report CLOSED CURRENTRELEASE. However, I believe we will see the same error if MINIMUM_SSH_KEY_SIZE is not set in broker.conf. We should change the || to a rescue, or check that Rails.application.config.openshift[:minimum_ssh_key_size] is not nil before trying to read Rails.application.config.openshift[:minimum_ssh_key_size][ssh_key_type]. I would like to change this code to use rescue so that it will work properly even if MINIMUM_SSH_KEY_SIZE is not set. Tim, does that make sense? If so, I can take this issue and fix it as I described for the next release.
Miciah, That absolutely makes sense. We should have a rescue there instead so we don't treat nil like an array. Feel free to take this issue, and thanks!
PR <https://github.com/openshift/origin-server/pull/6299> is submitted to fix this bug.
Commit pushed to master at https://github.com/openshift/origin-server https://github.com/openshift/origin-server/commit/facd441df157c78baf89cfbb646378043599c914 Bug 1218872: Fix rhc setup fail during upload sshkey Uploading ssh key during 'rhc setup' command may fail due to the method 'get_minimum_ssh_key_size' returns nil if MINIMUM_SSH_KEY_SIZE variable is not set in broker.conf file. This commit change the '||' operation to use rescue instead in order to handle the nil case from the first condition and return the default value 'DEFAULT_MINIMUM_SSH_KEY_SIZE' which is zero by default in case nil value detected. Bug 1218872 Link <https://bugzilla.redhat.com/show_bug.cgi?id=1218872> Signed-off-by: Vu Dinh <vdinh>
Verified this bug with OpenShiftEnterpriseErrata/2.2/2015-11-11.1, and PASS. # grep MIN /etc/openshift/broker.conf # e.g.: MINIMUM_SSH_KEY_SIZE="ssh-rsa|2048 ssh-dss|1024" #MINIMUM_SSH_KEY_SIZE= Run "rhc setup" successfully, ssh-key is uploaded successfully.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHSA-2015-2666.html