Description of problem: When using search for templates, it results in <?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.description like '%%%' or vm templates storage domain.free text comment like '%%%' or vm templates storage domain.name like '%%%' or vm templates storage domain.quota name like '%%%' or vm templates storage domain.storage pool name like '%%%' or vm templates storage domain.template version name, template version number like '%%%' or vm templates storage domain.vds group name like '%%%' ) )) 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: 447</detail> </fault> Version-Release number of selected component (if applicable): 3.6.0-0.0.master.20150519172222.git9a2e2b3.el7 How reproducible: 100% Steps to Reproduce: 1. Use curl -k -u admin@internal -i -H "Accept: application/xml" https://{engine_ip}/api/templates\;from\=\?search\=* Actual results: database error Expected results: listed templates
this part looks wrong: ... templates storage domain.template version name, template version number like '%%%' or ... template_version_name is not compared to any value, and template_version_number is not a string at all, i dont think it should be queried here at all not sure if infra or virt, Eli, please let me know what you find/decide as a workaround i recommend not to use this kind of "search all fields for string" you can search for string in specific fields, like: curl -k -u admin@internal -i -H "Accept: application/xml" https://{engine_ip}/api/templates\;from\=\?search\=name\=*
(In reply to Omer Frenkel from comment #1) > this part looks wrong: > > ... > templates storage domain.template version name, template version number like > '%%%' or > ... > > template_version_name is not compared to any value, and > template_version_number is not a string at all, i dont think it should be > queried here at all > > not sure if infra or virt, Eli, please let me know what you find/decide > I think its virt origin : backend/manager/modules/searchbackend/src/main/java/org/ovirt/engine/core/searchbackend/VmTemplateConditionFieldAutoCompleter.java code : columnNameDict.put(VERSION_NAME_AND_NUMBER, "template_version_name, template_version_number"); AFAIK, the search engine does not support here multiple columns, especially when one is varchar and the other is int so the "like" operation will fail. If both version name and number are needed here, maybe add a computed column to the view that is varchar and concat both and then use this column here
ok, thanks. i dont think we need a computed column, currently it doesnt look like the sorting for the version column in the ui works well.. i think it should be on version name only, should fix both search and sorting issues. moving to virt
ovirt-3.6.0-3 release
Verified with ovirt-engine-3.6.0-0.0.master.20150627185750.git6f063c1.el6.noarch according the description: curl -k -u admin@internal -i -H "Accept: application/xml" https://{engine_ip}/api/templates\;from\=\?search\=name\=* returned all the templates as expected.
Problem seen on RHEV 3.5.3. as well.
did not re produce on rhevm-3.5.5-0.1.el6ev.noarch so need to open z-stream bz.