cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with cleanup orphaned files

cboita
Champ in-the-making
Champ in-the-making
Hi all,

I'm trying to cleanup my orphaned files but this not work on 3.2r2 Community.
I read http://wiki.alfresco.com/wiki/Content_Store_Configuration and in <configRoot>/alfresco/scheduled-jobs-context.xml the contentStoreCleanerTrigger bean is commented out (fileContentStoreCleanerJobDetail too). This is a bug? The orphaned files remain in the content store indefinitely.

What can I do to cleanup the orphaned files?
Thanks all.


regards,
cboita
8 REPLIES 8

scegliau
Champ in-the-making
Champ in-the-making
Hi all,

we have the same problem here (on a 3.2 Community).
The trigger is commented out and nothing is erased from the repository.
Removing comments and changing cron configuration in "scheduled-jobs-context.xml"  generates an exception:

16:52:50,233  ERROR [quartz.core.ErrorLogger] Job (DEFAULT.fileContentStoreCleanerJobDetail threw an exception.
org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: org.alfresco.repo.lock.LockAcquisitionException: 04180085 Failed to get lock '{http://www.al
fresco.org/model/system/1.0}contentstorecleaner' using token '59189db4-bd7e-42c7-bbf0-404eebf23a5d'.  An exclusive lock exists: LockEntity[ ID=1, sharedResourceId=1, exclusiveResou
rceId=1]]
        at org.quartz.core.JobRunShell.run(JobRunShell.java:213)
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529)
Caused by: org.alfresco.repo.lock.LockAcquisitionException: 04180085 Failed to get lock '{http://www.alfresco.org/model/system/1.0}contentstorecleaner' using token '59189db4-bd7e-4
2c7-bbf0-404eebf23a5d'.  An exclusive lock exists: LockEntity[ ID=1, sharedResourceId=1, exclusiveResourceId=1]
        at org.alfresco.repo.domain.locks.AbstractLockDAOImpl.getLock(AbstractLockDAOImpl.java:118)
        at org.alfresco.repo.lock.JobLockServiceImpl$3.execute(JobLockServiceImpl.java:261)
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:326)
        at org.alfresco.repo.lock.JobLockServiceImpl.doWithRetry(JobLockServiceImpl.java:308)
        at org.alfresco.repo.lock.JobLockServiceImpl.getLockImpl(JobLockServiceImpl.java:267)
        at org.alfresco.repo.lock.JobLockServiceImpl.getTransactionalLock(JobLockServiceImpl.java:148)
        at org.alfresco.repo.lock.JobLockServiceImpl.getTransactionalLock(JobLockServiceImpl.java:109)
        at org.alfresco.repo.content.cleanup.ContentStoreCleaner$7.execute(ContentStoreCleaner.java:378)
        at org.alfresco.repo.content.cleanup.ContentStoreCleaner$7.execute(ContentStoreCleaner.java:373)
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:326)
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:233)
        at org.alfresco.repo.content.cleanup.ContentStoreCleaner.execute(ContentStoreCleaner.java:387)
        at org.alfresco.repo.content.cleanup.ContentStoreCleanupJob.execute(ContentStoreCleanupJob.java:64)
        at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
        … 1 more

Please help
thanks

gyro_gearless
Champ in-the-making
Champ in-the-making
Well. i think i had this problem once. Seems like Alfresco gets confused with its housekeeping of locks in case of Exceptions or improper shutdown…

You might try the following:

- Shut down ALfresco
- Examine database table 'alf_lock_resource' and possibly delete stale entries
- Cross fingers
- Start Alfresco

HTH
Gyro

nevoeiro
Champ in-the-making
Champ in-the-making
Hi all,

I found this Issue - https://issues.alfresco.com/jira/browse/ALF-1502 that describes the problem too.
I tried remove comments and this is my exception:


10:14:41,506 ERROR [org.springframework.web.context.ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'fileContentStoreCleanerJobDetail' defined in class path resource [alfresco/scheduled-jobs-context.xml]: Cannot resolve reference to bean 'contentStoreCleaner' while setting bean property 'jobDataAsMap' with key [TypedStringValue: value [contentStoreCleaner], target type [null]]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'contentStoreCleaner' defined in class path resource [alfresco/content-services-context.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.TypeMismatchException: Failed to convert property value of type [org.alfresco.repo.avm.ibatis.AVMNodeDAOIbatis] to required type [org.alfresco.repo.domain.avm.AVMNodeDAO] for property 'avmNodeDAO'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [org.alfresco.repo.avm.ibatis.AVMNodeDAOIbatis] to required type [org.alfresco.repo.domain.avm.AVMNodeDAO] for property 'avmNodeDAO': no matching editors or conversion strategy found
Caused by:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'contentStoreCleaner' defined in class path resource [alfresco/content-services-context.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.TypeMismatchException: Failed to convert property value of type [org.alfresco.repo.avm.ibatis.AVMNodeDAOIbatis] to required type [org.alfresco.repo.domain.avm.AVMNodeDAO] for property 'avmNodeDAO'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [org.alfresco.repo.avm.ibatis.AVMNodeDAOIbatis] to required type [org.alfresco.repo.domain.avm.AVMNodeDAO] for property 'avmNodeDAO': no matching editors or conversion strategy found
Caused by:
org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessException details (1) are:
PropertyAccessException 1:
org.springframework.beans.TypeMismatchException: Failed to convert property value of type [org.alfresco.repo.avm.ibatis.AVMNodeDAOIbatis] to required type [org.alfresco.repo.domain.avm.AVMNodeDAO] for property 'avmNodeDAO'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [org.alfresco.repo.avm.ibatis.AVMNodeDAOIbatis] to required type [org.alfresco.repo.domain.avm.AVMNodeDAO] for property 'avmNodeDAO': no matching editors or conversion strategy found
Caused by:
java.lang.IllegalArgumentException: Cannot convert value of type [org.alfresco.repo.avm.ibatis.AVMNodeDAOIbatis] to required type [org.alfresco.repo.domain.avm.AVMNodeDAO] for property 'avmNodeDAO': no matching editors or conversion strategy found
   at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:231)
   at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:138)
   at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:815)
   at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:645)
   at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:78)
   at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:59)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1127)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:862)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:423)
   at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249)
   at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:155)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:246)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
   at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:267)
   at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:110)
   at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedMap(BeanDefinitionValueResolver.java:320)
   at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:140)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1100)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:862)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:423)
   at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249)
   at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:155)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:246)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
   at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:291)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
   at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)
   at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:189)
   at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
   at org.alfresco.web.app.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:69)
   at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
   at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)
   at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
   at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
   at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
   at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:627)
   at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:553)
   at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488)
   at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
   at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
   at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
   at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
   at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
   at org.apache.catalina.core.StandardService.start(StandardService.java:516)
   at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
   at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
   at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)


If someone knows a workaround to resolve this, please help. Thanks all.


Regards

bfelix
Champ in-the-making
Champ in-the-making
Same issue here.  We have an almost full drive with orphans that can and should be deleted.  Help!

mwildam
Champ in-the-making
Champ in-the-making
When I last tried cleaning orphaned files I was also unsuccessful. Do not remember if I had still an error when I gave up.

However, I am currently just deleting the files manually. That way the statistic does not get updated, but that is my tiniest problem.

bfelix
Champ in-the-making
Champ in-the-making
Thanks for the quick reply.  Sorry if this is a naive question, but, since I "deleted" the content through the web admin interface (also deleted from the Deleted Files area), how would I know which file(s) to delete on the actual hard drive?

mwildam
Champ in-the-making
Champ in-the-making

cboita
Champ in-the-making
Champ in-the-making
does anyone know if this error is corrected in the new version 3.3g?

thanks