Bug 1178976

Summary: SCVMM error when saving a vm or template [ActiveRecord::RecordNotUnique]
Product: Red Hat CloudForms Management Engine Reporter: Bronagh Sorota <bsorota>
Component: InsightAssignee: Bronagh Sorota <bsorota>
Status: CLOSED ERRATA QA Contact: Milan Falešník <mfalesni>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 5.3.0CC: dajohnso, dclarizi, gblomqui, jprause, mfalesni, mfeifer, rananda
Target Milestone: GAKeywords: ZStream
Target Release: 5.3.3   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 5.3.3 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1173251 Environment:
Last Closed: 2015-02-25 16:11:59 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1173251    
Bug Blocks:    

Comment 2 CFME Bot 2015-01-05 20:36:21 UTC
New commit detected on cfme/5.3.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=6f003c280dd4a78e31b807d19054116fb16eea93

commit 6f003c280dd4a78e31b807d19054116fb16eea93
Author:     Bronagh Sorota <bsorota>
AuthorDate: Mon Dec 15 14:09:03 2014 -0500
Commit:     Bronagh Sorota <bsorota>
CommitDate: Mon Jan 5 15:30:30 2015 -0500

    SCVMM - DB error VM with multiple VHDs on volume
    
    Make sure the VM's storages hash does not contain duplicates.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1178976

 vmdb/app/models/ems_refresh/parsers/scvmm.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comment 4 Milan Falešník 2015-02-23 17:23:23 UTC
Verified in 5.3.3.2.20150217120931_a465215 against 5.3.1.10.20141112120709_c36c424


5.3.1.10:
# cat /var/www/miq/vmdb/log/evm.log | grep PGError
[----] E, [2015-02-23T17:15:21.888271 #8251:b5480c] ERROR -- : MIQ(abstract_adapter) Name: [], Message: [PGError: ERROR:  duplicate key value violates unique constraint "index_storages_vms_on_vm_id_and_storage_id"
[----] E, [2015-02-23T17:15:21.961054 #8251:b5480c] ERROR -- : MIQ(abstract_adapter) Name: [], Message: [PGError: ERROR:  duplicate key value violates unique constraint "index_storages_vms_on_vm_id_and_storage_id"
[----] E, [2015-02-23T17:17:31.758830 #8251:b5480c] ERROR -- : MIQ(abstract_adapter) Name: [], Message: [PGError: ERROR:  duplicate key value violates unique constraint "index_storages_vms_on_vm_id_and_storage_id"
[----] E, [2015-02-23T17:17:31.818846 #8251:b5480c] ERROR -- : MIQ(abstract_adapter) Name: [], Message: [PGError: ERROR:  duplicate key value violates unique constraint "index_storages_vms_on_vm_id_and_storage_id"

5.3.3.2:
[root@dhcp-8-59-97 ~]# cat /var/www/miq/vmdb/log/evm.log | grep PGError
nothing

I have added the SCVMM system into CFME and then added a VM with 2 disks inside the SCVMM itself and watched logs and UI. 5.3.1.10 did not add the VM and logged the ERRORs. 5.3.3.2 worked without problems.

Comment 6 errata-xmlrpc 2015-02-25 16:11:59 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-0261.html