cancel
Showing results for 
Search instead for 
Did you mean: 

problem deleting node

andreasg
Champ in-the-making
Champ in-the-making
Hallo,

trying to delete from archive-space (WebUI,2.1) gives the following error for 2 of appr. 2000  nodes:

Die Operation could not delete: [org.alfresco.repo.domain.hibernate.NodeImpl#11828]; nested exception is org.hibernate.exception.ConstraintViolationException: could not delete: [org.alfresco.repo.domain.hibernate.NodeImpl#11828] hat einen Systemfehler verursacht.
more log available if needed.

what can i do?

Andreas Grabner
7 REPLIES 7

derek
Star Contributor
Star Contributor
More stack trace, please.

andreasg
Champ in-the-making
Champ in-the-making
Stacktrace:


08:29:14,696 ERROR [org.alfresco.web.ui.common.Utils] Die Operation could not delete: [org.alfresco.repo.domain.hibernate.NodeImpl#11828]; nested exception is org.hibernate.exception.ConstraintViolationException: could not delete: [org.alfresco.repo.domain.hibernate.NodeImpl#11828] hat einen Systemfehler verursacht.
org.springframework.dao.DataIntegrityViolationException: could not delete: [org.alfresco.repo.domain.hibernate.NodeImpl#11828]; nested exception is org.hibernate.exception.ConstraintViolationException: could not delete: [org.alfresco.repo.domain.hibernate.NodeImpl#11828]
Caused by:
org.hibernate.exception.ConstraintViolationException: could not delete: [org.alfresco.repo.domain.hibernate.NodeImpl#11828]
        at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:71)
        at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
        at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2491)
        at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2647)
        at org.hibernate.action.EntityDeleteAction.execute(EntityDeleteAction.java:74)
        at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
        at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:232)
        at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:144)
        at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
        at org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:41)
        at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:969)
        at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1114)
        at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
at org.alfresco.repo.node.db.hibernate.HibernateNodeDaoServiceImpl$12.doInHibernate(HibernateNodeDaoServiceImpl.java:1022)
        at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:367)
        at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:333)
        at org.alfresco.repo.node.db.hibernate.HibernateNodeDaoServiceImpl.getParentAssocsInternal(HibernateNodeDaoServiceImpl.java:1025)
        at org.alfresco.repo.node.db.hibernate.HibernateNodeDaoServiceImpl.deleteNodeInternal(HibernateNodeDaoServiceImpl.java:502)
        at org.alfresco.repo.node.db.hibernate.HibernateNodeDaoServiceImpl.deleteChildAssocInternal(HibernateNodeDaoServiceImpl.java:960)
        at org.alfresco.repo.node.db.hibernate.HibernateNodeDaoServiceImpl.deleteNodeInternal(HibernateNodeDaoServiceImpl.java:517)
        at org.alfresco.repo.node.db.hibernate.HibernateNodeDaoServiceImpl.deleteChildAssocInternal(HibernateNodeDaoServiceImpl.java:960)
        at org.alfresco.repo.node.db.hibernate.HibernateNodeDaoServiceImpl.deleteNodeInternal(HibernateNodeDaoServiceImpl.java:517)
        at org.alfresco.repo.node.db.hibernate.HibernateNodeDaoServiceImpl.deleteNode(HibernateNodeDaoServiceImpl.java:485)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:281)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:187)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:154)
        at org.alfresco.repo.transaction.TransactionalDaoInterceptor.invoke(TransactionalDaoInterceptor.java:68)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:210)
        at $Proxy1.deleteNode(Unknown Source)
        at org.alfresco.repo.node.db.DbNodeServiceImpl.deleteNode(DbNodeServiceImpl.java:729)
        at sun.reflect.GeneratedMethodAccessor728.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:281)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:187)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:154)
        at org.alfresco.repo.transaction.TransactionResourceInterceptor.invoke(TransactionResourceInterceptor.java:138)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:210)
        at $Proxy2.deleteNode(Unknown Source)
        at sun.reflect.GeneratedMethodAccessor728.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.alfresco.repo.service.StoreRedirectorProxyFactory$RedirectorInvocationHandler.invoke(StoreRedirectorProxyFactory.java:221)
        at $Proxy3.deleteNode(Unknown Source)
        at sun.reflect.GeneratedMethodAccessor728.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:281)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:187)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:154)
        at org.alfresco.repo.node.MLPropertyInterceptor.invoke(MLPropertyInterceptor.java:211)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:210)
        at $Proxy2.deleteNode(Unknown Source)
        at sun.reflect.GeneratedMethodAccessor728.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:281)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:187)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:154)
        at net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:80)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
        at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:49)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
        at org.alfresco.repo.audit.AuditComponentImpl.auditImpl(AuditComponentImpl.java:256)
        at org.alfresco.repo.audit.AuditComponentImpl.audit(AuditComponentImpl.java:191)
        at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:69)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:210)
        at $Proxy2.deleteNode(Unknown Source)
        at org.alfresco.repo.node.archive.NodeArchiveServiceImpl$2.execute(NodeArchiveServiceImpl.java:285)
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:225)
        at org.alfresco.repo.node.archive.NodeArchiveServiceImpl.purgeArchivedNode(NodeArchiveServiceImpl.java:294)
        at org.alfresco.web.bean.TrashcanBean.deleteItemOK(TrashcanBean.java:701)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:132)
        at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:61)
        at javax.faces.component.UICommand.broadcast(UICommand.java:109)
        at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:97)
        at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:171)
at org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(InvokeApplicationExecutor.java:32)
        at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:95)
        at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:139)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
        at org.alfresco.web.app.servlet.AuthenticationFilter.doFilter(AuthenticationFilter.java:81)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
        at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
        at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
        at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
        at java.lang.Thread.run(Thread.java:595)
Caused by: com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Cannot delete or update a parent row: a foreign key constraint fails (`alfresco/alf_node_status`, CONSTRAINT `FK71C2002B7F2C8017` FOREIGN KEY (`node_id`) REFERENCES `alf_node` (`id`))
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:931)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2870)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1573)
        at com.mysql.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:1160)
        at com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:685)
        at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1400)
        at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1314)
        at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1299)
        at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:101)
        at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2473)
        … 109 more

derek
Star Contributor
Star Contributor
Hi,
select * from alf_node_status where node_id = 11828;
If you get two entries, you need to delete the entry from the live store.
delete from alf_node_status where node_id = 11828 and protocol = 'workspace';
Repeat for the other node that fails - you can probably find it using a query.

If you don't have two entries for the nodes, then we'll need to dig deeper.  Also, before you remove the entries, could you post the results of
select qname, string_value from alf_node_properties where node_id = 11828;

Regards

andreasg
Champ in-the-making
Champ in-the-making
Hi,
that helps! Thanks.

mysql> select * from alf_node_status where node_id = 11828;
+———–+————-+————————————–+———+—————-+———+
| protocol  | identifier  | guid                                 | version | transaction_id | node_id |
+———–+————-+————————————–+———+—————-+———+
| archive   | SpacesStore | 7ed2373b-33c2-11dc-88ed-6322d2913ab0 |       1 |          38493 |   11828 |
| workspace | SpacesStore | 7ed2373b-33c2-11dc-88ed-6322d2913ab0 |       2 |          38493 |   11828 |
+———–+————-+————————————–+———+—————-+———+
2 rows in set (0.00 sec)

Sorry, i had to read until the end first. I have already deleted the results so the next query is possibly useless.
mysql> select qname, string_value from alf_node_properties where node_id = 11828;
+—————————————————–+—————————————————————————————- ———————————————————–+
| qname                                               | string_value                                                            |
+—————————————————–+—————————————————————————————- ———————————————————–+
| {http://www.alfresco.org/model/content/1.0}content  | contentUrl=store://2007/7/16/19/32/7ed4f65e-33c2-11dc-88ed-6322d2913ab0.bin|mimetype=ap plication/octet-stream|size=0|encoding=UTF-8|locale=de_DE_ |
| {http://www.alfresco.org/model/content/1.0}created  | 2007-07-16T19:32:15.879+02:00                                                            |
| {http://www.alfresco.org/model/content/1.0}creator  | andreas                                                            |
| {http://www.alfresco.org/model/content/1.0}modified | 2007-07-19T14:11:59.244+02:00                                                            |
| {http://www.alfresco.org/model/content/1.0}modifier | admin                                                            |
| {http://www.alfresco.org/model/content/1.0}name     | Hadriano Bold                                                            |
+—————————————————–+—————————————————————————————- ———————————————————–+
6 rows in set (0.00 sec)

Thanks
Andreas

sergio
Champ in-the-making
Champ in-the-making
The same problem for me, now solved.

Here the list of properties for the node with the problem:


4853, 'CONTENT', '', 'STRING', '', 0, 0, 0, 'contentUrl=store://2007/9/25/10/21/41166d44-6b40-11dc-b2be-dfe3552b0a0b.bin|mimetype=application/x-www-form-urlencoded|size=148781866|encoding=UTF-8|locale=en_US_', '', '{http://www.alfresco.org/model/content/1.0}content'
4853, 'DATE', '', 'STRING', '', 0, 0, 0, '2007-09-25T10:21:50.158+02:00', '', '{http://www.alfresco.org/model/content/1.0}created'
4853, 'STRING', '', 'STRING', '', 0, 0, 0, 'Cineca1', '', '{http://www.alfresco.org/model/content/1.0}creator'
4853, 'STRING', '', 'STRING', '', 0, 0, 0, '', '', '{http://www.alfresco.org/model/content/1.0}description'
4853, 'DATE', '', 'STRING', '', 0, 0, 0, '2007-09-25T10:21:50.281+02:00', '', '{http://www.alfresco.org/model/content/1.0}modified'
4853, 'STRING', '', 'STRING', '', 0, 0, 0, 'Cineca1', '', '{http://www.alfresco.org/model/content/1.0}modifier'
4853, 'STRING', '', 'STRING', '', 0, 0, 0, '20070412_BO-15_U133Plus.DAT', '', '{http://www.alfresco.org/model/content/1.0}name'
4853, 'STRING', '', 'STRING', '', 0, 0, 0, 'Cineca1', '', '{http://www.alfresco.org/model/content/1.0}owner'
4853, 'STRING', '', 'STRING', '', 0, 0, 0, '20070412_BO-15_U133Plus.DAT', '', '{http://www.alfresco.org/model/content/1.0}title'
4853, 'STRING', '', 'STRING', '', 0, 0, 0, 'Cineca1', '', '{http://www.alfresco.org/model/system/1.0}archivedBy'
4853, 'DATE', '', 'STRING', '', 0, 0, 0, '2007-09-25T10:21:50.126+02:00', '', '{http://www.alfresco.org/model/system/1.0}archivedDate'
4853, 'STRING', '', 'STRING', '', 0, 0, 0, 'Cineca1', '', '{http://www.alfresco.org/model/system/1.0}archivedOriginalOwner'
4853, 'CHILD_ASSOC_REF', '', 'STRING', '', 0, 0, 0, 'archive://SpacesStore/1027810d-07ed-11dc-a515-8ba8ce45a82e|archive://SpacesStore/20f4dfab-6b40-11dc-b2be-dfe3552b0a0b|{http://www.alfresco.org/model/system/1.0}children|{http://www.alfresco.org/model/system/1.0}archived...', '', '{http://www.alfresco.org/model/system/1.0}archivedOriginalParentAssoc'

But two more questions:
    what is the possible reason for the problem described? It could be a problem if in a production happens again this situation. Even if I restart Alfresco the problem continues… Th only way to solve it is to execute manually the queries you suggested.
    What is the exact functions and meaning of the alf_node_status table?
Many thanks to all.

Sergio

derek
Star Contributor
Star Contributor
alf_node_status keeps track of the transaction of the last change/delete of a node.  This is required in order to replay transactions.

derek
Star Contributor
Star Contributor