Uploaded image for project: 'FishEye'
  1. FishEye
  2. FE-3896

FishEye wrongly removes admin privileges for a Crowd group when Crowd is not up when FishEye is starting up

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Medium
    • 2.7.9
    • 2.7.8
    • None

    Description

      When DefaultUserManager is being instantiated by Spring, the constructor calls upgradeData(), which calls removeDeletedAdminGroups().

      removeDeletedAdminGroups() calls getExternalGroupNames(), which calls listGroupNames() to retrieve all the groups defined in Crowd if it's configured to use Crowd.

      This method calls the listGroupNames method on CrowdAuth. If Crowd is not up at that time, the CrowdClient throws an InvalidCrowdServiceException, which is rethrown as an AuthenticationException.

      listGroupNames method on DefaultUserManager swallows any exception thrown by CrowdAuth (though it logs it as an error) and return an empty list.

      Unfortunately, removeDeletedAdminGroups() method then assumes that there is no groups defined in Crowd and removes admin privileges for all groups that are not defined internally by FishEye.

      The following is the stack trace of the swallowed exception:

      2012-01-05 16:18:05,780 ERROR [main ] fisheye.app DefaultUserManager-listGroupNames - Could not list groups for crowd
      com.cenqua.fisheye.user.AuthenticationException: Problem communicating with Crowd
              at com.cenqua.fisheye.user.crowd.CrowdAuth.listGroupNames(CrowdAuth.java:405)
              at com.cenqua.fisheye.user.DefaultUserManager.listGroupNames(DefaultUserManager.java:1110)
              at com.cenqua.fisheye.user.DefaultUserManager.getExternalGroupNames(DefaultUserManager.java:1102)
              at com.cenqua.fisheye.user.DefaultUserManager$3.read(DefaultUserManager.java:209)
              at com.cenqua.fisheye.user.DefaultUserManager$3.read(DefaultUserManager.java:205)
              at com.cenqua.fisheye.config.DB0Handle$1.read(DB0Handle.java:114)
              at com.cenqua.fisheye.config.DB0Handle.read(DB0Handle.java:81)
              at com.cenqua.fisheye.config.DB0Handle.read(DB0Handle.java:112)
              at com.cenqua.fisheye.user.DefaultUserManager.removeDeletedAdminGroups(DefaultUserManager.java:205)
              at com.cenqua.fisheye.user.DefaultUserManager.upgradeData(DefaultUserManager.java:157)
              at com.cenqua.fisheye.user.DefaultUserManager.<init>(DefaultUserManager.java:144)
              at com.cenqua.fisheye.user.DefaultUserManager.<init>(DefaultUserManager.java:124)
              at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native 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.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:126)
              at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:108)
              at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:280)
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1003)
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:907)
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
              at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
              at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
              at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
              at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
              at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:844)
              at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:786)
              at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:703)
              at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:795)
              at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:723)
              at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:196)
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1003)
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:907)
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
              at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
              at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
              at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
              at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
              at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)
              at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
              at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
              at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
              at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
              at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
              at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:549)        
              at org.mortbay.jetty.servlet.Context.startContext(Context.java:136)
              at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1282)
              at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:518)
              at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:499)
              at com.cenqua.fisheye.web.jetty.FishEyeWebApplicationContext.doStart(FishEyeWebApplicationContext.java:27)
              at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
              at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152)
              at org.mortbay.jetty.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:156)
              at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
              at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152)
              at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
              at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
              at org.mortbay.jetty.Server.doStart(Server.java:224)
              at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
              at com.cenqua.fisheye.web.WebServer.start(WebServer.java:276)
              at com.cenqua.fisheye.ctl.Run.mainImpl(Run.java:228)
              at com.cenqua.fisheye.ctl.Run.main(Run.java:77)
              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 com.cenqua.fisheye.FishEyeCtl.mainImpl(FishEyeCtl.java:98)
              at com.cenqua.fisheye.FishEyeCtl.main(FishEyeCtl.java:41)
      Caused by: com.atlassian.crowd.exception.InvalidCrowdServiceException: The following URL does not specify a valid Crowd User Management REST service: http://awei.jira-dev.com/crowd/rest/usermanagement/1/search?entity-type=group&start-index=0&max-results=-1
              at com.atlassian.crowd.integration.rest.service.RestExecutor$MethodExecutor.executeCrowdServiceMethod(RestExecutor.java:443)
              at com.atlassian.crowd.integration.rest.service.RestExecutor$MethodExecutor.andReceive(RestExecutor.java:295)
              at com.atlassian.crowd.integration.rest.service.RestCrowdClient.searchGroupNames(RestCrowdClient.java:513)
              at com.cenqua.fisheye.user.crowd.CrowdAuth$5.call(CrowdAuth.java:400)
              at com.cenqua.fisheye.user.crowd.CrowdAuth$5.call(CrowdAuth.java:398)
              at com.cenqua.fisheye.user.crowd.CrowdAuth.withTimer(CrowdAuth.java:98)
              at com.cenqua.fisheye.user.crowd.CrowdAuth.listGroupNames(CrowdAuth.java:398)
              ... 70 more
      

      Attachments

        Activity

          People

            npellow Nick
            awei Alex Wei (DE)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: