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

Application Access does not display for JIRA instances running MySQL

    XMLWordPrintable

Details

    Description

      Summary

      Application Access page throws an "Internal Server Error" while using MySQL

      Steps to Reproduce

      1. Access Administration > Applications > Application Access

      Environment

      • MySQL database

      Expected Results

      Application Access page is displayed successfully

      Actual Results

      Internal Server Error is thrown on screen
      The below exception is thrown in the atlassian-jira.log file:

      2016-02-12 14:39:07,602 http-nio-8710-exec-13 ERROR admin 879x275x2 2tm0gm 192.168.10.176 /rest/api/2/group [c.a.j.rest.exception.ExceptionInterceptor] Returning internal server error in response
      java.lang.reflect.InvocationTargetException
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:483)
      	at com.atlassian.plugins.rest.common.interceptor.impl.DispatchProviderHelper$ResponseOutInvoker$1.invoke(DispatchProviderHelper.java:192)
      	... 4 filtered
      	at com.atlassian.jira.rest.exception.ExceptionInterceptor.intercept(ExceptionInterceptor.java:55)
      	... 1 filtered
      	at com.atlassian.jira.rest.v2.issue.scope.RequestScopeInterceptor.intercept(RequestScopeInterceptor.java:39)
      	... 14 filtered
      	at com.atlassian.plugins.rest.module.RestDelegatingServletFilter$JerseyOsgiServletContainer.doFilter(RestDelegatingServletFilter.java:154)
      	... 1 filtered
      	at com.atlassian.plugins.rest.module.RestDelegatingServletFilter.doFilter(RestDelegatingServletFilter.java:68)
      	... 86 filtered
      	at com.atlassian.jira.security.JiraSecurityFilter.doFilter(JiraSecurityFilter.java:70)
      	... 15 filtered
      	at com.atlassian.plugins.rest.module.servlet.RestSeraphFilter.doFilter(RestSeraphFilter.java:37)
      	... 74 filtered
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      	at java.lang.Thread.run(Thread.java:745)
      Caused by: com.querydsl.core.QueryException: Caught MySQLSyntaxErrorException for select count(*)
      from (select m.lower_child_name
      from cwd_membership m
      inner join cwd_user u
      on u.id = m.child_id
      where u.active = ? and m.membership_type = ? and m.directory_id = ? and m.lower_parent_name = ?
      	at com.querydsl.sql.DefaultSQLExceptionTranslator.translate(DefaultSQLExceptionTranslator.java:50)
      	at com.querydsl.sql.Configuration.translate(Configuration.java:453)
      	at com.querydsl.sql.AbstractSQLQuery.unsafeCount(AbstractSQLQuery.java:627)
      	at com.querydsl.sql.AbstractSQLQuery.fetchCount(AbstractSQLQuery.java:132)
      	at com.atlassian.jira.security.groups.CountUsersInGroupQueryCallback.runMySqlQuery(CountUsersInGroupQueryCallback.java:148)
      	at com.atlassian.jira.security.groups.CountUsersInGroupQueryCallback.runQuery(CountUsersInGroupQueryCallback.java:74)
      	at com.atlassian.jira.security.groups.CountUsersInGroupQueryCallback.runQuery(CountUsersInGroupQueryCallback.java:23)
      	at com.atlassian.jira.database.DbConnectionManagerImpl.executeQuery(DbConnectionManagerImpl.java:45)
      	at com.atlassian.jira.security.groups.DefaultGroupManager.getUsersInGroupCount(DefaultGroupManager.java:218)
      	at com.atlassian.jira.security.groups.DefaultGroupManager.getUsersInGroupCount(DefaultGroupManager.java:197)
      	at com.atlassian.jira.security.groups.RequestCachingGroupManager.getUsersInGroupCount(RequestCachingGroupManager.java:138)
      	... 3 filtered
      	at java.lang.reflect.Method.invoke(Method.java:483)
      	at com.atlassian.plugin.util.ContextClassLoaderSettingInvocationHandler.invoke(ContextClassLoaderSettingInvocationHandler.java:26)
      	at com.sun.proxy.$Proxy442.getUsersInGroupCount(Unknown Source)
      	... 3 filtered
      	at java.lang.reflect.Method.invoke(Method.java:483)
      	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
      	at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:56)
      	at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:60)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
      	at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133)
      	at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
      	at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:70)
      	at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:53)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
      	at org.eclipse.gemini.blueprint.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:57)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
      	at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133)
      	at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
      	at com.sun.proxy.$Proxy4631.getUsersInGroupCount(Unknown Source)
      	at com.atlassian.jira.rest.v2.issue.GroupResource.buildGroupBean(GroupResource.java:418)
      	at com.atlassian.jira.rest.v2.issue.GroupResource.getGroup(GroupResource.java:121)
      	... 210 more
      Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Every derived table must have its own alias
      	at sun.reflect.GeneratedConstructorAccessor177.newInstance(Unknown Source)
      	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      	at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
      	at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
      	at com.mysql.jdbc.Util.getInstance(Util.java:386)
      	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4187)
      	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4119)
      	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2570)
      	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2731)
      	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2815)
      	at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2155)
      	at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2322)
      	at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:83)
      	at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:83)
      	at com.querydsl.sql.AbstractSQLQuery.unsafeCount(AbstractSQLQuery.java:616)
      	... 247 more
      

      Workarounds

      To Avoid this issue, you can:

      1. Migrate to an alternative Database such as Postgres as per out documentation.
      2. Downgrade the JIRA Instance (detailed below)
      3. Follow the steps below to control the inaccessible functionality.

      To workaround this bug with using the REST API:

      To simply get information about the application Roles using the REST API:

      1. Log into JIRA
      2. Access: <BASE-URL>/rest/api/2/applicationrole, which will return a JSON Response with details of the JIRA Application Users.

      To Add or Remove a Group to a License Role

      1. Use a REST Client to call the following as per the REST API - Update Application Role:
        <base-url>/rest/api/2/applicationrole/{key}
        

      To Downgrade your JIRA instance to JIRA 7.0.10

      1. Make a full backup of your environment as in: Backing up data
      2. Ensure JIRA 7.1.0 instance is shutdown.
      3. Install JIRA 7.0.10 into this environment, but not into the same JIRA Install as your 7.1.0 as this will not work.
      4. Shutdown the JIRA 7.0.10 instance once it has started.
      5. Any customisations and data that you have in your JIRA 7.1.0 environment should be migrated to ensure that your JIRA 7.0.10 has these configurations.
        1. Copy over any configuration changes that you have made as per our Upgrading JIRA applications with a fallback method.
        2. Copy over Avatars and attachments to your new instance as in Upgrading JIRA applications with a fallback method.
        3. Migrate any installed-plugins that you would like to install into this JIRA 7.0.10 environment. Note: do not migrate the plugins from your 7.1.0 environment, as this will contain 7.1.0 Add-ons that you should not include.
      6. Set the flag -Djira.downgrade.allowed=true as per: Setting properties and options on startup
      7. Start JIRA 7.0.10
      8. When asked for connection information to the database, point to the 7.1.0 JIRA database (if you did not copy the dbconfig.xml file when copying configuration files.)
      9. The instance should now start and downgrade the JIRA database data. The JIRA version should be reported as 7.0.10.

      Attachments

        Issue Links

          Activity

            People

              ohernandez@atlassian.com Oswaldo Hernandez (Inactive)
              malmeida Marcus Silveira
              Votes:
              41 Vote for this issue
              Watchers:
              69 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: