-
Sub-task
-
Resolution: Done
-
Undefined
-
None
-
None
-
False
-
-
False
-
0
-
-
-
Sprint 142, Sprint 143, Sprint 144, Sprint 145
Description of problem:
Refresh content counts action on Smart proxy fails when content_counts is set to {}
How reproducible:
Always
Is this issue a regression from an earlier version:
No
Steps to Reproduce:
1. For a smart proxy, set the content counts to {}
2. Try to refresh content counts on the proxy.
3. The task fails with the below trace:
Error:
NoMethodError
undefined method `[]' for nil:NilClass
—
- "/home/vagrant/katello/app/models/katello/concerns/smart_proxy_extensions.rb:185:in
`process_repository'" - "/home/vagrant/katello/app/models/katello/concerns/smart_proxy_extensions.rb:167:in
`block in repos_content_count'" - "/home/vagrant/foreman/.vendor/ruby/3.0.0/gems/activerecord-6.1.7.10/lib/active_record/relation/delegation.rb:88:in
`each'" - "/home/vagrant/foreman/.vendor/ruby/3.0.0/gems/activerecord-6.1.7.10/lib/active_record/relation/delegation.rb:88:in
`each'" - "/home/vagrant/katello/app/models/katello/concerns/smart_proxy_extensions.rb:166:in
`repos_content_count'" - "/home/vagrant/katello/app/models/katello/concerns/smart_proxy_extensions.rb:150:in
`block in update_content_counts!'"
Expected behavior:
Counts should get calculated correctly.
Business Impact / Additional info:
DEV Tracker for https://issues.redhat.com/browse/SAT-29567