Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-39886

Custom LuceneQueryMapper are not available in a PluginUpgradeTask of the same plugin

      All available LuceneMapperModuleDescriptors are cached by CacheBackedLuceneSearchMapperRegistry. While a plugin is being installed and running the upgrade tasks, the cache has not been updated yet and the custom query mapper descriptors are not available causing this exception:

      [INFO] [talledLocalContainer] Caused by: com.atlassian.confluence.search.v2.lucene.LuceneMapperNotFoundException: A lucene mapper could not be found to map an object of type: com.atlassian.confluence.search.v2.SearchQuery and key: customKey
      [INFO] [talledLocalContainer] 	at com.atlassian.confluence.search.v2.lucene.DelegatingLuceneSearchMapper.convertToLuceneQuery(DelegatingLuceneSearchMapper.java:29)
      [INFO] [talledLocalContainer] 	at com.atlassian.confluence.search.v2.lucene.mapper.BooleanQueryMapper.addSubQueries(BooleanQueryMapper.java:44)
      [INFO] [talledLocalContainer] 	at com.atlassian.confluence.search.v2.lucene.mapper.BooleanQueryMapper.convertToLuceneQuery(BooleanQueryMapper.java:30)
      [INFO] [talledLocalContainer] 	at com.atlassian.confluence.search.v2.lucene.DelegatingLuceneSearchMapper.convertToLuceneQuery(DelegatingLuceneSearchMapper.java:31)
      [INFO] [talledLocalContainer] 	at com.atlassian
      

            [CONFSERVER-39886] Custom LuceneQueryMapper are not available in a PluginUpgradeTask of the same plugin

            Workaround: Sync the module descriptor cache manually in your upgrade task before searching:

            LuceneSearchMapperRegistry searchMapperRegistry = (LuceneSearchMapperRegistry) ContainerManager.getComponent("searchMapperRegistry");
            if (searchMapperRegistry instanceof CacheBackedLuceneSearchMapperRegistry) {
                ((CacheBackedLuceneSearchMapperRegistry) searchMapperRegistry).synchronizeModuleDescriptorsCache();
            }
            

            Georg Schmidl added a comment - Workaround : Sync the module descriptor cache manually in your upgrade task before searching: LuceneSearchMapperRegistry searchMapperRegistry = (LuceneSearchMapperRegistry) ContainerManager.getComponent( "searchMapperRegistry" ); if (searchMapperRegistry instanceof CacheBackedLuceneSearchMapperRegistry) { ((CacheBackedLuceneSearchMapperRegistry) searchMapperRegistry).synchronizeModuleDescriptorsCache(); }

            Created the issue with the wrong account, could you set the reporter to this one? Thx.

            Georg Schmidl added a comment - Created the issue with the wrong account, could you set the reporter to this one? Thx.

              Unassigned Unassigned
              ca8ba42fa92a infod
              Affected customers:
              0 This affects my team
              Watchers:
              0 Start watching this issue

                Created:
                Updated: