Uploaded image for project: 'Jira Server and Data Center'
  1. Jira Server and Data Center
  2. JRASERVER-27438

JIRA fails to start if it can't delete the Felix OSGI cache

    XMLWordPrintable

Details

    Description

      Summary

      If the plugin system gets an exception while trying to delete the Felix OSGI cache, JIRA gets locked and is unusable.

      There are two known causes for this issue:

      • The inconsistency of OSGI plugin caches triggered from inappropriate shutdown of Tomcat.
      • The Tomcat user does not have the correct permissions to access the directory.

      Steps to Reproduce

      1. Start up JIRA.
      2. Stop it.
      3. Change the permissions on the $JIRA_HOME\plugins\.osgi-plugins directory such that the user JIRA runs as is unable to read them (or do something else to mess with the directory so it throws an exception on startup).
      4. Start JIRA.

      Expected Results

      JIRA is able to clear out the directory and start up.

      Actual Results

      JIRA will throw an exception on startup and fails to start:

      2012-02-03 13:48:59,029 main FATAL      [atlassian.jira.upgrade.PluginSystemLauncher] A fatal error occured during initialisation. JIRA has been locked.
      com.atlassian.plugin.osgi.container.OsgiContainerException: Unable to clean the cache directory: C:\Program Files\Atlassian\Application Data\JIRA\plugins\.osgi-plugins\felix
      	at com.atlassian.plugin.osgi.container.impl.DefaultOsgiPersistentCache.validate(DefaultOsgiPersistentCache.java:91)
      	at com.atlassian.plugin.osgi.container.impl.DefaultOsgiPersistentCache.<init>(DefaultOsgiPersistentCache.java:37)
      	at com.atlassian.jira.plugin.PluginPath$JiraHomeAdapter.<init>(PluginPath.java:71)
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(.osgi-pluginsNative Method)
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
      	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
      	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
      	at org.picocontainer.defaults.InstantiatingComponentAdapter.newInstance(InstantiatingComponentAdapter.java:100)
      	at org.picocontainer.defaults.ConstructorInjectionComponentAdapter.instantiateComponent(ConstructorInjectionComponentAdapter.java:200)
      	at org.picocontainer.defaults.InstantiatingComponentAdapter.getComponentInstance(InstantiatingComponentAdapter.java:48)
      	at org.picocontainer.defaults.DecoratingComponentAdapter.getComponentInstance(DecoratingComponentAdapter.java:42)
      	at org.picocontainer.defaults.SynchronizedComponentAdapter.getComponentInstance(SynchronizedComponentAdapter.java:35)
      	at org.picocontainer.defaults.DecoratingComponentAdapter.getComponentInstance(DecoratingComponentAdapter.java:42)
      	at com.atlassian.jira.config.component.ProfilingComponentAdapter.getComponentInstance(ProfilingComponentAdapter.java:45)
      	at org.picocontainer.defaults.ConstructorInjectionComponentAdapter.getConstructorArguments(ConstructorInjectionComponentAdapter.java:222)
      	at org.picocontainer.defaults.ConstructorInjectionComponentAdapter.instantiateComponent(ConstructorInjectionComponentAdapter.java:198)
      	at org.picocontainer.defaults.InstantiatingComponentAdapter.getComponentInstance(InstantiatingComponentAdapter.java:48)
      	at org.picocontainer.defaults.DecoratingComponentAdapter.getComponentInstance(DecoratingComponentAdapter.java:42)
      	at org.picocontainer.defaults.SynchronizedComponentAdapter.getComponentInstance(SynchronizedComponentAdapter.java:35)
      	at org.picocontainer.defaults.DecoratingComponentAdapter.getComponentInstance(DecoratingComponentAdapter.java:42)
      	at com.atlassian.jira.config.component.ProfilingComponentAdapter.getComponentInstance(ProfilingComponentAdapter.java:45)
      	at org.picocontainer.defaults.ConstructorInjectionComponentAdapter.getConstructorArguments(ConstructorInjectionComponentAdapter.java:222)
      	at org.picocontainer.defaults.ConstructorInjectionComponentAdapter.instantiateComponent(ConstructorInjectionComponentAdapter.java:198)
      	at org.picocontainer.defaults.InstantiatingComponentAdapter.getComponentInstance(InstantiatingComponentAdapter.java:48)
      	at org.picocontainer.defaults.DecoratingComponentAdapter.getComponentInstance(DecoratingComponentAdapter.java:42)
      	at org.picocontainer.defaults.SynchronizedComponentAdapter.getComponentInstance(SynchronizedComponentAdapter.java:35)
      	at org.picocontainer.defaults.DecoratingComponentAdapter.getComponentInstance(DecoratingComponentAdapter.java:42)
      	at com.atlassian.jira.config.component.ProfilingComponentAdapter.getComponentInstance(ProfilingComponentAdapter.java:45)
      	at org.picocontainer.defaults.ConstructorInjectionComponentAdapter.getConstructorArguments(ConstructorInjectionComponentAdapter.java:222)
      	at org.picocontainer.defaults.ConstructorInjectionComponentAdapter.instantiateComponent(ConstructorInjectionComponentAdapter.java:198)
      	at org.picocontainer.defaults.InstantiatingComponentAdapter.getComponentInstance(InstantiatingComponentAdapter.java:48)
      	at org.picocontainer.defaults.DecoratingComponentAdapter.getComponentInstance(DecoratingComponentAdapter.java:42)
      	at org.picocontainer.defaults.SynchronizedComponentAdapter.getComponentInstance(SynchronizedComponentAdapter.java:35)
      	at org.picocontainer.defaults.DecoratingComponentAdapter.getComponentInstance(DecoratingComponentAdapter.java:42)
      	at com.atlassian.jira.config.component.ProfilingComponentAdapter.getComponentInstance(ProfilingComponentAdapter.java:45)
      	at org.picocontainer.defaults.DefaultPicoContainer.getComponentInstance(DefaultPicoContainer.java:298)
      	at com.atlassian.jira.ComponentManager.getComponent(ComponentManager.java:534)
      	at com.atlassian.jira.ComponentManager.getComponentInstanceOfType(ComponentManager.java:500)
      	at com.atlassian.jira.ComponentManager$PluginSystem.getPluginSystemLifecycle(ComponentManager.java:660)
      	at com.atlassian.jira.ComponentManager$PluginSystem.start(ComponentManager.java:670)
      	at com.atlassian.jira.ComponentManager.startPluginSystem(ComponentManager.java:242)
      	at com.atlassian.jira.ComponentManager.quickStart(ComponentManager.java:235)
      	at com.atlassian.jira.ComponentManager.start(ComponentManager.java:220)
      	at com.atlassian.jira.upgrade.PluginSystemLauncher.start(PluginSystemLauncher.java:23)
      	at com.atlassian.jira.startup.DefaultJiraLauncher$3.run(DefaultJiraLauncher.java:101)
      	at com.atlassian.jira.config.database.DatabaseConfigurationManagerImpl.doNowOrEnqueue(DatabaseConfigurationManagerImpl.java:250)
      	at com.atlassian.jira.config.database.DatabaseConfigurationManagerImpl.doNowOrWhenDatabaseActivated(DatabaseConfigurationManagerImpl.java:149)
      	at com.atlassian.jira.startup.DefaultJiraLauncher.postDbLaunch(DefaultJiraLauncher.java:94)
      	at com.atlassian.jira.startup.DefaultJiraLauncher.access$100(DefaultJiraLauncher.java:24)
      	at com.atlassian.jira.startup.DefaultJiraLauncher$1.run(DefaultJiraLauncher.java:61)
      	at com.atlassian.jira.util.devspeed.JiraDevSpeedTimer.run(JiraDevSpeedTimer.java:33)
      	at com.atlassian.jira.startup.DefaultJiraLauncher.start(DefaultJiraLauncher.java:56)
      	at com.atlassian.jira.startup.LauncherContextListener$1.create(LauncherContextListener.java:68)
      	at com.atlassian.jira.startup.LauncherContextListener$1.create(LauncherContextListener.java:63)
      	at com.atlassian.multitenant.impl.MultiTenantComponentMapImpl.get(MultiTenantComponentMapImpl.java:121)
      	at com.atlassian.multitenant.impl.MultiTenantComponentMapImpl.onTenantStart(MultiTenantComponentMapImpl.java:165)
      	at com.atlassian.multitenant.impl.DefaultMultiTenantManager$1.consume(DefaultMultiTenantManager.java:134)
      	at com.atlassian.multitenant.impl.DefaultMultiTenantManager$1.consume(DefaultMultiTenantManager.java:131)
      	at com.atlassian.multitenant.impl.DefaultMultiTenantManager.runForEachListener(DefaultMultiTenantManager.java:256)
      	at com.atlassian.multitenant.impl.DefaultMultiTenantManager.startTenant(DefaultMultiTenantManager.java:130)
      	at com.atlassian.multitenant.impl.DefaultMultiTenantManager.startAll(DefaultMultiTenantManager.java:203)
      	at com.atlassian.jira.startup.LauncherContextListener.contextInitialized(LauncherContextListener.java:96)
      	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4205)
      	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4704)
      	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
      	at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
      	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
      	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
      	at org.apache.catalina.core.StandardService.start(StandardService.java:525)
      	at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
      	at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
      	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
      Caused by: java.io.IOException: Unable to delete directory C:\Program Files\Atlassian\Application Data\JIRA\plugins\.osgi-plugins\felix\felix-cache\bundle48\version0.0\bundle.jar-embedded\META-INF.
      	at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:981)
      	at org.apache.commons.io.FileUtils.forceDelete(FileUtils.java:1381)
      	at org.apache.commons.io.FileUtils.cleanDirectory(FileUtils.java:1044)
      	at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:977)
      	at org.apache.commons.io.FileUtils.forceDelete(FileUtils.java:1381)
      	at org.apache.commons.io.FileUtils.cleanDirectory(FileUtils.java:1044)
      	at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:977)
      	at org.apache.commons.io.FileUtils.forceDelete(FileUtils.java:1381)
      	at org.apache.commons.io.FileUtils.cleanDirectory(FileUtils.java:1044)
      	at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:977)
      	at org.apache.commons.io.FileUtils.forceDelete(FileUtils.java:1381)
      	at org.apache.commons.io.FileUtils.cleanDirectory(FileUtils.java:1044)
      	at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:977)
      	at org.apache.commons.io.FileUtils.forceDelete(FileUtils.java:1381)
      	at org.apache.commons.io.FileUtils.cleanDirectory(FileUtils.java:1044)
      	at com.atlassian.plugin.osgi.container.impl.DefaultOsgiPersistentCache.validate(DefaultOsgiPersistentCache.java:87)
      	... 76 more
      

      Workaround

      1. Stop JIRA.
      2. Remove the folder specified within the UI, for example:
        $JIRA_HOME/plugins/.osgi-plugins/felix/

        This will be rebuilt upon JIRA startup.

      3. Ensure that the Tomcat user has the correct permissions, as in our Actions in Jira server fails with FileNotFoundException in the Jira logs KB article.
      4. Start JIRA.
      5. Normally this is a one-time error. If it repeats, see Jira server does not terminate after executing shutdown script.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ohernandez@atlassian.com Oswaldo Hernandez (Inactive)
              Votes:
              111 Vote for this issue
              Watchers:
              91 Start watching this issue

              Dates

                Created:
                Updated: