Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1198506

Summary: RHEV-M admin portal pagination issue: disappeared list of VMs after sort it and select next page
Product: Red Hat Enterprise Virtualization Manager Reporter: Yuri Obshansky <yobshans>
Component: ovirt-engineAssignee: Eli Mesika <emesika>
Status: CLOSED CURRENTRELEASE QA Contact: Petr Matyáš <pmatyas>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 3.5.0CC: gklein, lpeer, lsurette, oourfali, pmatyas, pstehlik, rbalakri, Rhev-m-bugs, srevivo, ykaul, ylavi
Target Milestone: ovirt-3.6.0-rcKeywords: ZStream
Target Release: 3.6.0   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1223770 (view as bug list) Environment:
Last Closed: 2016-04-20 01:26:01 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1223770    
Attachments:
Description Flags
engine log file none

Description Yuri Obshansky 2015-03-04 09:55:47 UTC
Description of problem:
I have RHEV-M setup with 200 VMs.
When I sorted VMs by Host (reproduced with other fields as well) click on arrow to go to next page than all VMs disappeared forever till next login to admin portal.
I found the next errors in engine log file:
2015-03-04 11:45:40,843 ERROR [org.ovirt.engine.core.bll.SearchQuery] (ajp-/127.0.0.1:8702-3) Query SearchQuery failed. Exception message is StatementCallback; bad SQL grammar [SELECT * FROM ((SELECT distinct vms.* FROM  vms  )  ORDER BY fn_get_comparable_ip_list(vm_ip) ASC,vm_name ASC ) as T1 OFFSET (1 -1) LIMIT 100]; nested exception is org.postgresql.util.PSQLException: ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list
  Position: 62 : org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [SELECT * FROM ((SELECT distinct vms.* FROM  vms  )  ORDER BY fn_get_comparable_ip_list(vm_ip) ASC,vm_name ASC ) as T1 OFFSET (1 -1) LIMIT 100]; nested exception is org.postgresql.util.PSQLException: ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list
  Position: 62: org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [SELECT * FROM ((SELECT distinct vms.* FROM  vms  )  ORDER BY fn_get_comparable_ip_list(vm_ip) ASC,vm_name ASC ) as T1 OFFSET (1 -1) LIMIT 100]; nested exception is org.postgresql.util.PSQLException: ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list
  Position: 62
2015-03-04 11:45:50,501 INFO  [org.ovirt.engine.core.bll.SearchQuery] (ajp-/127.0.0.1:8702-8) ResourceManager::searchBusinessObjects - erroneous search text - Vms: page 2 SORTBY HOST ASC
2015-03-04 11:45:54,218 INFO  [org.ovirt.engine.core.bll.SearchQuery] (ajp-/127.0.0.1:8702-10) ResourceManager::searchBusinessObjects - erroneous search text - Vms: page 1 SORTBY HOST ASC

Version-Release number of selected component (if applicable):
RHEV-M 3.5.1-0.1
(build vt14)

How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Yuri Obshansky 2015-03-04 09:56:36 UTC
Created attachment 997801 [details]
engine log file

Comment 2 Einav Cohen 2015-03-05 16:18:39 UTC
the "bad SQL grammar" implies that there is something wrong with the SQL query generated for the "Vms: page 1 SORTBY HOST ASC" (which, AFAIK, is a legal search text, otherwise an SQL query would not be generated in the first place).

Comment 4 Petr Matyáš 2015-06-11 09:07:12 UTC
Verified on ovirt-engine-backend-3.6.0-0.0.master.20150610173629.gitdf68a60.el6.noarch