-
Type: Bug
-
Status: Open
-
Priority: Minor
-
Resolution: Unresolved
-
Affects Version/s: 10.10
-
Fix Version/s: HOTFIX_10.10, 2021.x
-
Component/s: Quotas
-
Tags:
-
Backlog priority:600
Quotas are computed on all Folderish documents (including versions) and it makes the computation fail when trying to save the document count on versions with this exception
2022-05-24T16:16:40,639 ERROR [Nuxeo-Work-quota-2:default:quotaInitialStatistics:documentsCountUpdater] [org.nuxeo.ecm.core.work.AbstractWork] Exception during work: org.nuxeo.ecm.quota.QuotaStatsInitialWork@4500907c[updaterName=documentsCountUpdater,repositoryName=default] org.nuxeo.ecm.core.api.PropertyException: Cannot set property on a version: dcs:descendantsCount at org.nuxeo.ecm.core.storage.BaseDocument.checkReadOnlyIgnoredWrite(BaseDocument.java:304) ~[nuxeo-core-storage-10.10-HF55.jar:?] at org.nuxeo.ecm.core.storage.BaseDocument.writeComplexProperty(BaseDocument.java:888) ~[nuxeo-core-storage-10.10-HF55.jar:?] at org.nuxeo.ecm.core.storage.BaseDocument.writeDocumentPart(BaseDocument.java:855) ~[nuxeo-core-storage-10.10-HF55.jar:?] at org.nuxeo.ecm.core.storage.sql.coremodel.SQLDocumentLive.writeDocumentPart(SQLDocumentLive.java:178) ~[nuxeo-core-storage-sql-10.10-HF58.jar:?] at org.nuxeo.ecm.core.api.DocumentModelFactory.writeDocumentModel(DocumentModelFactory.java:257) ~[nuxeo-core-10.10-HF58.jar:?] at org.nuxeo.ecm.core.api.AbstractSession.writeModel(AbstractSession.java:374) ~[nuxeo-core-10.10-HF58.jar:?] at org.nuxeo.ecm.core.api.AbstractSession.writeModel(AbstractSession.java:370) ~[nuxeo-core-10.10-HF58.jar:?] at org.nuxeo.ecm.core.api.AbstractSession.saveDocument(AbstractSession.java:1622) ~[nuxeo-core-10.10-HF58.jar:?] at org.nuxeo.ecm.quota.count.DocumentsCountUpdater.saveDocumentsCount(DocumentsCountUpdater.java:291) ~[nuxeo-quota-core-10.10-HF56.jar:?] at org.nuxeo.ecm.quota.count.DocumentsCountUpdater.saveDocumentsCount(DocumentsCountUpdater.java:268) ~[nuxeo-quota-core-10.10-HF56.jar:?] at org.nuxeo.ecm.quota.count.DocumentsCountUpdater.computeInitialStatistics(DocumentsCountUpdater.java:187) ~[nuxeo-quota-core-10.10-HF56.jar:?] at org.nuxeo.ecm.quota.QuotaStatsServiceImpl.computeInitialStatistics(QuotaStatsServiceImpl.java:111) ~[nuxeo-quota-core-10.10-HF56.jar:?] at org.nuxeo.ecm.quota.QuotaStatsInitialWork$1.run(QuotaStatsInitialWork.java:80) ~[nuxeo-quota-core-10.10-HF56.jar:?] at org.nuxeo.ecm.core.api.UnrestrictedSessionRunner.runUnrestricted(UnrestrictedSessionRunner.java:137) ~[nuxeo-core-api-10.10-HF57.jar:?] at org.nuxeo.ecm.quota.QuotaStatsInitialWork.work(QuotaStatsInitialWork.java:82) ~[nuxeo-quota-core-10.10-HF56.jar:?] at org.nuxeo.ecm.core.work.AbstractWork.runWorkWithTransaction(AbstractWork.java:493) [nuxeo-core-event-10.10-HF57.jar:?] at org.nuxeo.ecm.core.work.AbstractWork.run(AbstractWork.java:383) [nuxeo-core-event-10.10-HF57.jar:?] at org.nuxeo.ecm.core.work.WorkHolder.run(WorkHolder.java:57) [nuxeo-core-event-10.10-HF57.jar:?] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_322] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_322] at java.lang.Thread.run(Thread.java:750) [?:1.8.0_322]
The simplest solution is to skip the versions of Folderish documents.
Or we can use the property CoreSession#ALLOW_VERSION_WRITE to save the count on the versions (if it makes more sense)