Bug 861301

Summary: PSQLException: The column name disk_storage_type was not found in this ResultSet
Product: Red Hat Enterprise Virtualization Manager Reporter: shylesh <shmohan>
Component: ovirt-engineAssignee: Greg Padgett <gpadgett>
Status: CLOSED CURRENTRELEASE QA Contact: Haim <hateya>
Severity: high Docs Contact:
Priority: high    
Version: 3.1.0CC: abaron, amureini, dyasny, ecohen, grajaiya, hateya, iheim, lpeer, Rhev-m-bugs, sgrinber, yeylon, ykaul
Target Milestone: ---   
Target Release: 3.1.0   
Hardware: x86_64   
OS: Linux   
Whiteboard: storage
Fixed In Version: SI22 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Storage RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description shylesh 2012-09-28 05:34:35 UTC
Description of problem:
rhevm engine logs says failures where as webadmin console shows all VMs as healthy

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

How reproducible:


Steps to Reproduce:

  I could see following error messages from rhevm engine logs but on the webadmin console
all the VMs looks healthy, any idea what's happening here.

2012-09-27 08:34:10,679 ERROR [org.ovirt.engine.core.bll.SearchQuery] (ajp-/127.0.0.1:8009-5) Query SearchQuery failed. Exception message is StatementCallback; bad SQL grammar [SELECT * FROM (SELECT * FROM storage_pool WHERE ( id IN (SELECT storage_pool_with_storage_domain.id FROM  storage_pool_with_storage_domain   WHERE  storage_pool_with_storage_domain.name LIKE 'RHS-RHEV-SHYLESH' ))  ORDER BY name ASC ) as T1 OFFSET (1 -1) LIMIT 100]; nested exception is org.postgresql.util.PSQLException: The column name disk_storage_type was not found in this ResultSet.
2012-09-27 08:34:11,421 ERROR [org.ovirt.engine.core.bll.SearchQuery] (ajp-/127.0.0.1:8009-23) Query SearchQuery failed. Exception message is StatementCallback; bad SQL grammar [SELECT * FROM (SELECT * FROM all_disks WHERE ( disk_id IN (SELECT all_disks.disk_id FROM  all_disks   LEFT OUTER JOIN storage_domains_with_hosts_view ON all_disks.image_guid=storage_domains_with_hosts_view.image_guid    WHERE  storage_domains_with_hosts_view.storage_name LIKE 'replicate-new' ))  ORDER BY disk_alias ASC ) as T1 OFFSET (1 -1) LIMIT 100]; nested exception is org.postgresql.util.PSQLException: ERROR: column storage_domains_with_hosts_view.image_guid does not exist
  Position: 175
2012-09-27 08:34:15,669 ERROR [org.ovirt.engine.core.bll.SearchQuery] (ajp-/127.0.0.1:8009-1) Query SearchQuery failed. Exception message is StatementCallback; bad SQL grammar [SELECT * FROM (SELECT * FROM storage_pool WHERE ( id IN (SELECT storage_pool_with_storage_domain.id FROM  storage_pool_with_storage_domain   WHERE  storage_pool_with_storage_domain.name LIKE 'RHS-RHEV-SHYLESH' ))  ORDER BY name ASC ) as T1 OFFSET (1 -1) LIMIT 100]; nested exception is org.postgresql.util.PSQLException: The column name disk_storage_type was not found in this ResultSet.


Additional info:
================

Thanking Shireesh for providing analysis of the bug

Here is the analysis provided by shireesh
==========================================
Looks like a bug to me. Guess you (or someone using the same setup)
tried to search for disks from a storage domain named 'RHS-RHEV-SHYLESH'
using the search bar at the top. That search must surely have failed
because of above sql errors. It seems that linking between disks and
storage domains is being done by joining the views all_disks and
storage_domains_with_hosts_view, with the join key being image_guid on
both sides (source: SearchObjectAutoCompleter.java). However this column
(image_guid) exists only in all_disks and *not* in
storage_domains_with_hosts_view (source: create_views.sql).

I think you can raise a bug provide the logs, unless someone responds
saying that above understanding is totally wrong :)

Regards,
Shireesh

Comment 1 Itamar Heim 2012-10-02 17:39:21 UTC
shylesh - please attach engine log for completeness

Comment 2 Itamar Heim 2012-10-02 17:41:54 UTC
shylesh - just browsing the disks tab doesn't seem to reproduce this - please provide reproduce steps as well.

Comment 3 Greg Padgett 2012-10-04 23:38:12 UTC
I can't reproduce the first (and third) failure shown above.  I can run the query by searching for "DataCenter: name = iscsi", but it succeeds.

I /can/ reproduce the second error by searching for "disks: storages = iscsi1".

Comment 4 Greg Padgett 2012-10-05 23:53:51 UTC
This patch fixes the second error in the log above:

http://gerrit.ovirt.org/8385

I can't reproduce the other errors, so I assume they're no longer occurring.  Please let me know if this isn't the case.

Comment 7 Ayal Baron 2012-10-22 19:47:57 UTC
Change-Id: I2a1467a9a5a6ffdcbaf388ce06f43eb6f9f34ab5

Comment 8 Haim 2012-10-24 17:14:31 UTC
fixed on SI22. 
issue no longer reproduces when searching for disks under specific data-center. 

disks: Storage = CHAP