Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-26180

NPE on XML backup restore from admin interface

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Low
    • 5.0.7
    • 4.4.3
    • None

    Description

      It looks like CE can return null for application that isn't handled by us.
      CrowdDirectoryServiceImpl

          private void storeLdapConnectionPoolConfiguration(Application application)
          {
              Map<String, String> attributes = application.getAttributes();
              ConnectionPoolProperties connectionPoolConfiguration = DefaultConnectionPoolProperties.fromPropertiesMap(attributes);
              Map<String, String> propertiesMap = connectionPoolConfiguration.toPropertiesMap();
              for (Map.Entry<String, String> entry : propertiesMap.entrySet())
              {
                  if (entry.getValue() != null) // ignore property if value is null; values set by JVM or on command line (-D...) will take precedence
                  {
                      logger.debug("Setting system-wide LDAP connection pool property: <" + entry.getKey() + "> with value: <" + entry.getValue() + ">");
                      System.setProperty(entry.getKey(), entry.getValue());
                  }
              }
          }
      

      CrowdEmbeddedApplicationFactory can return null:

          public Application getApplication()
          {
              try
              {
                  final Application application = applicationDao.findByName(APPLICATION_NAME);
                  return application;
              }
              catch (ApplicationNotFoundException e)
              {
                  // This should only happen during initial system setup.
                  // The embedding application should always provide an application once fully set up.
                  log.debug("Crowd application : " + APPLICATION_NAME + " not found.");
                  return null;
              }
          }
      
      java.lang.NullPointerException
      at com.atlassian.crowd.embedded.core.CrowdDirectoryServiceImpl.storeLdapConnectionPoolConfiguration(CrowdDirectoryServiceImpl.java:308)
      at com.atlassian.crowd.embedded.core.CrowdDirectoryServiceImpl.initialiseConnectionPoolSystemProperties(CrowdDirectoryServiceImpl.java:291)
      at com.atlassian.crowd.embedded.core.CrowdDirectoryServiceImpl.getApplication(CrowdDirectoryServiceImpl.java:263)
      at com.atlassian.crowd.embedded.core.CrowdDirectoryServiceImpl.findAllDirectories(CrowdDirectoryServiceImpl.java:81)
      at com.atlassian.jira.user.util.DefaultUserManager.getWritableDirectories(DefaultUserManager.java:256)
      at com.atlassian.jira.user.util.DefaultUserManager.hasPasswordWritableDirectory(DefaultUserManager.java:272)
      at com.atlassian.jira.bc.security.login.LoginServiceImpl.getLoginProperties(LoginServiceImpl.java:92)
      at com.atlassian.jira.bc.security.login.LoginServiceImpl.getLoginProperties(LoginServiceImpl.java:108)
      at com.atlassian.jira.web.action.Dashboard.buildLoginProperties(Dashboard.java:212)
      at com.atlassian.jira.web.action.Dashboard.getCurrentDashboardState(Dashboard.java:199)
      at com.atlassian.jira.web.action.Dashboard.doValidation(Dashboard.java:116)
      at webwork.action.ActionSupport.validate(ActionSupport.java:391)
      at webwork.action.ActionSupport.execute(ActionSupport.java:162)
      at com.atlassian.jira.action.JiraActionSupport.execute(JiraActionSupport.java:76)
      at webwork.interceptor.DefaultInterceptorChain.proceed(DefaultInterceptorChain.java:39)
      at webwork.interceptor.NestedInterceptorChain.proceed(NestedInterceptorChain.java:31)
      at webwork.interceptor.ChainedInterceptor.intercept(ChainedInterceptor.java:16)
      at webwork.interceptor.DefaultInterceptorChain.proceed(DefaultInterceptorChain.java:35)
      ...
      

      Workaround:

      1. Connect JIRA to an empty database.
      2. Restore XML backup from the Setup page.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              bdziedzic Bogdan Dziedzic [Atlassian]
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: