Bug 1024961 - Error loading virtual machine information: Internal Server Error -- When Adding Host in Foreman
Error loading virtual machine information: Internal Server Error -- When Addi...
Product: oVirt
Classification: Community
Component: ovirt-engine-core (Show other bugs)
All Linux
unspecified Severity high
: ---
: 3.4.0
Assigned To: Ori Liel
Depends On:
  Show dependency treegraph
Reported: 2013-10-30 12:28 EDT by Yamakasi
Modified: 2015-07-06 18:38 EDT (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2014-03-03 06:29:36 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Yamakasi 2013-10-30 12:28:35 EDT
Description of problem:

When adding a VM/Host in Foreman and you select the "Deploy On" Ovirt Domain you want to deploy the VM in, the "Virtual Machine" tab appears and gets red colored.

The error in the proxy.log of Foreman and engine.log of Ovirt is like the following:

Read fragment views/tabs_and_title_records-1 (0.4ms)
  Rendered home/_topbar.html.erb (3.7ms)
Completed 200 OK in 1561ms (Views: 1530.6ms | ActiveRecord: 23.6ms)
Started POST "/hosts/compute_resource_selected" for at Tue Oct 29 13:08:41 +0100 2013
Processing by HostsController#compute_resource_selected as */*
  Parameters: {"authenticity_token"=>”XXXXXXXXXXXXXXXXXXXXX=", "host"=>{"hostgroup_id"=>"", "provision_method"=>"build", "comment"=>"", "build"=>"1", "environment_id"=>"", "puppet_proxy_id"=>"", "interfaces_attributes"=>{"new_interfaces"=>{"provider"=>"IPMI", "_destroy"=>"false", "type"=>"Nic::Managed", "domain_id"=>"", "name"=>"", "mac"=>"", "ip"=>""}}, "disk"=>"", "enabled"=>"1", "type"=>"Host::Managed", "managed"=>"true", "domain_id"=>"", "is_owned_by"=>"", "name"=>"", "compute_resource_id"=>"1", "progress_report_id"=>"[FILTERED]", "root_pass"=>"[FILTERED]", "model_id"=>"", "puppet_ca_proxy_id"=>"", "mac"=>"", "ip"=>"", "architecture_id"=>"", "overwrite"=>"false"}, "utf8"=>"✓"}
  Rendered compute_resources_vms/form/_ovirt.html.erb (416.2ms)
  Rendered hosts/_compute.html.erb (520.9ms)
Operation FAILED: statementcallback; bad sql grammar select * from (select * from vds groups view where ( vds group id in (select vds groups storage domain.vds group id from  vds groups storage domain   left outer join storage pool with storage domain on vds groups storage domain.storage pool id=storage pool with storage domain.id    where  (  storage pool with storage domain.name like '%MyDomain%' or  storage pool with storage domain.description like '%MyDomain%' or  storage pool with storage domain.comment like '%MyDomain%' ) ))  order by name asc ) as t1 offset (1 -1) limit 100; nested exception is org.postgresql.util.psqlexception: error: column storage pool with storage domain.comment does not exist
  position: 425
  Rendered common/500.html.erb (5.4ms)

Version-Release number of selected component (if applicable):

Foreman 1.3.0

How reproducible:

Add a VM in Foreman and deploy on a Ovirt Enviroment.

Steps to Reproduce:
1. Login to Foreman
2. Add a hosts
3. Select "Deploy on" OvirtEngineName

Actual results:

On the Virtual Machine tab:

Error loading virtual machine information: Internal Server Error

Expected results:

The Ovirt Engine Environment Variables

Additional info:
Comment 1 Joop van de Wege 2013-11-01 08:01:17 EDT
I have the same problem, same versions of oVirt and Foreman, 3.3.0-4.el6 and 1.3.0

Either Foreman or oVirt are internally generating the wrong query statement. What follows is what I posted to irc

YamakasY: for reference: somewhere either Foreman or oVirt-engine is generating a wrong query. The view storage_pool_with_storage_domain is having a free_text_commnent column but either FM or oVirt is looking for a comment column.
[12:46]	YamakasY: my understanding of the ovirt code (30min looking around) is that there are calls which query the database for the layout of the table/view and then use that to construct the query or use the view and add columns to it using code. In the latter there is probably somewhere a line of code that adds the 'comment' column and then the query for storage_domains blows up.
[12:47]	YamakasY: my quick hack is regenerating the view with an extra column, comment, and then FM works again.

YamakasY: ALTER TABLE storage_pool ADD COLUMN comment text;
	DROP VIEW storage_pool_with_storage_domain;
	CREATE OR REPLACE VIEW storage_pool_with_storage_domain AS
	SELECT storage_pool.id, storage_pool.name, storage_pool.description, storage_pool.free_text_comment, storage_pool.comment, storage_pool.storage_pool_type, storage_pool.status, storage_pool.master_domain_version, storage_pool.spm_vds_id, storage_pool.compatibility_version, storage_pool._create_date, storage_pool._update_date, storage_pool_iso_map.storage_id, storage_pool_iso_map.storage_pool_id, s
	torage_domain_static.storage_type, storage_domain_static.storage_domain_type, storage_domain_static.storage_domain_format_type, storage_domain_static.storage_name, storage_domain_static.storage, storage_domain_static.last_time_used_as_master
	FROM storage_pool
	LEFT JOIN storage_pool_iso_map ON storage_pool.id = storage_pool_iso_map.storage_pool_id
	LEFT JOIN storage_domain_static ON storage_pool_iso_map.storage_id = storage_domain_static.id;
	ALTER TABLE storage_pool_with_storage_domain OWNER TO engine;
[12:55]	YamakasY: Don't forget to backup your DATABASE!!!!
Comment 2 Itamar Heim 2014-01-12 03:42:21 EST
setting target release to current version for consideration and review. please do not push non-RFE bugs to an undefined target release to make sure bugs are reviewed for relevancy, fix, closure, etc.
Comment 3 Joop van de Wege 2014-01-17 03:22:34 EST
I don't have this problem anymore since I upgraded to either 3.3.1 or 3.3.2 that I'm now using.
oVirt-3.3.2el6 + Foreman-1.3.2 and oVirt-3.3.2-fc19 + Foreman-1.3.2

Comment 4 Itamar Heim 2014-01-17 18:39:24 EST
Yamakasi - can you please check as well per comment 3?
Comment 5 Juan Hernández 2014-03-03 06:29:36 EST
This was an error in the storage pool field autocompleter, and was fixed by the following change, included in 3.3.1:


Note You need to log in before you can comment on or make changes to this bug.