+++ This bug was initially created as a clone of Bug #870456 +++ NoMethodError: You have a nil object when you didn't expect it! You might have expected an instance of Array. The error occurred while evaluating nil.each /home/tomckay/code/katello/src/app/models/system.rb:230:in `init_default_custom_info_keys' When registering a system against an org created prior to custom_info_keys --- Additional comment from adprice on 2012-10-29 13:49:21 EDT --- https://github.com/Katello/katello/commit/2617576d9d230f282bdbcb01afd932547410ab82 --- Additional comment from adprice on 2012-10-29 13:50:55 EDT --- if you hit an error similar to this: NoMethodError: You have a nil object when you didn't expect it! You might have expected an instance of Array. The error occurred while evaluating nil.each /home/tomckay/code/katello/src/app/models/system.rb:230:in `init_default_custom_info_keys' it means you had at least one org that existed prior to default system info keys. run 'rake db:migrate:redo VERSION=20120924211134' on current-master to undo the system_info_keys migration and correctly apply the new column to all pre-existing organizations. If any of your organizations had any data in the system_info_keys column, unfortunately it will be removed.
this was caused by having an organization that existed prior to the migration that added Organization's system_info_keys. to verify: 1. Create an organization prior to the existence of system_info_keys. 2. migrate the db to add org system_info_keys 3. check to see if pre-existing org has system_info_keys = [] (should not be nil)
To verify this, first install 1.0 or 1.1 and create an org. Then upgrade to 1.2. The verification itself is via cli.
Before the update: ------------------ # headpin -u admin -p admin org info --name SAMQE ----------------------------------------------------------------------------------------------------- Organization Information ----------------------------------------------------------------------------------------------------- Id: 2 Name: SAMQE Description: After the update: ----------------- # headpin -u admin -p admin org info --name SAMQE----------------------------------------------------------------------------------------------------- Organization Information ----------------------------------------------------------------------------------------------------- Id : 2 Name : SAMQE Description: Available Service Levels: Premium Default System Info Keys: [ ]
Verified: * candlepin-0.7.19-1.el6_3.noarch * candlepin-tomcat6-0.7.19-1.el6_3.noarch * katello-candlepin-cert-key-pair-1.0-1.noarch * katello-certs-tools-1.2.1-1h.el6_3.noarch * katello-cli-1.2.4-2h.el6_3.noarch * katello-cli-common-1.2.4-2h.el6_3.noarch * katello-common-1.2.6-2h.el6_3.noarch * katello-configure-1.2.3-1h.el6_3.noarch * katello-glue-candlepin-1.2.6-2h.el6_3.noarch * katello-headpin-1.2.6-2h.el6_3.noarch * katello-headpin-all-1.2.6-2h.el6_3.noarch * katello-selinux-1.2.1-1h.el6_3.noarch * thumbslug-0.0.27-1.el6_3.noarch * thumbslug-selinux-0.0.27-1.el6_3.noarch
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. http://rhn.redhat.com/errata/RHSA-2013-0544.html