Para Desenvolvedores

Cannot delete or update a parent row: a foreign key constraint fails

Ao tentar exluir um canal que não tem nenhum página e serviço, temos a seguinte exceção no log

2019-09-23 12:26:59,852 WARN  127.0.0.1 admin    [LumisRequest - default task-97; url: [http://localhost:8080/portal/lumis/portal/controller/xml/ChannelControllerXml.jsp]; login: [admin]] org.hibernate.util.JDBCExceptionReporter - SQL Error: 1451, SQLState: 23000
2019-09-23 12:26:59,852 ERROR 127.0.0.1 admin    [LumisRequest - default task-97; url: [http://localhost:8080/portal/lumis/portal/controller/xml/ChannelControllerXml.jsp]; login: [admin]] org.hibernate.util.JDBCExceptionReporter - Cannot delete or update a parent row: a foreign key constraint fails (`lumisportal`.`lum_pbpropertybag`, CONSTRAINT `LUM_FK_PBPROPERTYBAG1` FOREIGN KEY (`parentPropertyBagId`) REFERENCES `lum_pbpropertybag` (`id`))
2019-09-23 12:26:59,852 ERROR 127.0.0.1 admin    [LumisRequest - default task-97; url: [http://localhost:8080/portal/lumis/portal/controller/xml/ChannelControllerXml.jsp]; login: [admin]] org.hibernate.event.def.AbstractFlushingEventListener - Could not synchronize database state with session
org.hibernate.exception.ConstraintViolationException: could not delete: [lumis.portal.propertybag.PropertyBag#8A19A3E23AA363C0013AA3662B190583]
	at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:94)
	at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
	at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2559)
	at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2715)
	at org.hibernate.action.EntityDeleteAction.execute(EntityDeleteAction.java:97)
	at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)
	at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263)
	at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:172)
	at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
	at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50)
	at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1028)
	at org.hibernate.ejb.AbstractEntityManagerImpl.flush(AbstractEntityManagerImpl.java:304)
	at lumis.portal.dao.hibernate.HibernateUtil$EntityManagerWrapper.flush(HibernateUtil.java:731)
	at lumis.portal.dao.hibernate.TransactionHibernate.commit(TransactionHibernate.java:408)
	at lumis.portal.channel.ChannelControllerXml.handleRequest(ChannelControllerXml.java:119)
	at org.apache.jsp.lumis.portal.controller.xml.ChannelControllerXml_jsp._jspService(ChannelControllerXml_jsp.java:98)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:433)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:402)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:346)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
	at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)
	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129)
	at io.undertow.websockets.jsr.JsrWebSocketFilter.doFilter(JsrWebSocketFilter.java:130)
	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
	at lumis.portal.appserver.UndertowFilter.doFilter(UndertowFilter.java:90)
	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
	at lumis.portal.rest.RestRootFilter.doFilter(RestRootFilter.java:315)
	at org.glassfish.jersey.servlet.ServletContainer.doFilter(ServletContainer.java:462)
	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
	at lumis.portal.webserver.WebServerIntegrationForwardFilter.doFilter(WebServerIntegrationForwardFilter.java:45)
	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
	at lumis.service.seo.sitemap.SitemapFilter.doFilter(SitemapFilter.java:72)
	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
	at lumis.portal.url.WebResourceForwardFilter.doFilter(WebResourceForwardFilter.java:347)
	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
	at lumis.portal.security.csr.CrossSiteRequestFilter.doFilter(CrossSiteRequestFilter.java:227)
	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
	at lumis.portal.url.WebResourceDiscoveryFilter.doFilter(WebResourceDiscoveryFilter.java:365)
	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
	at lumis.portal.presentation.PortalModeDiscoveryFilter.doFilter(PortalModeDiscoveryFilter.java:125)
	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
	at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:232)
	at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:209)
	at lumis.service.portalmanagement.monitoring.JavaMelodyCustomMonitoringFilter.doFilter(JavaMelodyCustomMonitoringFilter.java:221)
	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
	at lumis.portal.authentication.AuthenticationFilter.changeThreadNameAndProceed(AuthenticationFilter.java:490)
	at lumis.portal.authentication.AuthenticationFilter.lambda$doFilter$0(AuthenticationFilter.java:291)
	at lumis.portal.util.PortalUtilInternal.execWithSilentThrow(PortalUtilInternal.java:533)
	at lumis.util.log.MDCUtil.execWithValues(MDCUtil.java:60)
	at lumis.portal.authentication.AuthenticationFilter.doFilter(AuthenticationFilter.java:282)
	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
	at lumis.portal.monitor.impl.MonitorContextFilter.lambda$doFilter$1(MonitorContextFilter.java:424)
	at lumis.portal.util.PortalUtilInternal.execWithSilentThrow(PortalUtilInternal.java:533)
	at lumis.util.log.MDCUtil.execWithValues(MDCUtil.java:60)
	at lumis.portal.monitor.impl.MonitorContextFilter.doFilter(MonitorContextFilter.java:402)
	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
	at lumis.portal.page.cache.PageCacheSSIFilter.doFilter(PageCacheSSIFilter.java:52)
	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
	at lumis.portal.PortalRequestContextFilter.doFilter(PortalRequestContextFilter.java:97)
	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
	at lumis.portal.filter.EncodingUTF8Filter.doFilter(EncodingUTF8Filter.java:35)
	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
	at lumis.portal.webserver.WebServerIntegrationInitFilter.doFilter(WebServerIntegrationInitFilter.java:367)
	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
	at lumis.portal.website.WebsiteDiscoveryFilter.doFilter(WebsiteDiscoveryFilter.java:302)
	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
	at lumis.portal.PortalConfiguration$RequestInitializer.doFilter(PortalConfiguration.java:152)
	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
	at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)
	at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
	at io.undertow.jsp.JspFileHandler.handleRequest(JspFileHandler.java:32)
	at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
	at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
	at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)
	at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
	at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
	at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
	at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
	at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
	at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)
	at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
	at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
	at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:285)
	at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:264)
	at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)
	at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:175)
	at io.undertow.server.Connectors.executeRootHandler(Connectors.java:202)
	at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:792)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.sql.SQLIntegrityConstraintViolationException: Cannot delete or update a parent row: a foreign key constraint fails (`lumisportal`.`lum_pbpropertybag`, CONSTRAINT `LUM_FK_PBPROPERTYBAG1` FOREIGN KEY (`parentPropertyBagId`) REFERENCES `lum_pbpropertybag` (`id`))
	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:117)
	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
	at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
	at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:974)
	at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1113)
	at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1061)
	at com.mysql.cj.jdbc.ClientPreparedStatement.executeLargeUpdate(ClientPreparedStatement.java:1381)
	at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdate(ClientPreparedStatement.java:1046)
	at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61)
	at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPreparedStatement.java)
	at org.hibernate.jdbc.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:46)
	at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2538)
	... 113 more

Por Rogerio Rodrigues

Em 23/09/19 12:31

Acompanhar pergunta

2 resposta(s):

Ordenar por:

Verifique se existe alguma propertybag cadastrada para este canal.

Basta navegar nas propriedades do Canal >  Avançado > Property Bag,

Por Guilherme Santana

Em 30/09/19 12:21

Guilherme,

Não tem nada, somente uma que é propriedade herdada, mas que é uma do próprio lumis.

 

Por Rogerio Rodrigues

Em 30/09/19 13:00

Entrar

Interaja com a comunidade e tenha acesso a conteúdos exclusivos.

Houve algum erro ao acessar o banco de dados. Tente novamente mais tarde.