Searching for templates doesn't complete and generates SQL errors in the logs.
Issue
- Command doesn't complete when searching for Templates using wild-card (e.g. Template:
*2012*) in RHEV-M GUI. - SQL errors are logged in the engine.log file.
2015-12-31 12:04:40,331 ERROR [org.ovirt.engine.core.bll.SearchQuery] (ajp-/127.0.0.1:8702-7) Query SearchQuery failed. Exception message is StatementCallback; bad SQL grammar [SELECT * FROM (SELECT * FROM vm_templates_view WHERE ( vmt_guid IN (SELECT distinct vm_templates_storage_domain.vmt_guid FROM vm_templates_storage_domain WHERE ( vm_templates_storage_domain.name ILIKE '%%2012%%' OR vm_templates_storage_domain.description ILIKE '%%2012%%' OR vm_templates_storage_domain.quota_name ILIKE '%%2012%%' OR vm_templates_storage_domain.storage_pool_name ILIKE '%%2012%%' OR vm_templates_storage_domain.vds_group_name ILIKE '%%2012%%' OR vm_templates_storage_domain.free_text_comment ILIKE '%%2012%%' OR vm_templates_storage_domain.template_version_name, template_version_number ILIKE '%%2012%%' ) )) ORDER BY name ASC ) as T1 OFFSET (1 -1) LIMIT 100]; nested exception is org.postgresql.util.PSQLException: ERROR: argument of OR must be type boolean, not type character varying
Position: 541 : org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [SELECT * FROM (SELECT * FROM vm_templates_view WHERE ( vmt_guid IN (SELECT distinct vm_templates_storage_domain.vmt_guid FROM vm_templates_storage_domain WHERE ( vm_templates_storage_domain.name ILIKE '%%2012%%' OR vm_templates_storage_domain.description ILIKE '%%2012%%' OR vm_templates_storage_domain.quota_name ILIKE '%%2012%%' OR vm_templates_storage_domain.storage_pool_name ILIKE '%%2012%%' OR vm_templates_storage_domain.vds_group_name ILIKE '%%2012%%' OR vm_templates_storage_domain.free_text_comment ILIKE '%%2012%%' OR vm_templates_storage_domain.template_version_name, template_version_number ILIKE '%%2012%%' ) )) ORDER BY name ASC ) as T1 OFFSET (1 -1) LIMIT 100]; nested exception is org.postgresql.util.PSQLException: ERROR: argument of OR must be type boolean, not type character varying
Position: 541: org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [SELECT * FROM (SELECT * FROM vm_templates_view WHERE ( vmt_guid IN (SELECT distinct vm_templates_storage_domain.vmt_guid FROM vm_templates_storage_domain WHERE ( vm_templates_storage_domain.name ILIKE '%%2012%%' OR vm_templates_storage_domain.description ILIKE '%%2012%%' OR vm_templates_storage_domain.quota_name ILIKE '%%2012%%' OR vm_templates_storage_domain.storage_pool_name ILIKE '%%2012%%' OR vm_templates_storage_domain.vds_group_name ILIKE '%%2012%%' OR vm_templates_storage_domain.free_text_comment ILIKE '%%2012%%' OR vm_templates_storage_domain.template_version_name, template_version_number ILIKE '%%2012%%' ) )) ORDER BY name ASC ) as T1 OFFSET (1 -1) LIMIT 100]; nested exception is org.postgresql.util.PSQLException: ERROR: argument of OR must be type boolean, not type character varying
Position: 541
- Error is also reported when using curl command to search for templates.
# curl -k -u admin@internal -i -H "Accept: application/xml" https://RHEV-M_IP_ADDRESS//api/templates\;from\=\?search\=2012\=*
Enter host password for user 'admin@internal':
HTTP/1.1 400 Bad Request
Date: Thu, 31 Dec 2015 17:20:27 GMT
Content-Type: application/xml
Content-Length: 1000
Vary: Accept-Encoding
Connection: close
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<fault>
<reason>Operation Failed</reason>
<detail>statementcallback; bad sql grammar [select * from (select * from vm templates view where ( vmt guid in (select distinct vm templates storage domain.vmt guid from vm templates storage domain where ( vm templates storage domain.name like '%2012=%%' or vm templates storage domain.description like '%2012=%%' or vm templates storage domain.quota name like '%2012=%%' or vm templates storage domain.storage pool name like '%2012=%%' or vm templates storage domain.vds group name like '%2012=%%' or vm templates storage domain.free text comment like '%2012=%%' or vm templates storage domain.template version name, template version number like '%2012=%%' ) )) order by name asc ) as t1 offset (1 -1) limit 2147483647]; nested exception is org.postgresql.util.psqlexception: error: argument of or must be type boolean, not type character varying
position: 535</detail>
</fault>
Environment
Red Hat Enterprise Virtualization (RHEV) 3.5.3
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.