Bug 1334096

Summary: REST API: Search cluster request returns empty result (v3)
Product: [oVirt] ovirt-engine Reporter: Nelly Credi <ncredi>
Component: RestAPIAssignee: Juan Hernández <juan.hernandez>
Status: CLOSED CURRENTRELEASE QA Contact: Nelly Credi <ncredi>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.0.0CC: bugs, ncredi, oourfali, sbonazzo
Target Milestone: ovirt-4.0.0-betaKeywords: Automation, Regression
Target Release: 4.0.0Flags: rule-engine: ovirt-4.0.0+
rule-engine: blocker+
rule-engine: planning_ack+
oourfali: devel_ack+
pstehlik: testing_ack+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-05 07:51:56 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:
Attachments:
Description Flags
engine logs none

Description Nelly Credi 2016-05-08 11:06:29 UTC
Created attachment 1155037 [details]
engine logs

Description of problem:
In V3, when sending a search request for clusters, an empty object is returned

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


How reproducible:
100%

Steps to Reproduce:
1. /ovirt-engine/api/clusters;max=-1;case_sensitive=false?search=name%3DGolden_Env
2.
3.

Actual results:


    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <clusters/>
     



Expected results:

list of clusters


Additional info:
attached logs - it happened around 18:18

Comment 1 Red Hat Bugzilla Rules Engine 2016-05-09 05:45:30 UTC
This bug report has Keywords: Regression or TestBlocker.
Since no regressions or test blockers are allowed between releases, it is also being identified as a blocker for this release. Please resolve ASAP.

Comment 2 Juan Hernández 2016-05-09 08:23:39 UTC
I can't reproduce this in my environment. However I see in the attached logs some SQL errors, for example:

  ERROR: insert or update on table "host_device" violates foreign key constraint "fk_host_device_parent_name"
  Detail: Key (host_id, parent_device_name)=(19d32811-c8dc-4eca-8d09-497d75899165, scsi_host36) is not present in table "host_device".

Could it be that due to previous errors the cluster wasn't really created?

I also see in the log another API problem with the top level /permissions resource. I will fix that. May that failure abort the test so that the cluster isn't created?

Comment 3 Juan Hernández 2016-05-09 08:49:06 UTC
Note that the proposed patch fixes the issue with the system permissions resource, but as I can't reproduce the original problem in my environment I can't say that it really fixes the issue.

Comment 4 Yaniv Lavi 2016-05-09 10:53:08 UTC
Moving to first RC, since things should not be targeted to second one at this point.

Comment 5 Nelly Credi 2016-05-09 15:55:46 UTC
We are actually not creating the clusters during the tests, but running on a pre-existing environment with 2 clusters matching this regex, so I cannot imagine such situation and the clusters still existed at the end of the execution
I will try to manually reproduce and update

Comment 6 Juan Hernández 2016-05-10 09:13:26 UTC
As it is not clear if the proposed fix solves the issue, I'm moving the bug back to ASSIGNED, and re-setting the need info. Nelly, please clear the need info when/if you are able to reproduce.

Comment 8 Juan Hernández 2016-05-10 16:45:40 UTC
The problem is that the value of the "case_sensitive" parameter is ignored, so the following request:

  /clusters;max=-1;case_sensitive=false?search=name%3DGolden_Env%2A

Was looking for clusters named exactly, including case, Golden_Env*, and the clusters in that environment have lower case names, like "golden_env_mixed_1" and "golden_env_mixed_2". The proposed patch fixes this regression.

Comment 9 Sandro Bonazzola 2016-07-05 07:51:56 UTC
oVirt 4.0.0 has been released, closing current release.