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

Plugin state conflict when plugin installed at same time as plugin state is checked.

    XMLWordPrintable

Details

    Description

      The Widget Connector was disabled recently (~01/12/08) on CAC but noone knows who did it. Trawling through the logs, I found this:

      2008-11-26 18:58:59,615 WARN [TP-Processor4144] [com.atlassian.plugin.DefaultPluginManager] isPluginEnabled Plugin com.atlassian.confluence.extra.widgetconnector is out of sync with the plugin system, disabling
       -- url: /plugins/pagetree/naturalchildren.action | userName: anonymous | referer: http://confluence.atlassian.com/pages/viewpage.action?pageId=58656151
      2008-11-26 18:59:01,995 WARN [TP-Processor3849] [com.atlassian.plugin.DefaultPluginManager] isPluginEnabled Plugin com.atlassian.confluence.extra.widgetconnector is out of sync with the plugin system, disabling
       -- url: /display/DOC/Displaying+an+Image | page: 139500 | userName: anonymous | referer: http://confluence.atlassian.com/display/DOC/Attaching+Files+to+a+Page | action: viewpage
      

      There are about 100 more between 18:58:59 and 18:59:03, but no other log lines in sysout.log.

      In the access log, though, we find:

      150.101.48.40 - - [26/Nov/2008:18:58:59 -0600] "GET /plugins/pagetree/naturalchildren.action?decorator=none&excerpt=false&sort=position&reverse=false&disableLinks=false&hasRoot=true&pageId=16482400&treeId=1&startDepth=0&ancestors=58656083&ancestors=58656009&ancestors=16482400 HTTP/1.1" 200 1172 "http://con
      fluence.atlassian.com/pages/viewpage.action?pageId=58656151" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-GB; rv:1.9.0.4) Gecko/2008102920 Firefox/3.0.4" 234580
      70.102.8.226 - - [26/Nov/2008:18:59:01 -0600] "GET /display/DOC/Displaying+an+Image HTTP/1.1" 200 14848 "http://confluence.atlassian.com/display/DOC/Attaching+Files+to+a+Page" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3" 2097546
      70.102.8.226 - - [26/Nov/2008:18:59:04 -0600] "GET /s/1513/13/1.0/_/download/resources/confluence.web.resources%3Adwr/engine.js HTTP/1.1" 200 11911 "http://confluence.atlassian.com/display/DOC/Displaying+an+Image" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3" 
      28176
      203.63.130.33 - - [26/Nov/2008:18:58:58 -0600] "POST /plugins/servlet/plugin-repository/dwr/exec/RepositoryDWR.installPlugin.dwr HTTP/1.1" 200 1127 "http://confluence.atlassian.com/admin/plugin-repository/plugins.action" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-GB; rv:1.9.0.4) Gecko/2008102920 F
      irefox/3.0.4" 5506545
      203.63.130.33 - - [26/Nov/2008:18:59:04 -0600] "POST /plugins/servlet/plugin-repository/dwr/exec/RepositoryDWR.getTransferStatus.dwr HTTP/1.1" 200 182 "http://confluence.atlassian.com/admin/plugin-repository/plugins.action" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-GB; rv:1.9.0.4) Gecko/200810292
      0 Firefox/3.0.4" 107425
      

      Looks like someone (can't tell who due to zero logging in com.atlassian.plugin.repository.logic.AbstractRepositoryPluginManager.installPlugin : ) tried to install/update the widgetconnector plugin at the same time as a plugin was checked (not rendered, just checked). The check code is:

      com.atlassian.plugin.DefaultPluginManager.java
      public boolean isPluginEnabled(String key)
          {
              Plugin plugin = plugins.get(key);
      
              boolean shouldBeEnabled = plugin != null && getState().isEnabled(plugin);
      
              // Detect if the plugin state is out of sync with the plugin state store
              if (shouldBeEnabled && !plugin.isEnabled())
              {
                  log.warn("Plugin "+key+" is out of sync with the plugin system, disabling");
                  // Just changing the state in the store to prevent a stack overflow as disabling modules requires the
                  // plugin to be enabled, thus calling this method in a infinite loop.
                  disablePluginState(plugin, getStore());
                  shouldBeEnabled = false;
              }
              return shouldBeEnabled;
          }
      

      and the upgrade code is:

      com.atlassian.plugin.repository.logic.AbstractRepositoryPluginManager.java
      public final AtlassianPlugin installPlugin(File pluginFile,
                  String pluginLocation,
                  boolean suppressKeyChecks,
                  boolean suppressVersionChecks,
                  String pluginKey,
                  Version version) throws RepositoryException
          {
              try
              {
                  // Get the plugin manager
                  PluginAccessor pluginAccessor = getPluginAccessor();
                  
                  checkPluginFile(pluginFile, pluginLocation, suppressKeyChecks,suppressVersionChecks, pluginKey, version);
      
                  // Check for an existing plugin
                  Plugin existingPlugin = pluginAccessor.getPlugin(pluginKey);
                  if (existingPlugin != null && !existingPlugin.isBundledPlugin())
                  {
                      // upgradePlugin should have been called, but wasn't.  do the right thing anyways
                      return upgrade(existingPlugin, pluginFile);
                  }
                  // Install the plugin
                  return install(pluginFile, pluginKey, version);
              }
              finally
              {
                  pluginFile.delete();
              }
          }
      

      Somewhere in here is the culprit... the workaround would be to not update plugins when Confluence is being used.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              dtaylor David Taylor (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: