Bug 878344 - engine: AddVdsSpmIdCommand throw exception when trying to edit cluster after DC force remove
engine: AddVdsSpmIdCommand throw exception when trying to edit cluster after ...
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine (Show other bugs)
3.1.0
x86_64 Linux
high Severity medium
: ---
: 3.2.0
Assigned To: Eli Mesika
Dafna Ron
infra
: Regression
: 876889 879362 894073 907153 (view as bug list)
Depends On:
Blocks: 915537
  Show dependency treegraph
 
Reported: 2012-11-20 03:06 EST by Dafna Ron
Modified: 2016-02-10 14:30 EST (History)
14 users (show)

See Also:
Fixed In Version: sf6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-06-11 04:19:42 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: Infra
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
log (176.37 KB, application/x-xz)
2012-11-20 03:06 EST, Dafna Ron
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
oVirt gerrit 11271 None None None Never

  None (edit)
Description Dafna Ron 2012-11-20 03:06:28 EST
Created attachment 648339 [details]
log

Description of problem:

I forced removed a DC and tried to edit the cluster which is currently attached to a host to add a new DC to the cluster. 
UI shows: 
Error while executing action Edit Cluster properties: Internal oVirt Engine Error 

engine logs shows: 

2012-11-20 09:55:49,764 ERROR [org.ovirt.engine.core.bll.AddVdsSpmIdCommand] (ajp-/127.0.0.1:8702-10) [61227938] Command org.ovirt.engine.core.bll.AddVdsSpmIdCommand throw exce
ption: org.springframework.dao.DuplicateKeyException: CallableStatementCallback; SQL [{call insertvds_spm_id_map(?, ?, ?)}]; ERROR: duplicate key value violates unique constrai
nt "pk_vds_spm_id_map"

this will not help the user to understand what the issue is. 

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

si24.2

How reproducible:

100%

Steps to Reproduce:
1. create a DC and a cluster and attach them to two hosts
2. force remove the DC
3. create a new DC 
4. in the Cluster tab edit the current cluster and try to save the new DC you created
  
Actual results:

2012-11-20 09:55:49,764 ERROR [org.ovirt.engine.core.bll.AddVdsSpmIdCommand] (ajp-/127.0.0.1:8702-10) [61227938] Command org.ovirt.engine.core.bll.AddVdsSpmIdCommand throw exce
ption: org.springframework.dao.DuplicateKeyException: CallableStatementCallback; SQL [{call insertvds_spm_id_map(?, ?, ?)}]; ERROR: duplicate key value violates unique constrai
nt "pk_vds_spm_id_map"

Expected results:

if this operation is not allowed we should have a clear error displayed. 

Additional info: log

2012-11-20 09:55:49,763 INFO  [org.ovirt.engine.core.bll.AddVdsSpmIdCommand] (ajp-/127.0.0.1:8702-10) [61227938] Running command: AddVdsSpmIdCommand internal: true. Entities af
fected :  ID: f495558e-316d-11e2-87b0-001a4a169741 Type: VDS
2012-11-20 09:55:49,764 ERROR [org.ovirt.engine.core.bll.AddVdsSpmIdCommand] (ajp-/127.0.0.1:8702-10) [61227938] Command org.ovirt.engine.core.bll.AddVdsSpmIdCommand throw exce
ption: org.springframework.dao.DuplicateKeyException: CallableStatementCallback; SQL [{call insertvds_spm_id_map(?, ?, ?)}]; ERROR: duplicate key value violates unique constrai
nt "pk_vds_spm_id_map"
  Where: SQL statement "INSERT INTO vds_spm_id_map(storage_pool_id, vds_id, vds_spm_id) VALUES( $1 ,  $2 ,  $3 )"
PL/pgSQL function "insertvds_spm_id_map" line 2 at SQL statement; nested exception is org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "
pk_vds_spm_id_map"
  Where: SQL statement "INSERT INTO vds_spm_id_map(storage_pool_id, vds_id, vds_spm_id) VALUES( $1 ,  $2 ,  $3 )"
PL/pgSQL function "insertvds_spm_id_map" line 2 at SQL statement
        at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:241) [spring-jdbc-3.1.1.RELEASE.jar:3.1.1.REL
EASE]
        at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72) [spring-jdbc-3.1.1.RELEASE.jar:3.1.
1.RELEASE]
        at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:1030) [spring-jdbc-3.1.1.RELEASE.jar:3.1.1.RELEASE]
        at org.springframework.jdbc.core.JdbcTemplate.call(JdbcTemplate.java:1064) [spring-jdbc-3.1.1.RELEASE.jar:3.1.1.RELEASE]
        at org.springframework.jdbc.core.simple.AbstractJdbcCall.executeCallInternal(AbstractJdbcCall.java:388) [spring-jdbc-3.1.1.RELEASE.jar:3.1.1.RELEASE]
        at org.springframework.jdbc.core.simple.AbstractJdbcCall.doExecute(AbstractJdbcCall.java:351) [spring-jdbc-3.1.1.RELEASE.jar:3.1.1.RELEASE]
        at org.springframework.jdbc.core.simple.SimpleJdbcCall.execute(SimpleJdbcCall.java:181) [spring-jdbc-3.1.1.RELEASE.jar:3.1.1.RELEASE]
        at org.ovirt.engine.core.dal.dbbroker.SimpleJdbcCallsHandler.executeImpl(SimpleJdbcCallsHandler.java:124) [engine-dal.jar:]
        at org.ovirt.engine.core.dal.dbbroker.SimpleJdbcCallsHandler.executeModification(SimpleJdbcCallsHandler.java:37) [engine-dal.jar:]
        at org.ovirt.engine.core.dao.VdsSpmIdMapDAODbFacadeImpl.save(VdsSpmIdMapDAODbFacadeImpl.java:42) [engine-dal.jar:]
        at org.ovirt.engine.core.dao.VdsSpmIdMapDAODbFacadeImpl.save(VdsSpmIdMapDAODbFacadeImpl.java:17) [engine-dal.jar:]
        at org.ovirt.engine.core.bll.AddVdsSpmIdCommand.executeCommand(AddVdsSpmIdCommand.java:75) [engine-bll.jar:]
        at org.ovirt.engine.core.bll.CommandBase.executeWithoutTransaction(CommandBase.java:876) [engine-bll.jar:]
        at org.ovirt.engine.core.bll.CommandBase.executeActionInTransactionScope(CommandBase.java:973) [engine-bll.jar:]
        at org.ovirt.engine.core.bll.CommandBase.runInTransaction(CommandBase.java:1372) [engine-bll.jar:]
        at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInRequired(TransactionSupport.java:144) [engine-utils.jar:]
        at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInScope(TransactionSupport.java:109) [engine-utils.jar:]
        at org.ovirt.engine.core.bll.CommandBase.execute(CommandBase.java:991) [engine-bll.jar:]
        at org.ovirt.engine.core.bll.CommandBase.executeAction(CommandBase.java:291) [engine-bll.jar:]
        at org.ovirt.engine.core.bll.Backend.runActionImpl(Backend.java:350) [engine-bll.jar:]
        at org.ovirt.engine.core.bll.Backend.runInternalAction(Backend.java:290) [engine-bll.jar:]
Comment 1 Haim 2012-11-22 12:05:16 EST
*** Bug 879362 has been marked as a duplicate of this bug. ***
Comment 3 Yaniv Kaul 2012-11-25 04:05:03 EST
*** Bug 876889 has been marked as a duplicate of this bug. ***
Comment 4 Rami Vaknin 2012-12-05 03:54:57 EST
Note that this bug still reproduces on si24.5
Comment 5 Petr Spacek 2012-12-12 06:52:05 EST
This bug is still present in following installation:

rhevm-backend-3.1.0-32.el6ev.noarch
rhevm-userportal-3.1.0-32.el6ev.noarch
rhevm-genericapi-3.1.0-32.el6ev.noarch
rhevm-3.1.0-32.el6ev.noarch
rhevm-sdk-3.1.0.16-1.el6ev.noarch
rhevm-log-collector-3.1.0-9.el6ev.noarch
rhevm-config-3.1.0-32.el6ev.noarch
rhevm-spice-client-x64-cab-3.1-8.el6.noarch
rhevm-dbscripts-3.1.0-32.el6ev.noarch
rhevm-cli-3.1.0.17-1.el6ev.noarch
rhevm-image-uploader-3.1.0-7.el6ev.noarch
rhevm-tools-common-3.1.0-32.el6ev.noarch
rhevm-spice-client-x86-cab-3.1-8.el6.noarch
rhevm-doc-3.1.0-21.el6eng.noarch
rhevm-webadmin-portal-3.1.0-32.el6ev.noarch
rhevm-setup-3.1.0-32.el6ev.noarch
rhevm-notification-service-3.1.0-32.el6ev.noarch
rhevm-restapi-3.1.0-32.el6ev.noarch
rhevm-iso-uploader-3.1.0-8.el6ev.noarch

I can provide snapshot of "crippled" RHEV-M machine.
Comment 6 Barak 2013-01-06 09:35:19 EST
Simon,

Should we allow force removal of DC with active clusters ?
Comment 7 Simon Grinberg 2013-01-06 10:01:22 EST
(In reply to comment #6)
> Simon,
> 
> Should we allow force removal of DC with active clusters ?

Yes, since force remove DC should be allowed only when all the hosts are in maintenance. There should be no problem then to move the clusters and the hosts underneath to a new DC instead of forcing the user to delete all hosts and re-add to a new DC.

There is a related bug around that which I fail to find ATM.
Comment 8 Yair Zaslavsky 2013-01-15 13:06:46 EST
*** Bug 894073 has been marked as a duplicate of this bug. ***
Comment 9 Eli Mesika 2013-01-21 11:33:35 EST
http://gerrit.ovirt.org/#/c/11271/
Comment 10 Eli Mesika 2013-01-27 08:34:37 EST
fixed in commit : ba263d0
Comment 12 Yair Zaslavsky 2013-02-10 06:41:42 EST
*** Bug 907153 has been marked as a duplicate of this bug. ***
Comment 13 Dafna Ron 2013-05-19 05:24:40 EDT
verified on sf17
Comment 14 Itamar Heim 2013-06-11 04:19:42 EDT
3.2 has been released
Comment 15 Itamar Heim 2013-06-11 04:23:28 EDT
3.2 has been released

Note You need to log in before you can comment on or make changes to this bug.