Description of problem: When trying to follow the VM to CloudTenant relationship, CloudForms throws a PostgreSQL exception. irb> my_tenant = CloudTenant.find_by(name: 'my_tenant') irb> my_vms = Vm.where(:name => 'my_vm', :cloud_tenant => my_tenant) Traceback (most recent call last): 16: from activerecord (5.1.7) lib/active_record/connection_adapters/abstract/database_statements.rb:42:in `select_all' 15: from activerecord (5.1.7) lib/active_record/connection_adapters/abstract/database_statements.rb:371:in `select' 14: from activerecord (5.1.7) lib/active_record/connection_adapters/postgresql/database_statements.rb:79:in `exec_query' 13: from activerecord (5.1.7) lib/active_record/connection_adapters/postgresql_adapter.rb:611:in `execute_and_clear' 12: from activerecord (5.1.7) lib/active_record/connection_adapters/postgresql_adapter.rb:622:in `exec_no_cache' 11: from activerecord (5.1.7) lib/active_record/connection_adapters/abstract_adapter.rb:604:in `log' 10: from activesupport (5.1.7) lib/active_support/notifications/instrumenter.rb:21:in `instrument' 9: from activerecord (5.1.7) lib/active_record/connection_adapters/abstract_adapter.rb:612:in `block in log' 8: from /usr/share/ruby/monitor.rb:226:in `mon_synchronize' 7: from activerecord (5.1.7) lib/active_record/connection_adapters/abstract_adapter.rb:613:in `block (2 levels) in log' 6: from activerecord (5.1.7) lib/active_record/connection_adapters/postgresql_adapter.rb:623:in `block in exec_no_cache' 5: from activesupport (5.1.7) lib/active_support/dependencies/interlock.rb:45:in `permit_concurrent_loads' 4: from activesupport (5.1.7) lib/active_support/concurrency/share_lock.rb:185:in `yield_shares' 3: from activesupport (5.1.7) lib/active_support/dependencies/interlock.rb:46:in `block in permit_concurrent_loads' 2: from activerecord (5.1.7) lib/active_record/connection_adapters/postgresql_adapter.rb:624:in `block (2 levels) in exec_no_cache' 1: from activerecord (5.1.7) lib/active_record/connection_adapters/postgresql_adapter.rb:624:in `exec_params' ActiveRecord::StatementInvalid (PG::UndefinedColumn: ERROR: column vms.cloud_tenant does not exist) LINE 1: ...D "vms"."template" = $1 AND "vms"."name" = $2 AND "vms"."clo... ^ HINT: Perhaps you meant to reference the column "vms.cloud_tenant_id". : SELECT "vms".* FROM "vms" WHERE "vms"."type" IN ('Vm', 'ManageIQ::Providers::InfraManager::Vm', 'ManageIQ::Providers::CloudManager::Vm', 'VmServer', 'ManageIQ::Providers::Vmware::InfraManager::Vm', 'ManageIQ::Providers::Kubevirt::InfraManager::Vm', 'ManageIQ::Providers::Redhat::InfraManager::Vm', 'ManageIQ::Providers::Microsoft::InfraManager::Vm', 'VmXen', 'ManageIQ::Providers::Amazon::CloudManager::Vm', 'ManageIQ::Providers::Azure::CloudManager::Vm', 'ManageIQ::Providers::AzureStack::CloudManager::Vm', 'ManageIQ::Providers::Google::CloudManager::Vm', 'ManageIQ::Providers::Openstack::CloudManager::Vm', 'ManageIQ::Providers::Vmware::CloudManager::Vm') AND "vms"."template" = $1 AND "vms"."name" = $2 AND "vms"."cloud_tenant" = 9 LIMIT $3
https://github.com/ManageIQ/manageiq/pull/19914
New commit detected on ManageIQ/manageiq/ivanchuk: https://github.com/ManageIQ/manageiq/commit/3a643ea218fa7c80ae8037b046f2eccb1a30a0a0 commit 3a643ea218fa7c80ae8037b046f2eccb1a30a0a0 Author: Adam Grare <agrare> AuthorDate: Tue Mar 3 14:20:51 2020 +0000 Commit: Adam Grare <agrare> CommitDate: Tue Mar 3 14:20:51 2020 +0000 Merge pull request #19914 from fdupont-redhat/v2v_bz_1809580 Add CloudTenant relationship in VM class (cherry picked from commit dc8d26883fa1f61130ed583c4bc51fccd4c0c47b) https://bugzilla.redhat.com/show_bug.cgi?id=1809580 app/models/manageiq/providers/cloud_manager/vm.rb | 1 - app/models/vm_or_template.rb | 1 + 2 files changed, 1 insertion(+), 1 deletion(-)
New commit detected on ManageIQ/manageiq/jansa: https://github.com/ManageIQ/manageiq/commit/4cf5ecd0f013b303a1f41ef4dc92db7a2736dd07 commit 4cf5ecd0f013b303a1f41ef4dc92db7a2736dd07 Author: Adam Grare <agrare> AuthorDate: Tue Mar 3 14:20:51 2020 +0000 Commit: Adam Grare <agrare> CommitDate: Tue Mar 3 14:20:51 2020 +0000 Merge pull request #19914 from fdupont-redhat/v2v_bz_1809580 Add CloudTenant relationship in VM class (cherry picked from commit dc8d26883fa1f61130ed583c4bc51fccd4c0c47b) https://bugzilla.redhat.com/show_bug.cgi?id=1809580 app/models/manageiq/providers/cloud_manager/vm.rb | 1 - app/models/vm_or_template.rb | 1 + 2 files changed, 1 insertion(+), 1 deletion(-)
Verified in master.20200403002716_63b3608c8d
Verified in 5.11.5
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, 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/RHBA-2020:2020