Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-36911

Confluence with MS SQL unable to search space for Hipchat Integration

    XMLWordPrintable

Details

    Description

      Bug Description

      Confluence installation with Microsoft SQL Server as its database unable to return any space in HipChat Integration menu. Reviewing the logs we can see the following stack trace:

      2015-03-17 17:47:12,290 DEBUG [http-bio-8110-exec-6] [net.sf.hibernate.SQL] log select top 75 space0_.SPACENAME as x0_0_, space0_.SPACEKEY as x1_0_ from SPACES space0_ where (space0_.SPACESTATUS=? )and(lower(space0_.SPACENAME)like lower(?)) order by  length(space0_.SPACENAME)asc
      2015-03-17 17:47:12,291 TRACE [http-bio-8110-exec-6] [sf.hibernate.type.StringType] nullSafeSet binding 'CURRENT' to parameter: 1
      2015-03-17 17:47:12,292 TRACE [http-bio-8110-exec-6] [sf.hibernate.type.StringType] nullSafeSet binding 'Mila%' to parameter: 2
      2015-03-17 17:47:12,375 ERROR [http-bio-8110-exec-6] [sf.hibernate.util.JDBCExceptionReporter] logExceptions 'length' is not a recognized built-in function name.
       -- referer: http://10.60.2.198:8110/plugins/servlet/hipchat/configure | url: /rest/hipchat/spacetoroom/1.0/spaces | userName: admin
      2015-03-17 17:47:12,377 ERROR [http-bio-8110-exec-6] [sf.hibernate.util.JDBCExceptionReporter] logExceptions 'length' is not a recognized built-in function name.
       -- referer: http://10.60.2.198:8110/plugins/servlet/hipchat/configure | url: /rest/hipchat/spacetoroom/1.0/spaces | userName: admin
      2015-03-17 17:47:12,380 WARN [http-bio-8110-exec-6] [hipchat.spacetoroom.service.DefaultSpacesWithAdminPermissionProvider] findSpacesMatchingName Error encountered querying space list
       -- referer: http://10.60.2.198:8110/plugins/servlet/hipchat/configure | url: /rest/hipchat/spacetoroom/1.0/spaces | userName: admin
      net.sf.hibernate.exception.SQLGrammarException: Could not execute query
      	at net.sf.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:58)
      	at net.sf.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
      	at net.sf.hibernate.impl.SessionImpl.convert(SessionImpl.java:4151)
      	at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1573)
      	at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:49)
      	at com.atlassian.confluence.plugins.hipchat.spacetoroom.service.DefaultSpacesWithAdminPermissionProvider.findSpacesMatchingName(DefaultSpacesWithAdminPermissionProvider.java:116)
      	at com.atlassian.confluence.plugins.hipchat.spacetoroom.rest.SpaceToRoomSpaceResource.getSpaces(SpaceToRoomSpaceResource.java:41)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	at com.atlassian.plugins.rest.common.interceptor.impl.DispatchProviderHelper$ResponseOutInvoker$1.invoke(DispatchProviderHelper.java:234)
      	at com.atlassian.plugins.rest.common.interceptor.impl.DispatchProviderHelper$1.intercept(DispatchProviderHelper.java:100)
      	at com.atlassian.plugins.rest.common.interceptor.impl.DefaultMethodInvocation.invoke(DefaultMethodInvocation.java:61)
      	at com.atlassian.plugins.rest.common.expand.interceptor.ExpandInterceptor.intercept(ExpandInterceptor.java:38)
      	at com.atlassian.plugins.rest.common.interceptor.impl.DefaultMethodInvocation.invoke(DefaultMethodInvocation.java:61)
      	at com.atlassian.plugins.rest.common.interceptor.impl.DispatchProviderHelper.invokeMethodWithInterceptors(DispatchProviderHelper.java:132)
      	at com.atlassian.plugins.rest.common.interceptor.impl.DispatchProviderHelper$ResponseOutInvoker._dispatch(DispatchProviderHelper.java:230)
      	at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
      	at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:288)
      	at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
      	at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
      	at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
      	at 
      ...
      Caused by: java.sql.SQLException: 'length' is not a recognized built-in function name.
      	at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:368)
      	at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2816)
      	at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2254)
      	at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:631)
      	at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:477)
      	at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery(JtdsPreparedStatement.java:777)
      	at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:76)
      	at net.sf.hibernate.impl.BatcherImpl.getResultSet(BatcherImpl.java:89)
      	at net.sf.hibernate.loader.Loader.getResultSet(Loader.java:880)
      	at net.sf.hibernate.loader.Loader.doQuery(Loader.java:273)
      	at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:138)
      	at net.sf.hibernate.loader.Loader.doList(Loader.java:1063)
      	at net.sf.hibernate.loader.Loader.list(Loader.java:1054)
      	at net.sf.hibernate.hql.QueryTranslator.list(QueryTranslator.java:854)
      	at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1570)
      	... 234 more

      This cause Confluence unable to integrate any of its space to HipChat.

      How to replicate the bug

      1. Install Confluence with MS SQL
      2. Integrate with HipChat
      3. Access "HipChat Integration" under "Confluence Administrator"
      4. Try to find any space

      Expected Behaviour

      Confluence should be able to find spaces in Confluence for HipChat to integrate with.

      Resulted Behaviour

      Confluence spinning wheel keep on spinning as can be seen in the screenshot below:

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              scahyadiputra Septa Cahyadiputra (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: