-
Bug
-
Resolution: Fixed
-
Highest
-
3.5.2, 5.5, 7.0.1, 7.1.1, 7.2.0, 7.3.1, 7.3.5, 7.4.0, 7.4.1, 7.4.4, 7.6.2, 7.7.3
-
44
-
Severity 2 - Major
-
378
-
- 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:
- Using Documentation Theme, the Left-Side Navigation Bar is Blank and the Page Tree is Missing
- Unable to edit in Office and edit in Word, 404 on <confluence-path>/${officeVelocityHelper.getWebDavUrl($attachment)}
- Comment Box Disappears: $soyTemplateRendererHelper.getRenderedTemplateHtml
- Browser Title Shows $docThemeHelper Instead of The Page Title
- Missing buttons or the entire top bar with "$soyTemplateRendererHelper.getRenderedTemplateHtml" error message
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
- 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')
- 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'
- 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'
- 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
- 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')
- 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}
- 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}>'
- 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}
- 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}>'
- 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}
- 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}>'
- 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.
- causes
-
CONFSERVER-18963 Documentation theme tree vanished when upgrading to 3.2-beta2
- Closed
- is related to
-
CONFSERVER-60184 As a Confluence Administrator I should be able to enable a System App (or a module) from the UPM UI if it is currently disabled
- Gathering Interest
-
PSR-500 Loading...
- is blocked by
-
PS-75901 Loading...
- Mentioned in
- mentioned in
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
- relates to
-
PS-65872 Loading...
-
PS-65949 Loading...
-
PSR-484 Loading...
-
UPM-6095 Loading...
-
BSP-1699 Loading...