core icon indicating copy to clipboard operation
core copied to clipboard

Fix Assets Inconsistencies - FixTask00021CheckOrphanedAssets not being run

Open gabbydotCMS opened this issue 10 years ago • 5 comments

There's no trace in the logs indicating that the fix task executor tried to execute FixTask00021CheckOrphanedAssets.

I ran into this while upgrading a client's DB, and this is the trace when executing fix assets inconsistencies in demo.dotcms.org (FixTasksExecutor jumps from task 20 to task 30):

[12/05/16 11:02:28:973 EDT] INFO fixtask.FixTasksExecutor: fix assets and inconsistencies task: FixTask00001CheckAssetsMissingIdentifiers was not Executed [12/05/16 11:02:28:975 EDT] INFO fixtask.FixTasksExecutor: fix assets and inconsistencies task: FixTask00003CheckContainersInconsistencies was not Executed [12/05/16 11:02:28:976 EDT] INFO fixtask.FixTasksExecutor: fix assets and inconsistencies task: FixTask00004CheckFileAssetsInconsistencies was not Executed [12/05/16 11:02:28:977 EDT] INFO fixtask.FixTasksExecutor: fix assets and inconsistencies task: FixTask00005CheckHTMLPagesInconsistencies was not Executed [12/05/16 11:02:28:978 EDT] INFO fixtask.FixTasksExecutor: fix assets and inconsistencies task: FixTask00006CheckLinksInconsistencies was not Executed [12/05/16 11:02:28:980 EDT] INFO fixtask.FixTasksExecutor: fix assets and inconsistencies task: FixTask00007CheckTemplatesInconsistencies was not Executed [12/05/16 11:02:28:986 EDT] INFO fixtask.FixTasksExecutor: fix assets and inconsistencies task: FixTask00008CheckTreeInconsistencies was not Executed [12/05/16 11:02:28:989 EDT] INFO fixtask.FixTasksExecutor: fix assets and inconsistencies task: FixTask00009CheckContentletsInexistentInodes was not Executed [12/05/16 11:02:28:990 EDT] INFO fixtask.FixTasksExecutor: fix assets and inconsistencies task: FixTask00011RenameHostInFieldVariableName was not Executed [12/05/16 11:02:28:991 EDT] INFO fixtask.FixTasksExecutor: fix assets and inconsistencies task: FixTask00012UpdateAssetsHosts was not Executed [12/05/16 11:02:28:991 EDT] INFO fixtask.FixTasksExecutor: Running: FixTask00020DeleteOrphanedIdentifiers [12/05/16 11:02:28:991 EDT] INFO tasks.FixTask00020DeleteOrphanedIdentifiers: Beginning DeleteOrphanedIdentifiers [12/05/16 11:02:30:003 EDT] INFO fixtask.FixTasksExecutor: fix assets and inconsistencies task: FixTask00020DeleteOrphanedIdentifiers was Executed [12/05/16 11:02:30:003 EDT] INFO fixtask.FixTasksExecutor: Running: FixTask00030DeleteOrphanedAssets [12/05/16 11:02:30:003 EDT] INFO tasks.FixTask00030DeleteOrphanedAssets: Beginning DeleteOrphanedAssets [12/05/16 11:02:31:008 EDT] INFO fixtask.FixTasksExecutor: fix assets and inconsistencies task: FixTask00030DeleteOrphanedAssets was Executed [12/05/16 11:02:31:008 EDT] INFO fixtask.FixTasksExecutor: Running: FixTask00040CheckFileAssetsMimeType [12/05/16 11:02:31:008 EDT] INFO tasks.FixTask00040CheckFileAssetsMimeType: Beginning CheckFileAssetsMimeType [12/05/16 11:02:32:010 EDT] INFO fixtask.FixTasksExecutor: fix assets and inconsistencies task: FixTask00040CheckFileAssetsMimeType was Executed [12/05/16 11:02:32:014 EDT] INFO fixtask.FixTasksExecutor: fix assets and inconsistencies task: FixTask00050FixInodesWithoutContentlets was not Executed [12/05/16 11:02:32:014 EDT] INFO fixtask.FixTasksExecutor: Running: FixTask00060FixAssetType [12/05/16 11:02:32:021 EDT] INFO fixtask.FixTasksExecutor: fix assets and inconsistencies task: FixTask00060FixAssetType was Executed [12/05/16 11:02:32:021 EDT] INFO fixtask.FixTasksExecutor: Running: FixTask00070FixVersionInfo [12/05/16 11:02:32:027 EDT] INFO fixtask.FixTasksExecutor: fix assets and inconsistencies task: FixTask00070FixVersionInfo was Executed [12/05/16 11:02:32:027 EDT] INFO fixtask.FixTasksExecutor: fix assets and inconsistencies task: FixTask00080DeleteOrphanedContentTypeFields was not Executed [12/05/16 11:02:32:027 EDT] INFO fixtask.FixTasksExecutor: Running: FixTask00090RecreateMissingFoldersInParentPath [12/05/16 11:02:32:027 EDT] INFO tasks.FixTask00090RecreateMissingFoldersInParentPath: Beginning RecreateMissingFoldersInParentPath [12/05/16 11:02:32:428 EDT] INFO fixtask.FixTasksExecutor: fix assets and inconsistencies task: FixTask00090RecreateMissingFoldersInParentPath was Executed [12/05/16 11:02:32:428 EDT] INFO fixtask.FixTasksExecutor: Finishing tasks.

gabbydotCMS avatar May 12 '16 15:05 gabbydotCMS

After investigation with @dsilvam, it was found that this behavior is currently by-design and was made on-purpose:

  1. On May 22, 2013, following change https://github.com/dotCMS/core/commit/1fb77b4ba0622ff17769e6591f5ac3766ab0fb21 removed fix task 21 (FixTask00021CheckOrphanedAssets) from the system. This change was done as part of fix for issue https://github.com/dotCMS/core/issues/2872.
  2. So, the fix task 21 (FixTask00021CheckOrphanedAssets) remains disabled in the system in order to prevent regression with deletion of published HTML files.

Due to previous facts, I believe it is recommended to close/archive this issue because fix task 21 (FixTask00021CheckOrphanedAssets) was apparently causing deletion of content and became disabled as part of a previous fix (fixed issue with deletion of published HTML files). It might be preferred to having this task not executing in order avoid regressions and loss of data. Please consider.

agomez-dotcms avatar Oct 13 '16 14:10 agomez-dotcms

No objections regarding keeping the task disabled. We've been running all the upgrades to 3.x without it, and we've had no troubles.

Should src/com/dotmarketing/fixtask/tasks/FixTask00021CheckOrphanedAssets.java be removed, though?

gabbydotCMS avatar Oct 13 '16 16:10 gabbydotCMS

Yes @gabbydotCMS, it will be removed!

dsilvam avatar Oct 13 '16 16:10 dsilvam

needs to be merged into 3.7

jtesser avatar Jan 10 '17 18:01 jtesser

Merged into 3.7: https://github.com/dotCMS/core/pull/10419#event-918278334

dsilvam avatar Jan 10 '17 22:01 dsilvam