After upgrading to Satellite 6.11 , foreman log is flooded with huge tracebacks related to "unknown class DockerRegistry, ignoring" and "unknown class Container, ignoring"
Description of problem:
Those who have hit the Bugzilla https://bugzilla.redhat.com/show_bug.cgi?id=1920810 after upgrading to Satellite 6.11, are also susceptible to the issue where DockerRegistry and Container resource types are not cleared from DB and that raises huge tracebacks, everytime someone tries to edit report templates.
Version-Release number of selected component (if applicable):
Satellite 6.11 ( RHEL 7 )
How reproducible:
In Customer environment , after upgrading from Satellite 6.10
Steps to Reproduce:
* Upgrade a Satellite 6.9 ( that has DockerRegistry and Container resource types still present ) , to 6.10 and then 6.11
* Go to Monitor --> Report templates and try to edit any report template and the Cancel the same i.e. come back to main page.
Actual results:
2022-07-21T09:30:22 [I|app|e6b226e2] Started GET "/templates/report_templates/468-Ansible%20-%20Ansible%20Inventory/edit" for 10.3.19.126 at 2022-07-21 09:30:22 -0500
2022-07-21T09:30:22 [I|app|e6b226e2] Processing by ReportTemplatesController#edit as HTML
2022-07-21T09:30:22 [I|app|e6b226e2] Parameters: {"id"=>"468-Ansible - Ansible Inventory"}
2022-07-21T09:30:22 [I|app|e6b226e2] Rendering report_templates/edit.html.erb within layouts/application
2022-07-21T09:30:22 [I|app|e6b226e2] Rendered report_templates/_custom_tab_headers.html.erb (Duration: 1.3ms | Allocations: 201)
2022-07-21T09:30:22 [I|app|e6b226e2] Rendered report_templates/_alerts.html.erb (Duration: 3.8ms | Allocations: 1639)
2022-07-21T09:30:22 [W|app|e6b226e2] unknown class Container, ignoring
2022-07-21T09:30:22 [I|app|e6b226e2] Backtrace for 'unknown class Container, ignoring' error (NameError): uninitialized constant Container
e6b226e2 | /opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.4.7/lib/active_support/inflector/methods.rb:282:in `const_get'
e6b226e2 | /opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.4.7/lib/active_support/inflector/methods.rb:282:in `block in constantize'
e6b226e2 | /opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.4.7/lib/active_support/inflector/methods.rb:280:in `each'
e6b226e2 | /opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.4.7/lib/active_support/inflector/methods.rb:280:in `inject'
e6b226e2 | /opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.4.7/lib/active_support/inflector/methods.rb:280:in `constantize'
e6b226e2 | /opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.4.7/lib/active_support/core_ext/string/inflections.rb:68:in `constantize'
e6b226e2 | /usr/share/foreman/app/models/filter.rb:85:in `get_resource_class'
e6b226e2 | /usr/share/foreman/app/models/permission.rb:22:in `block in with_translations'
e6b226e2 | /usr/share/foreman/app/models/permission.rb:22:in `map'
e6b226e2 | /usr/share/foreman/app/models/permission.rb:22:in `with_translations'
e6b226e2 | /usr/share/foreman/app/models/permission.rb:18:in `resources_with_translations'
e6b226e2 | /usr/share/foreman/app/views/template_inputs/_form.html.erb:8:in `block in _5e3e40319560ac86e152e151988ef286'
e6b226e2 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionview-6.0.4.7/lib/action_view/helpers/capture_helper.rb:45:in `block in captu
..
..
2022-07-21T09:30:22 [W|app|e6b226e2] unknown class DockerRegistry, ignoring
2022-07-21T09:30:22 [I|app|e6b226e2] Backtrace for 'unknown class DockerRegistry, ignoring' error (NameError): uninitialized constant DockerRegistry
e6b226e2 | /opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.4.7/lib/active_support/inflector/methods.rb:282:in `const_get'
e6b226e2 | /opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.4.7/lib/active_support/inflector/methods.rb:282:in `block in constantize'
e6b226e2 | /opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.4.7/lib/active_support/inflector/methods.rb:280:in `each'
e6b226e2 | /opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.4.7/lib/active_support/inflector/methods.rb:280:in `inject'
e6b226e2 | /opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.4.7/lib/active_support/inflector/methods.rb:280:in `constantize'
e6b226e2 | /opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.4.7/lib/active_support/core_ext/string/inflections.rb:68:in `constantize'
e6b226e2 | /usr/share/foreman/app/models/filter.rb:85:in `get_resource_class'
e6b226e2 | /usr/share/foreman/app/models/permission.rb:22:in `block in with_translations'
e6b226e2 | /usr/share/foreman/app/models/permission.rb:22:in `map'
e6b226e2 | /usr/share/foreman/app/models/permission.rb:22:in `with_translations'
e6b226e2 | /usr/share/foreman/app/models/permission.rb:18:in `resources_with_translations'
e6b226e2 | /usr/share/foreman/app/views/template_inputs/_form.html.erb:8:in `block in _5e3e40319560ac86e152e151988ef286'
I had to shorten the tracebacks but they are frequent and huge
Expected results:
No such tracebacks
Additional info:
From the customer's satellite:
# echo -e "conf.echo=false \n pp Permission.all" | foreman-rake console
...
#<Permission:0x0000000015fe65b8
id: 214,
name: "view_registries",
resource_type: "DockerRegistry",
created_at: Thu, 01 Oct 2015 21:36:41 UTC +00:00,
updated_at: Thu, 01 Oct 2015 21:36:41 UTC +00:00>,
#<Permission:0x0000000015fe64f0
id: 215,
name: "create_registries",
resource_type: "DockerRegistry",
created_at: Thu, 01 Oct 2015 21:36:41 UTC +00:00,
updated_at: Thu, 01 Oct 2015 21:36:41 UTC +00:00>,
#<Permission:0x0000000015fe6428
id: 216,
name: "destroy_registries",
resource_type: "DockerRegistry",
created_at: Thu, 01 Oct 2015 21:36:41 UTC +00:00,
updated_at: Thu, 01 Oct 2015 21:36:41 UTC +00:00>,
--
#<Permission:0x000000001335cb50
id: 299,
name: "search_repository_image_search",
resource_type: "DockerRegistry",
created_at: Thu, 13 Dec 2018 20:01:59 UTC +00:00,
updated_at: Thu, 13 Dec 2018 20:01:59 UTC +00:00>,
...
#<Permission:0x0000000015fe70a8
id: 210,
name: "view_containers",
resource_type: "Container",
created_at: Thu, 01 Oct 2015 21:36:41 UTC +00:00,
updated_at: Thu, 01 Oct 2015 21:36:41 UTC +00:00>,
#<Permission:0x0000000015fe6fe0
id: 211,
name: "commit_containers",
resource_type: "Container",
created_at: Thu, 01 Oct 2015 21:36:41 UTC +00:00,
updated_at: Thu, 01 Oct 2015 21:36:41 UTC +00:00>,
--
updated_at: Thu, 02 Jul 2015 21:32:28 UTC +00:00>,
#<Permission:0x0000000015fe6748
id: 212,
name: "create_containers",
resource_type: "Container",
created_at: Thu, 01 Oct 2015 21:36:41 UTC +00:00,
updated_at: Thu, 01 Oct 2015 21:36:41 UTC +00:00>,
#<Permission:0x0000000015fe6680
id: 213,
name: "destroy_containers",
resource_type: "Container",
created_at: Thu, 01 Oct 2015 21:36:41 UTC +00:00,
updated_at: Thu, 01 Oct 2015 21:36:41 UTC +00:00>,
--
I don't see them on a working Satellite 6.11
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 (Important: Satellite 6.12 Release), 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-2022:8506