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:

      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

      Our JIRA Does Not Start Due to 'Unable to clean the cache directory' KB instructs how to fix this.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              ohernandez@atlassian.com Oswaldo Hernandez (Inactive)
              Votes:
              93 Vote for this issue
              Watchers:
              67 Start watching this issue

                Dates

                Created:
                Updated: