[MGNLCACHE-117] Versionhandler of the cache module breaks if there's no cache filter with the default name Created: 14/Jul/15  Updated: 13/Aug/15  Resolved: 30/Jul/15

Status: Closed
Project: Cache Modules
Component/s: None
Affects Version/s: 5.4
Fix Version/s: 5.4.1

Type: Bug Priority: Major
Reporter: Rico Jansen Assignee: Evzen Fochr
Resolution: Fixed Votes: 0
Labels: support
Remaining Estimate: 0d
Time Spent: 5.25h
Original Estimate: Not Specified

Issue Links:
Relates
relates to MGNLCACHE-119 "The defaultPageCache property is not... Closed
causality
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:
Visible to:
Nils Breunese
Sprint: Sprint 4 (Kromeriz)
Story Points: 5

 Description   

As part of our Magnolia 5 migration I am looking into the 5.3 -> 5.4 upgrade.
Apart from a few code changes this goes well. However the caching configuration completely breaks.

We have a multisite caching configuration structured as per :
https://documentation.magnolia-cms.com/display/DOCS53/Advanced+Cache+module

However the versionhandler of the regular cache module doesn't expect this in the version upgrade from 5.3 to 5.4
At info.magnolia.module.cache.setup.CacheModuleVersionHandler#126 it tries to rename a property that does not exist in a multisite configuration resulting in an error

ERROR  info.magnolia.module.InstallContextImpl 10.07.2015 17:30:18 -- [1/17 tasks - Magnolia Cache Module (version 5.4.0)]> Could not install or update cache module. Task 'Renaming of 'configurations' to 'contentCaching'' failed. (PathNotFoundException: /server/filters/cache/cacheConfigurationName)
info.magnolia.module.delta.TaskExecutionException: Could not execute task: Path not found: /server/filters/cache/cacheConfigurationName
        at info.magnolia.module.delta.AbstractRepositoryTask.execute(AbstractRepositoryTask.java:59)
        at info.magnolia.module.delta.ArrayDelegateTask.execute(ArrayDelegateTask.java:98)
        at info.magnolia.module.ModuleManagerImpl.applyDeltas(ModuleManagerImpl.java:511)
        at info.magnolia.module.ModuleManagerImpl.installOrUpdateModule(ModuleManagerImpl.java:493)
        at info.magnolia.module.ModuleManagerImpl$1.doExec(ModuleManagerImpl.java:274)
        at info.magnolia.context.MgnlContext$VoidOp.exec(MgnlContext.java:421)

The documenation for 5.4 at https://documentation.magnolia-cms.com/display/DOCS/Advanced+Cache+modules does not give insight how it should be configured to make it work in a multisite situation so fixing it manually is currently not something I can do.



 Comments   
Comment by Evzen Fochr [ 29/Jul/15 ]

https://git.magnolia-cms.com/gitweb/?p=modules/cache.git;a=commit;h=61c23cc63780f01aa88317d2987d560f0e416092

Comment by Roman Kovařík [ 30/Jul/15 ]

Reopened:

  1. I'd keep the delta for 5.4 even this is wrong (and put commend there that this is incorrect and will be fixed in the next delta). The reason is that we can track it later and check if there will be some problems.
  2. It'd be much more safer and readable if you use NodeVisitorTask since the cache filter can have another name and so on...
  3. It's better to add a test class for more complicated tasks and you don't need to test it in the version handler test (or keep both since the test it's already implemented).
Comment by Evzen Fochr [ 30/Jul/15 ]

http://git.magnolia-cms.com/gitweb/?p=modules/cache.git;a=commit;h=6a6705fedadc9453f150117dfbb44d413972801e

Comment by Roman Kovařík [ 30/Jul/15 ]

Reopened:

  1. You should extend NodeVisitorTask which does some work for you.
  2. info.magnolia.module.cache.setup.MigrateCacheFilterConfigurationTask#CACHE_FILTERS_PATH should be /server/filters.
  3. Test also a custom cache filter class.
  4. You can also revert all changes in info.magnolia.module.cache.setup.CacheModuleVersionHandlerTest since the tests are the same as in MigrateCacheFilterConfigurationTaskTest.
Generated at Sun Feb 11 23:52:22 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.