Bug #32116
closedRemove Trends and Statistics data from all instances
Description
We still have Trends and Statistics permissions and tables around in all instances.
We should run the cleanup for all instances that didn't install the plugin.
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1920810
Description of problem: After upgrade to Foreman 2.3, I can see an error message in the production logs
2021-01-26T23:37:13 [I|app|22106c00] Backtrace for 'unknown class Trend, ignoring' error (NameError): uninitialized constant Trend
22106c00 | Did you mean? Thread
22106c00 | /usr/share/foreman/app/models/filter.rb:81:in `get_resource_class'
22106c00 | /usr/share/foreman/app/models/permission.rb:22:in `block in with_translations'
22106c00 | /usr/share/foreman/app/models/permission.rb:22:in `map'
22106c00 | /usr/share/foreman/app/models/permission.rb:22:in `with_translations'
22106c00 | /usr/share/foreman/app/models/permission.rb:18:in `resources_with_translations'
Version-Release number of selected component (if applicable): Foreman 2.3
How reproducible: Always
Steps to Reproduce:
1. After upgrade, Try to edit any report template and check logs
Additional info:
I can see permission related to trends is present in the DB. It should be deleted in the upgrade
irb(main):010:0> Permission.where('name LIKE ?', "%_trends")
=> #<ActiveRecord::Relation [#<Permission id: 171, name: "view_trends", resource_type: "Trend", created_at: "2019-08-05 21:14:09", updated_at: "2019-08-05 21:14:09">, #<Permission id: 172, name: "create_trends", resource_type: "Trend", created_at: "2019-08-05 21:14:09", updated_at: "2019-08-05 21:14:09">, #<Permission id: 173, name: "edit_trends", resource_type: "Trend", created_at: "2019-08-05 21:14:09", updated_at: "2019-08-05 21:14:09">, #<Permission id: 174, name: "destroy_trends", resource_type: "Trend", created_at: "2019-08-05 21:14:09", updated_at: "2019-08-05 21:14:09">, #<Permission id: 175, name: "update_trends", resource_type: "Trend", created_at: "2019-08-05 21:14:09", updated_at: "2019-08-05 21:14:09">]>
Updated by Ondřej Ezr over 2 years ago
- Has duplicate Bug #35186: Clean up all permissions related to Trend model added
Updated by Ondřej Ezr over 2 years ago
- Subject changed from Remove Trends and Statistics data from all instances to Remove Trends and Statistics data from all instances
Running `foreman-rake purge:trends` in a migration should be enough here IMHO.
Updated by Ondřej Ezr about 2 years ago
- Status changed from New to Closed
- Pull request https://github.com/theforeman/foreman/pull/9343 added
- Fixed in Releases 3.5.0 added
Updated by Ondřej Ezr about 2 years ago
- Related to Bug #35347: After removing the foreman_docker plugin, foreman log is flooded with huge tracebacks related to "unknown class DockerRegistry, ignoring" and "unknown class Container, ignoring" added
Updated by Ewoud Kohl van Wijngaarden about 2 years ago
- Category changed from Trends to DB migrations
- Triaged changed from No to Yes