theforeman / foreman_rh_cloud

a plugin to Foreman that generates and uploads reports to the Red Hat cloud
GNU General Public License v3.0
6 stars 32 forks source link

Stop settings DB queries #733

Closed ShimShtein closed 2 years ago

jeremylenz commented 2 years ago

Not having this one in breaks Foreman too..

14:15:59 rails.1   | /home/vagrant/foreman/.vendor/ruby/2.7.0/gems/activerecord-6.1.6/lib/active_record/connection_adapters/postgresql_adapter.rb:672:in `exec_params': ERROR:  column settings.default does not exist (PG::UndefinedColumn)
14:15:59 rails.1   | LINE 1: ..."."name" = $2 AND "settings"."value" IS NULL AND (settings.d...
14:15:59 rails.1   |                                                              ^
14:15:59 rails.1   |    from /home/vagrant/foreman/.vendor/ruby/2.7.0/gems/activerecord-6.1.6/lib/active_record/connection_adapters/postgresql_adapter.rb:672:in `block (2 levels) in exec_no_cache'
14:15:59 rails.1   |    from /home/vagrant/foreman/.vendor/ruby/2.7.0/gems/activesupport-6.1.6/lib/active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads'
14:15:59 rails.1   |    from /home/vagrant/foreman/.vendor/ruby/2.7.0/gems/activesupport-6.1.6/lib/active_support/concurrency/share_lock.rb:187:in `yield_shares'
14:15:59 rails.1   |    from /home/vagrant/foreman/.vendor/ruby/2.7.0/gems/activesupport-6.1.6/lib/active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads'
14:15:59 rails.1   |    from /home/vagrant/foreman/.vendor/ruby/2.7.0/gems/activerecord-6.1.6/lib/active_record/connection_adapters/postgresql_adapter.rb:671:in `block in exec_no_cache'
14:15:59 rails.1   |    from /home/vagrant/foreman/.vendor/ruby/2.7.0/gems/activerecord-6.1.6/lib/active_record/connection_adapters/abstract_adapter.rb:696:in `block (2 levels) in log'
14:15:59 rails.1   |    from /home/vagrant/foreman/.vendor/ruby/2.7.0/gems/activesupport-6.1.6/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
14:15:59 rails.1   |    from /home/vagrant/foreman/.vendor/ruby/2.7.0/gems/activesupport-6.1.6/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
14:15:59 rails.1   |    from /home/vagrant/foreman/.vendor/ruby/2.7.0/gems/activesupport-6.1.6/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
14:15:59 rails.1   |    from /home/vagrant/foreman/.vendor/ruby/2.7.0/gems/activesupport-6.1.6/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
14:15:59 rails.1   |    from /home/vagrant/foreman/.vendor/ruby/2.7.0/gems/activesupport-6.1.6/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
14:15:59 rails.1   |    from /home/vagrant/foreman/.vendor/ruby/2.7.0/gems/activerecord-6.1.6/lib/active_record/connection_adapters/abstract_adapter.rb:695:in `block in log'
14:15:59 rails.1   |    from /home/vagrant/foreman/.vendor/ruby/2.7.0/gems/activesupport-6.1.6/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
14:15:59 rails.1   |    from /home/vagrant/foreman/.vendor/ruby/2.7.0/gems/activerecord-6.1.6/lib/active_record/connection_adapters/abstract_adapter.rb:687:in `log'
14:15:59 rails.1   |    from /home/vagrant/foreman/.vendor/ruby/2.7.0/gems/activerecord-6.1.6/lib/active_record/connection_adapters/postgresql_adapter.rb:670:in `exec_no_cache'
14:15:59 rails.1   |    from /home/vagrant/foreman/.vendor/ruby/2.7.0/gems/activerecord-6.1.6/lib/active_record/connection_adapters/postgresql_adapter.rb:649:in `execute_and_clear'
14:15:59 rails.1   |    from /home/vagrant/foreman/.vendor/ruby/2.7.0/gems/activerecord-6.1.6/lib/active_record/connection_adapters/postgresql/database_statements.rb:72:in `exec_delete'
14:15:59 rails.1   |    from /home/vagrant/foreman/.vendor/ruby/2.7.0/gems/activerecord-6.1.6/lib/active_record/connection_adapters/abstract/database_statements.rb:179:in `update'
14:15:59 rails.1   |    from /home/vagrant/foreman/.vendor/ruby/2.7.0/gems/activerecord-6.1.6/lib/active_record/connection_adapters/abstract/query_cache.rb:22:in `update'
14:15:59 rails.1   |    from /home/vagrant/foreman/.vendor/ruby/2.7.0/gems/activerecord-6.1.6/lib/active_record/relation.rb:466:in `update_all'
14:15:59 rails.1   |    from /home/vagrant/foreman_rh_cloud/app/models/setting/rh_cloud.rb:9:in `block in load_defaults'
14:15:59 rails.1   |    from /home/vagrant/foreman/.vendor/ruby/2.7.0/gems/activerecord-6.1.6/lib/active_record/connection_adapters/abstract/database_statements.rb:320:in `block in transaction'
14:15:59 rails.1   |    from /home/vagrant/foreman/.vendor/ruby/2.7.0/gems/activerecord-6.1.6/lib/active_record/connection_adapters/abstract/transaction.rb:319:in `block in within_new_transaction'
14:15:59 rails.1   |    from /home/vagrant/foreman/.vendor/ruby/2.7.0/gems/activesupport-6.1.6/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
14:15:59 rails.1   |    from /home/vagrant/foreman/.vendor/ruby/2.7.0/gems/activesupport-6.1.6/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
14:15:59 rails.1   |    from /home/vagrant/foreman/.vendor/ruby/2.7.0/gems/activesupport-6.1.6/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
14:15:59 rails.1   |    from /home/vagrant/foreman/.vendor/ruby/2.7.0/gems/activesupport-6.1.6/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
14:15:59 rails.1   |    from /home/vagrant/foreman/.vendor/ruby/2.7.0/gems/activesupport-6.1.6/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
14:15:59 rails.1   |    from /home/vagrant/foreman/.vendor/ruby/2.7.0/gems/activerecord-6.1.6/lib/active_record/connection_adapters/abstract/transaction.rb:317:in `within_new_transaction'
14:15:59 rails.1   |    from /home/vagrant/foreman/.vendor/ruby/2.7.0/gems/activerecord-6.1.6/lib/active_record/connection_adapters/abstract/database_statements.rb:320:in `transaction'
14:15:59 rails.1   |    from /home/vagrant/foreman/.vendor/ruby/2.7.0/gems/activerecord-6.1.6/lib/active_record/transactions.rb:209:in `transaction'
14:15:59 rails.1   |    from /home/vagrant/foreman_rh_cloud/app/models/setting/rh_cloud.rb:6:in `load_defaults'
14:15:59 rails.1   |    from /home/vagrant/foreman/app/services/setting_registry.rb:114:in `each'
ShimShtein commented 2 years ago

@Ron-Lavi care to take a final look?

Ron-Lavi commented 2 years ago

@ShimShtein time to move to a newer branch? :D it fixed the issue with foreman develop

ShimShtein commented 2 years ago

@adamruzicka would you mind to review this one?

adamruzicka commented 2 years ago

Thank you @ShimShtein !