Description of problem: The virt-who json file is not being posted to satellite for creating virt-who hosts. The satellite returns '{"displayMessage":"undefined method `[]' for nil:NilClass","errors":["undefined method `[]' for nil:NilClass"]}'. Version-Release number of selected component (if applicable): satellite-6.4.0-9.beta.el7sat.noarch How reproducible: Always Steps to Reproduce: 1. Create a json file containing host details to upload to satellite as virt-who hosts. (I attached my json file) 2. Send API call to satellite to upload the data in this json file. # curl -k -X POST --cert /etc/pki/consumer/cert.pem --key /etc/pki/consumer/key.pem https://$SATHOST/rhsm/hypervisors -H "Content-Type: application/json" -d @"/tmp/temp.json" Actual results: The satelite is returning '{"displayMessage":"undefined method `[]' for nil:NilClass","errors":["undefined method `[]' for nil:NilClass"]}'. Expected results: Successfully created virt-who hosts as per json data. Additional info:
Created attachment 1452586 [details] Virt-who Json file mentioned in Description of bug
Yes, A regression.
*** Bug 1598488 has been marked as a duplicate of this bug. ***
2018-07-05T15:28:06 [E|bac|4cd3d] undefined method `[]' for nil:NilClass (NoMethodError) | /home/vagrant/git/katello/app/lib/actions/katello/host/hypervisors.rb:29:in `block (2 levels) in parse_hypervisors' | /home/vagrant/git/katello/app/lib/actions/katello/host/hypervisors.rb:25:in `map' | /home/vagrant/git/katello/app/lib/actions/katello/host/hypervisors.rb:25:in `block in parse_hypervisors' | /home/vagrant/git/katello/app/lib/actions/katello/host/hypervisors.rb:23:in `each' | /home/vagrant/git/katello/app/lib/actions/katello/host/hypervisors.rb:23:in `parse_hypervisors' candlepin changed the results from the hypervisor checkin to only include uuids for the 'unchanged' set of hypervisors results. This results in katello not being able to properly process the results and create the hypervisors in our db. Candlepin will need to either revert some or all of that change, or katello will need to fetch all hypervisors from candlepin after each checkin, potentially increasing the checkin time.
Would it be possible to revert part of this change? Katello needs the following pieces from a hypervisor: 'name' 'uuid' 'owner' -> 'key'
Not clean to revert... Changing component to candlepin. Dev, we need to address both sync and async responses in this. Given that we already have the name, uuid, and key while building the response, we'll make a DTO for this.
We will need to test both async and sync checkins. Newest virt-who should do async by default, to test sync, run with: VIRTWHO_DISABLE_ASYNC=true
*** Bug 1608317 has been marked as a duplicate of this bug. ***
Verified! @ Satellite 6.4 snap 14 Steps: Ditto as per description. Observations: 1. The virt-who hosts are being created on satellite as per json data. 2. Description like error is not observed.
Verified on: # rpm -qa | grep candlepin candlepin-2.4.4-1.el7.noarch candlepin-selinux-2.4.4-1.el7.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. https://access.redhat.com/errata/RHSA-2018:2927
Hello, I am re-opening this bug because I have a customer who is facing this issue after upgrading to 6.4 logs: ==> /var/log/foreman/production.log <== 2019-01-09T11:28:39 [I|app|] Started POST "/rhsm/hypervisors/ACME?reporter_id=[FILTERED]&cloaked=False&env=Library" for 1.2.3.4 at XXXX-01-09 XX:XX:XX +0000 2019-01-09T11:28:39 [I|app|d2d11] Processing by Katello::Api::Rhsm::CandlepinProxiesController#async_hypervisors_update as JSON 2019-01-09T11:28:39 [I|app|d2d11] Parameters: {"reporter_id"=>"[FILTERED]", "cloaked"=>"False", "env"=>"Library", "owner"=>"ADMIN"} 2019-01-09T11:28:39 [I|app|d2d11] Current user: foreman_admin (administrator) 2019-01-09T11:28:39 [I|kat|d2d11] Authorized user admin(Admin User) 2019-01-09T11:28:39 [I|app|d2d11] Current user: admin (administrator) 2019-01-09T11:28:39 [I|app|d2d11] Current user: foreman_admin (administrator) 2019-01-09T11:28:39 [I|app|d2d11] Current user: admin (administrator) 2019-01-09T11:28:39 [I|app|d2d11] Completed 200 OK in 216ms (Views: 0.6ms | ActiveRecord: 23.8ms) 2019-01-09T11:28:40 [W|bac|d2d11] Polling failed, attempt no. 1, retrying in 0.5 2019-01-09T11:28:40 [W|bac|d2d11] undefined method `[]' for nil:NilClass (NoMethodError)
Mihir, we're going to need more details around this. Can you find a traceback under monitor > Tasks > hypervisor update? Any traceback in production.log when the error occurs? A foreman-debug might help