Project

General

Profile

Bug #15749

undefined method [] for nil:NilClass related to activation_key pool association

Added by Justin Sherrill over 2 years ago. Updated 7 months ago.

Status:
Closed
Priority:
Normal
Category:
Candlepin
Target version:
Difficulty:
easy
Triaged:
Yes
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

Various actions that index pools seem to be causing errors at various points such as importing a manifest or removing a consumer. Here is the traceback:


NoMethodError: undefined method `[]' for nil:NilClass
Backtrace:
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.2/app/models/katello/glue/candlepin/pool.rb:127:in `block (2 levels) in create_activation_key_associations'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.2/app/models/katello/glue/candlepin/pool.rb:127:in `any?'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.2/app/models/katello/glue/candlepin/pool.rb:127:in `block in create_activation_key_associations'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.2/app/models/katello/glue/candlepin/pool.rb:126:in `collect'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.2/app/models/katello/glue/candlepin/pool.rb:126:in `create_activation_key_associations'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.2/app/models/katello/glue/candlepin/pool.rb:117:in `import_data'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.2/app/lib/actions/katello/host/destroy.rb:48:in `block in finalize'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.2/app/lib/actions/katello/host/destroy.rb:46:in `each'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.2/app/lib/actions/katello/host/destroy.rb:46:in `finalize'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.11/lib/dynflow/action.rb:528:in `block (2 levels) in execute_finalize'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.11/lib/dynflow/middleware/stack.rb:26:in `call'

It has been reported in the wild, and seems to indicate that Candlepin is returning data that looks like:

{'pools' => [{}]}

when we're expecting either:

{'pools' => []}

or

{'pools' => [{'pool => {'id' => X}}]}

When requesting the data, we've never been able to capture that output

Associated revisions

Revision 946f3c77 (diff)
Added by Justin Sherrill over 2 years ago

Fixes #15749 - handle pool data with missing pool (#6195)

History

#1 Updated by The Foreman Bot over 2 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/Katello/katello/pull/6195 added

#2 Updated by Justin Sherrill over 2 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#3 Updated by Justin Sherrill over 2 years ago

  • Legacy Backlogs Release (now unused) set to 143

#4 Updated by Justin Sherrill over 2 years ago

  • Legacy Backlogs Release (now unused) changed from 143 to 171

#5 Updated by Eric Helms over 2 years ago

  • Legacy Backlogs Release (now unused) changed from 171 to 162

Also available in: Atom PDF