Bug 1148301 - Assigning a Data Center for a cluster containing a Host, without Data Center assigned to the cluster (Since the previous DC was removed) causes an internal error
Summary: Assigning a Data Center for a cluster containing a Host, without Data Center ...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: oVirt
Classification: Retired
Component: ovirt-engine-core
Version: 3.5
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: 3.5.1
Assignee: Eli Mesika
QA Contact: Pavel Stehlik
URL:
Whiteboard: infra
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-10-01 07:01 UTC by Maor
Modified: 2016-02-10 19:34 UTC (History)
7 users (show)

Fixed In Version: ovirt-3.5.1_rc1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-01-21 16:06:32 UTC
oVirt Team: Infra
Embargoed:


Attachments (Terms of Use)
engine log (67.76 KB, text/plain)
2014-10-01 07:01 UTC, Maor
no flags Details


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 33637 0 master MERGED core: fix attaching a cluster to a new DC Never
oVirt gerrit 33662 0 ovirt-engine-3.5 MERGED core: fix attaching a cluster to a new DC Never

Description Maor 2014-10-01 07:01:58 UTC
Created attachment 942924 [details]
engine log

Description of problem:
Try to assign a Data Center for a cluster containing a Host, and the Data Center does not contain Data Center attached to it, since the previous Data Center was removed from the setup, causes the following sql exception:

2014-10-01 09:48:21,326 INFO  [org.ovirt.engine.core.bll.AddVdsSpmIdCommand] (http--0.0.0.0-8080-2) [6e1775a9] Running command: AddVdsSpmIdCommand internal: true. Entities affected :  ID: 2cf2a7f9-4940-475d-9a2c-6e6a0aad678a Type: VDS
2014-10-01 09:48:21,328 ERROR [org.ovirt.engine.core.bll.AddVdsSpmIdCommand] (http--0.0.0.0-8080-2) [6e1775a9] Command org.ovirt.engine.core.bll.AddVdsSpmIdCommand throw exception: org.springframework.dao.DataIntegrityViolationException: 
CallableStatementCallback; SQL [{call insertvds_spm_id_map(?, ?, ?)}]; ERROR: insert or update on table "vds_spm_id_map" violates foreign key constraint "fk_vds_spm_id_map_storage_pool"
  Detail: Key (storage_pool_id)=(00000000-0000-0000-0000-000000000000) is not present in table "storage_pool".
  Where: SQL statement "INSERT INTO vds_spm_id_map(storage_pool_id, vds_id, vds_spm_id)
        VALUES(v_storage_pool_id, v_vds_id, v_vds_spm_id)"
PL/pgSQL function insertvds_spm_id_map(uuid,uuid,integer) line 3 at SQL statement; nested exception is org.postgresql.util.PSQLException: ERROR: insert or update on table "vds_spm_id_map" violates foreign key constraint "fk_vds_spm_id_map
_storage_pool"
  Detail: Key (storage_pool_id)=(00000000-0000-0000-0000-000000000000) is not present in table "storage_pool".
  Where: SQL statement "INSERT INTO vds_spm_id_map(storage_pool_id, vds_id, vds_spm_id)
        VALUES(v_storage_pool_id, v_vds_id, v_vds_spm_id)"
PL/pgSQL function insertvds_spm_id_map(uuid,uuid,integer) line 3 at SQL statement
....
.....
.....

        at org.ovirt.engine.core.branding.BrandingFilter.doFilter(BrandingFilter.java:72)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
        at org.ovirt.engine.core.utils.servlet.LocaleFilter.doFilter(LocaleFilter.java:64) [utils.jar:]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
        at org.ovirt.engine.core.aaa.filters.SessionMgmtFilter.doFilter(SessionMgmtFilter.java:31) [aaa.jar:]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
        at org.ovirt.engine.core.aaa.filters.LoginFilter.doFilter(LoginFilter.java:73) [aaa.jar:]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
        at org.ovirt.engine.core.aaa.filters.NegotiationFilter.doFilter(NegotiationFilter.java:112) [aaa.jar:]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
        at org.ovirt.engine.core.aaa.filters.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:75) [aaa.jar:]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
        at org.ovirt.engine.core.aaa.filters.SessionValidationFilter.doFilter(SessionValidationFilter.java:63) [aaa.jar:]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:489)
        at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.jboss.web.rewrite.RewriteValve.invoke(RewriteValve.java:466)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930)
        at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_45]
Caused by: org.postgresql.util.PSQLException: ERROR: insert or update on table "vds_spm_id_map" violates foreign key constraint "fk_vds_spm_id_map_storage_pool"
  Detail: Key (storage_pool_id)=(00000000-0000-0000-0000-000000000000) is not present in table "storage_pool".
  Where: SQL statement "INSERT INTO vds_spm_id_map(storage_pool_id, vds_id, vds_spm_id)
        VALUES(v_storage_pool_id, v_vds_id, v_vds_spm_id)"
PL/pgSQL function insertvds_spm_id_map(uuid,uuid,integer) line 3 at SQL statement
        at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2103)
        at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1836)
        at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:512)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:388)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:381)
        at org.jboss.jca.adapters.jdbc.CachedPreparedStatement.execute(CachedPreparedStatement.java:297)
        at org.jboss.jca.adapters.jdbc.WrappedPreparedStatement.execute(WrappedPreparedStatement.java:404)
        at org.springframework.jdbc.core.JdbcTemplate$6.doInCallableStatement(JdbcTemplate.java:1066) [spring-jdbc.jar:3.1.1.RELEASE]
        at org.springframework.jdbc.core.JdbcTemplate$6.doInCallableStatement(JdbcTemplate.java:1) [spring-jdbc.jar:3.1.1.RELEASE]
        at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:1014) [spring-jdbc.jar:3.1.1.RELEASE]


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


How reproducible:


Steps to Reproduce:
1. Have a Data Center with Host and cluster (Tested on 3.5)
2. Remove the Data Center
3. Create a new Data Center
4. Try to assign the cluster to the new Data Center

Actual results:
Getting an Internal Error, the only way to bypass it is to remove the cluster

Expected results:
The assign should work

Additional info:


Document URL: 

Section Number and Name: 

Describe the issue: 

Suggestions for improvement: 

Additional information: 


Description of problem:


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


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Sandro Bonazzola 2015-01-15 14:15:38 UTC
This is an automated message: 
This bug should be fixed in oVirt 3.5.1 RC1, moving to QA

Comment 2 Sandro Bonazzola 2015-01-21 16:06:32 UTC
oVirt 3.5.1 has been released. If problems still persist, please make note of it in this bug report.


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