• If a plugin module is installed while the system is receiving HTTP traffic, and if the module contains a Velocity helper component, Confluence will sometimes disable the Velocity module of the newly-loaded plugin.

      Symptoms of this problem can be seen in the following KB articles:

      Because of the way the plugin system handles dependencies, this issue sometimes also occurs when other plugins in the system are enabled or disabled, since Confluence will disable and reenable dependent plugins when other plugin actions are performed. This inadvertent reinstall can occur even when other, unrelated plugins are installed in Confluence <3.5.3 (see CONF-22341). Unfortunately, this means that performing an action such as 'enabling plugin A' can cause a result of 'the Velocity template module in plugin B got disabled', and all of this is done without the user's knowledge.

      This occurs due to a race condition during plugin installation, when the plugin is only partially loaded and Confluence is asked to render Velocity content. In com.atlassian.confluence.setup.velocity.PluginContextItemProvider:

                  try 
                  { 
                      velocityContextModuleMap.put(descriptor.getContextKey(), descriptor.getModule()); 
                  } 
                  catch (final RuntimeException ex) 
                  { 
                      // TODO: Fire an event here? this coupling is quite crude 
                      pluginController.disablePluginModule(descriptor.getCompleteKey()); 
                  } 
      

      I attached a debugger to Confluence and found that the exception (which is silently eaten in the above RuntimeException block) is thrown by descriptor.getModule(); the inner exception for "RuntimeException ex" has the following stack trace:

      java.lang.IllegalStateException: Cannot retrieve plugin module before it is enabled: PluginModuleHolder[(unknown; not enabled)] 
      com.atlassian.confluence.plugin.module.PluginModuleHolder.getModule(PluginModuleHolder.java:97) 
      com.atlassian.confluence.plugin.descriptor.VelocityContextItemModuleDescriptor.getModule(VelocityContextItemModuleDescriptor.java:36) 
      com.atlassian.confluence.setup.velocity.PluginContextItemProvider.getContextMap(PluginContextItemProvider.java:35) 
      (...)
      

      We didn't try to reproduce this issue with the Office Connector or Doc Theme plugins directly, but we have reproduced it with two separate custom plugins with Velocity context modules, and we believe that the issue is identical. We are able to make this happen consistently by using the UPM to load a plugin with one of the impacted module types while running a script to generate traffic, such as the following:

      #!/bin/bash
      while [ true ]
      do
      	wget http://127.0.0.1:8080/display/Overview/Home
      	sleep 0.5
      done
      

      Notes

      We have recently seen this bug affecting newer versions of Confluence. The major side effect is having velocity modules related to the top navbar being disabled, so it does not load properly. The modules are:

      soyTemplateRendererHelperContext
      velocity.helper
      siteLogoHelperContext
      

      If you see this problem, proceed with the workaround below to re-enable them by removing entries for those modules from the bandana plugin map column:

      For Data Center instances, we need to shutdown all nodes to apply the workaround. Performing a rolling restart may set the modules to disabled again, even after running the query to change them.

      Workaround using UPM REST API

      The following workaround is available so you can identify if you are affected by this bug and it also describes how to fix it (for the moment) without requiring a restart.
      It makes use of UPM REST API calls through a Linux command line.

      Using the UPM REST API to identify if you are affected by this problem

      1. Get UPM token to be used on the next steps – it will be saved as an environment variable.
        CONFLUENCE_BASE_URL=<Confluence Base URL>
        ADMIN_USRNAME=<local admin account username>
        ADMIN_PWD=<local admin account password>
        
        UPM_TOKEN=$(curl -I --user $ADMIN_USRNAME:$ADMIN_PWD -H 'Accept: application/vnd.atl.plugins.installed+json' ${CONFLUENCE_BASE_URL}'/rest/plugins/1.0/?os_authType=basic' 2>/dev/null | grep 'upm-token' | cut -d " " -f 2 | tr -d '\r')
        
      2. Get the current status of soyTemplateRendererHelperContext module. If you get a JSON response from that, it means this module is disabled and you are affected by this bug.
        curl --user $ADMIN_USRNAME:$ADMIN_PWD ${CONFLUENCE_BASE_URL}'/rest/plugins/1.0/com.atlassian.confluence.plugins.soy-key/modules/soyTemplateRendererHelperContext-key?token='${UPM_TOKEN} 2>/dev/null | grep '"enabled":false'
        
      3. Get the current status of velocity.helper module. If you get a JSON response from that, it means this module is disabled and you are affected by this bug.
        curl --user $ADMIN_USRNAME:$ADMIN_PWD ${CONFLUENCE_BASE_URL}'/rest/plugins/1.0/com.atlassian.confluence.extra.officeconnector-key/modules/velocity.helper-key?token='${UPM_TOKEN} 2>/dev/null | grep '"enabled":false'
        
      4. Get the current status of siteLogoHelperContext module. If you get a JSON response from that, it means this module is disabled and you are affected by this bug.
        curl --user $ADMIN_USRNAME:$ADMIN_PWD ${CONFLUENCE_BASE_URL}'/rest/plugins/1.0/com.atlassian.confluence.plugins.confluence-lookandfeel-key/modules/siteLogoHelperContext-key?token='${UPM_TOKEN} 2>/dev/null | grep '"enabled":false'
        

      Using the UPM REST API to re-enable the affected module

      1. Get UPM token to be used on the next steps – it will be saved as an environment variable.
        CONFLUENCE_BASE_URL=<Confluence Base URL>
        ADMIN_USRNAME=<local admin account username>
        ADMIN_PWD=<local admin account password>
        
        UPM_TOKEN=$(curl -I --user ${ADMIN_USRNAME}:${ADMIN_PWD} -H 'Accept: application/vnd.atl.plugins.installed+json' ${CONFLUENCE_BASE_URL}'/rest/plugins/1.0/?os_authType=basic' 2>/dev/null | grep 'upm-token' | cut -d " " -f 2 | tr -d '\r')
        
      2. Get the current status of the soyTemplateRendererHelperContext module and save it in an environment variable, using sed to change the status to enabled ("enabled":false).
        MODIFIED_JSON_OUTPUT=$(curl --user ${ADMIN_USRNAME}:${ADMIN_PWD} ${CONFLUENCE_BASE_URL}'/rest/plugins/1.0/com.atlassian.confluence.plugins.soy-key/modules/soyTemplateRendererHelperContext-key?token='${UPM_TOKEN} 2>/dev/null | sed 's/"enabled":false/"enabled":true/')
        echo ${MODIFIED_JSON_OUTPUT}
        
      3. Update the soyTemplateRendererHelperContext module status.
        curl --user ${ADMIN_USRNAME}:${ADMIN_PWD} -H 'Content-Type: application/vnd.atl.plugins.plugin.module+json' -X PUT ${CONFLUENCE_BASE_URL}'/rest/plugins/1.0/com.atlassian.confluence.plugins.soy-key/modules/soyTemplateRendererHelperContext-key?token='${UPM_TOKEN} --data '<manual output from ${MODIFIED_JSON_OUTPUT}>'
        
      4. Get the current status of the velocity.helper module and save it in an environment variable, using sed to change the status to enabled ("enabled":false).
        MODIFIED_JSON_OUTPUT=$(curl --user ${ADMIN_USRNAME}:${ADMIN_PWD} ${CONFLUENCE_BASE_URL}'/rest/plugins/1.0/com.atlassian.confluence.extra.officeconnector-key/modules/velocity.helper-key?token='${UPM_TOKEN} 2>/dev/null | sed 's/"enabled":false/"enabled":true/')
        echo ${MODIFIED_JSON_OUTPUT}
        
      5. Update the velocity.helper module status.
        curl --user ${ADMIN_USRNAME}:${ADMIN_PWD} -H 'Content-Type: application/vnd.atl.plugins.plugin.module+json' -X PUT ${CONFLUENCE_BASE_URL}'/rest/plugins/1.0/com.atlassian.confluence.extra.officeconnector-key/modules/velocity.helper-key?token='${UPM_TOKEN} --data '<manual output from ${MODIFIED_JSON_OUTPUT}>'
        
      6. Get the current status of the siteLogoHelperContext module and save it in an environment variable, using sed to change the status to enabled ("enabled":false).
        MODIFIED_JSON_OUTPUT=$(curl --user ${ADMIN_USRNAME}:${ADMIN_PWD} ${CONFLUENCE_BASE_URL}'/rest/plugins/1.0/com.atlassian.confluence.plugins.confluence-lookandfeel-key/modules/siteLogoHelperContext-key?token='${UPM_TOKEN} 2>/dev/null | sed 's/"enabled":false/"enabled":true/')
        echo ${MODIFIED_JSON_OUTPUT}
        
      7. Update the siteLogoHelperContext module status.
        curl --user ${ADMIN_USRNAME}:${ADMIN_PWD} -H 'Content-Type: application/vnd.atl.plugins.plugin.module+json' -X PUT ${CONFLUENCE_BASE_URL}'/rest/plugins/1.0/com.atlassian.confluence.plugins.confluence-lookandfeel-key/modules/siteLogoHelperContext-key?token='${UPM_TOKEN} --data '<manual output from ${MODIFIED_JSON_OUTPUT}>'
        
      8. Refresh the Confluence page and confirm the top bar is now accessible.


      If you were unable to run this workaround, don't hesitate to open a support request.

          Form Name

            [CONFSERVER-22390] Plugin's velocity module is disabled by Confluence

            nojansen added a comment -

            We had this issue today on Confluence 7.4.4.

            We resolved it by doing the following:

            nojansen added a comment - We had this issue today on Confluence 7.4.4. We resolved it by doing the following: Navigating to  Manage Apps Manually checking which User Installed apps had a Velocity Module disabled and enabling it Manually checking the  System Installed apps  to see which velocity modules were disabled. In our case it was just one case for the Confluence Soy Template Support App and the module Confluence Soy Template Renderer for Velocity. Enabled the System Installed modules by following the instructions on https://confluence.atlassian.com/confkb/cannot-enable-or-disable-bundled-system-apps-or-modules-1035241968.html  

            A fix for this issue is available to Server and Data Center customers in Confluence 7.6.3
            Upgrade now or check out the Release Notes to see what other issues are resolved.

            Hasnae (Inactive) added a comment - A fix for this issue is available to Server and Data Center customers in Confluence 7.6.3 Upgrade now or check out the Release Notes to see what other issues are resolved.

            A fix for this issue is available to Server and Data Center customers in Confluence 7.4.7
            Upgrade now or check out the Release Notes to see what other issues are resolved.

            If you're running the Confluence 7.4 Enterprise release, a fix for this issue is now available in Confluence 7.4.7, which you can find in the Download Archives.

            Hasnae (Inactive) added a comment - A fix for this issue is available to Server and Data Center customers in Confluence 7.4.7 Upgrade now or check out the Release Notes to see what other issues are resolved. If you're running the Confluence 7.4 Enterprise release, a fix for this issue is now available in Confluence 7.4.7, which you can find in the Download Archives .

            eeas_bekl added a comment -

            Hi, 

             

            i have tried the fix, got java exceptions. Is there another way to resolve this issue? I have tried several confluence versions, but still no success. 

            Currently i am on 7.4.1 which was my backup where it was working. But now it seems to happen there as well. 

             

             

            eeas_bekl added a comment - Hi,    i have tried the fix, got java exceptions. Is there another way to resolve this issue? I have tried several confluence versions, but still no success.  Currently i am on 7.4.1 which was my backup where it was working. But now it seems to happen there as well.     

            Marina added a comment -

            Hi @Richard Atkins,

            is there a release date for version 7.4.7 available? It is not in LTS release list yet:

            https://confluence.atlassian.com/doc/confluence-7-4-release-notes-994312218.html#Confluence7.4ReleaseNotes-issuesResolvedissues

            Marina added a comment - Hi @Richard Atkins, is there a release date for version 7.4.7 available? It is not in LTS release list yet: https://confluence.atlassian.com/doc/confluence-7-4-release-notes-994312218.html#Confluence7.4ReleaseNotes-issuesResolvedissues

            A fix for this issue is available to Server and Data Center customers in Confluence 7.10.1
            Upgrade now or check out the Release Notes to see what other issues are resolved.

            Hasnae (Inactive) added a comment - A fix for this issue is available to Server and Data Center customers in Confluence 7.10.1 Upgrade now or check out the Release Notes to see what other issues are resolved.

            Any expected date for this fix to be backported to 7.4.x LTS release?

            Abhijit Das added a comment - Any expected date for this fix to be backported to 7.4.x LTS release?

            Alex K added a comment -

            A fix for this issue is available to Server and Data Center customers in Confluence 7.9.0
            Upgrade now or check out the Release Notes to see what other issues are resolved.

            Alex K added a comment - A fix for this issue is available to Server and Data Center customers in Confluence 7.9.0 Upgrade now or check out the Release Notes to see what other issues are resolved.

            Hi All,

            Thanks for all your feedback after we have closed this bug. I want to apologise again for all the pain it has caused you and your organisation. I want to assure you all that yes, this is a high priority bug that we do plan to backport to 7.4. As with all backported bugfixes, we aim to soak the change on the most recent version before we backport. The goal of soaking is to 100% verify that there are no negative flow-on impacts. For this reason, you can expect this fix to make it to 7.4 over the coming months. We will update the fix version of this bug once that happens. So keep an eye on this for details on when this change is shipped.

            Regards,

            Matthew

            Product Manager | Confluence Server & DC

            Matthew Saxby (Inactive) added a comment - Hi All, Thanks for all your feedback after we have closed this bug. I want to apologise again for all the pain it has caused you and your organisation. I want to assure you all that yes, this is a high priority bug that we do plan to backport to 7.4. As with all backported bugfixes, we aim to soak the change on the most recent version before we backport. The goal of soaking is to 100% verify that there are no negative flow-on impacts. For this reason, you can expect this fix to make it to 7.4 over the coming months. We will update the fix version of this bug once that happens. So keep an eye on this for details on when this change is shipped. Regards, Matthew Product Manager | Confluence Server & DC

            Marina added a comment - - edited

            Dear Atlassian support, could you please reply, if the issue will be tackled on 7.4 LTS release? My concern is this bug is already in close state and most probably won't be touched again! Therefore, i'd suggest to create a new bug asap. Looking forward to your reply! Thanks.

            Marina added a comment - - edited Dear Atlassian support, could you please reply, if the issue will be tackled on 7.4 LTS release? My concern is this bug is already in  close state and most probably won't be touched again ! Therefore, i'd suggest to create a new bug asap. Looking forward to your reply! Thanks.

              richatkins Richard Atkins
              7c60ab039b09 Scott Dudley [Inactive]
              Affected customers:
              24 This affects my team
              Watchers:
              69 Start watching this issue

                Created:
                Updated:
                Resolved: