Uploaded image for project: 'Bitbucket Server'
  1. Bitbucket Server
  2. BSERV-8153

HipChat plugin connection fails with SQL Server database

    XMLWordPrintable

    Details

      Description

      Summary

      The HipChat plugin connection fails when using SQL Server database in the following scenarios:

      1. when upgrading to Bitbucket server 4.1.0 or 4.0.4
      2. when installing Bitbucket server 4.1.0 or 4.0.4

      Environment

      The issue only occurs when Bitbucket is connected to a SQL Server database

      Steps to Reproduce

      1. Install/Upgrade Bitbucket server 4.1.0 or 4.0.4
      2. Connect Bitbucket Server to SQL Server (this only applies for new installations)
      3. Install and configure the HipChat for Bitbucket Cloud integration (note: this step is valid also for a Bitbucket server installation)

      Expected Results

      The connection to HipChat is created successfully.

      Actual Results

      The below exception is thrown in the atlassian-bitbucket.log file:

      WARN  [http-nio-7990-exec-4] admin @1TDQ37Jx692x78x1 1r97yov 0:0:0:0:0:0:0:1 "POST /rest/hipchat/integration/latest/installation/complete HTTP/1.1" c.a.p.h.rest.HipChatLinkResource null
      

      Notes

      In order to confirm, that this is the exact issue you are experiencing, please proceed as follows.

      1. Enable the HipChat plugin debug log level from Bitbucket server using the REST API (as shown in first command below):
        # To set the HipChat plugin to DEBUG
        $ curl -H "Accept: application/json" -H "Content-Type: application/json" -u admin:admin -X PUT http://localhost:7990/stash/rest/api/latest/logs/logger/com.atlassian.plugins.hipchat/DEBUG
        
        # To set the HipChat plugin back to INFO
        $ curl -H "Accept: application/json" -H "Content-Type: application/json" -u admin:admin -X PUT http://localhost:7990/stash/rest/api/latest/logs/logger/com.atlassian.plugins.hipchat/INFO
        
        # To view the current log level:
        curl -H "Accept: application/json" -H "Content-Type: application/json" -u admin:admin http://localhost:7990/stash/rest/api/latest/logs/logger/com.atlassian.plugins.hipchat
        
      2. check the atlassian-bitbucket.log file for the following stacktrace
        WARN  [http-nio-7990-exec-4] admin @1TDQ37Jx692x78x1 1r97yov 0:0:0:0:0:0:0:1 "POST /rest/hipchat/integration/latest/installation/complete HTTP/1.1" c.a.p.h.rest.HipChatLinkResource null
        java.lang.reflect.UndeclaredThrowableException: null
        	at com.sun.proxy.$Proxy1382.save(Unknown Source) ~[na:na]
        	at com.atlassian.plugins.hipchat.link.DefaultHipChatAOLinkManager.saveNew(DefaultHipChatAOLinkManager.java:158) ~[base-hipchat-integration-plugin-api-7.0.3_1446198402000.jar:na]
        	at com.atlassian.activeobjects.tx.TransactionalProxy.invoke(TransactionalProxy.java:60) ~[na:na]
        	at com.atlassian.activeobjects.tx.TransactionalProxy.access$000(TransactionalProxy.java:18) ~[na:na]
        	at com.atlassian.activeobjects.tx.TransactionalProxy$1.doInTransaction(TransactionalProxy.java:49) ~[na:na]
        	at com.atlassian.sal.core.transaction.HostContextTransactionTemplate$1.doInTransaction(HostContextTransactionTemplate.java:21) ~[sal-core-3.0.5.jar:na]
        	at com.atlassian.stash.internal.sal.spi.HostContextAccessorImpl.doInTransaction(HostContextAccessorImpl.java:54) ~[bitbucket-platform-4.0.4.jar:na]
        	at com.atlassian.plugin.util.ContextClassLoaderSettingInvocationHandler.invoke(ContextClassLoaderSettingInvocationHandler.java:30) ~[atlassian-plugins-core-4.0.4.jar:na]
        	at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:56) ~[na:na]
        	at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:60) ~[na:na]
        	at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:70) ~[na:na]
        	at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:53) ~[na:na]
        	at org.eclipse.gemini.blueprint.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:57) ~[na:na]
        	at com.atlassian.sal.core.transaction.HostContextTransactionTemplate.execute(HostContextTransactionTemplate.java:18) ~[sal-core-3.0.5.jar:na]
        	at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:56) ~[na:na]
        	at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:60) ~[na:na]
        	at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:70) ~[na:na]
        	at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:53) ~[na:na]
        	at org.eclipse.gemini.blueprint.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:57) ~[na:na]
        	at com.atlassian.activeobjects.internal.SalTransactionManager.inTransaction(SalTransactionManager.java:42) ~[na:na]
        	at com.atlassian.activeobjects.internal.AbstractLoggingTransactionManager.doInTransaction(AbstractLoggingTransactionManager.java:16) ~[na:na]
        	at com.atlassian.activeobjects.internal.EntityManagedActiveObjects.executeInTransaction(EntityManagedActiveObjects.java:198) ~[na:na]
        	at com.atlassian.activeobjects.osgi.TenantAwareActiveObjects.executeInTransaction(TenantAwareActiveObjects.java:331) ~[na:na]
        	at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:56) ~[na:na]
        	at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:60) ~[na:na]
        	at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:70) ~[na:na]
        	at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:53) ~[na:na]
        	at org.eclipse.gemini.blueprint.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:57) ~[na:na]
        	at com.atlassian.activeobjects.tx.TransactionalProxy.executeInTransaction(TransactionalProxy.java:46) ~[na:na]
        	at com.atlassian.activeobjects.tx.TransactionalProxy.invokeInTransaction(TransactionalProxy.java:39) ~[na:na]
        	at com.atlassian.activeobjects.tx.TransactionalProxy.invoke(TransactionalProxy.java:31) ~[na:na]
        	at com.atlassian.plugins.hipchat.link.CachedHipChatAOLinkManager.saveNew(CachedHipChatAOLinkManager.java:113) ~[base-hipchat-integration-plugin-api-7.0.3_1446198402000.jar:na]
        	at com.atlassian.plugins.hipchat.link.HipChatLinkBuilder.create(HipChatLinkBuilder.java:198) ~[base-hipchat-integration-plugin-api-7.0.3_1446198402000.jar:na]
        	at com.atlassian.plugins.hipchat.link.HipChatLinkBuilder.access$100(HipChatLinkBuilder.java:17) ~[base-hipchat-integration-plugin-api-7.0.3_1446198402000.jar:na]
        	at com.atlassian.plugins.hipchat.link.HipChatLinkBuilder$1.doInTransaction(HipChatLinkBuilder.java:175) ~[base-hipchat-integration-plugin-api-7.0.3_1446198402000.jar:na]
        	at com.atlassian.plugins.hipchat.link.HipChatLinkBuilder$1.doInTransaction(HipChatLinkBuilder.java:172) ~[base-hipchat-integration-plugin-api-7.0.3_1446198402000.jar:na]
        	at com.atlassian.sal.core.transaction.HostContextTransactionTemplate$1.doInTransaction(HostContextTransactionTemplate.java:21) ~[sal-core-3.0.5.jar:na]
        	at com.atlassian.stash.internal.sal.spi.HostContextAccessorImpl.doInTransaction(HostContextAccessorImpl.java:54) ~[bitbucket-platform-4.0.4.jar:na]
        	at com.atlassian.plugin.util.ContextClassLoaderSettingInvocationHandler.invoke(ContextClassLoaderSettingInvocationHandler.java:30) ~[atlassian-plugins-core-4.0.4.jar:na]
        	at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:56) ~[na:na]
        	at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:60) ~[na:na]
        	at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:70) ~[na:na]
        	at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:53) ~[na:na]
        	at org.eclipse.gemini.blueprint.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:57) ~[na:na]
        	at com.atlassian.sal.core.transaction.HostContextTransactionTemplate.execute(HostContextTransactionTemplate.java:18) ~[sal-core-3.0.5.jar:na]
        	at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:56) ~[na:na]
        	at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:60) ~[na:na]
        	at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:70) ~[na:na]
        	at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:53) ~[na:na]
        	at org.eclipse.gemini.blueprint.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:57) ~[na:na]
        	at com.atlassian.plugins.hipchat.link.HipChatLinkBuilder.buildAndSave(HipChatLinkBuilder.java:172) ~[base-hipchat-integration-plugin-api-7.0.3_1446198402000.jar:na]
        	at com.atlassian.plugins.hipchat.admin.DefaultInstallationService.install(DefaultInstallationService.java:204) ~[base-hipchat-integration-plugin-7.0.3_1446198402000.jar:na]
        	at com.atlassian.plugins.hipchat.rest.HipChatLinkResource.completeInstallation(HipChatLinkResource.java:97) ~[base-hipchat-integration-plugin-7.0.3_1446198402000.jar:na]
        	at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:26) [applinks-plugin-5.0.1_1446198402000.jar:na]
        	at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:26) [applinks-plugin-5.0.1_1446198402000.jar:na]
        	at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:26) [applinks-plugin-5.0.1_1446198402000.jar:na]
        	at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:26) [applinks-plugin-5.0.1_1446198402000.jar:na]
        	at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:26) [applinks-plugin-5.0.1_1446198402000.jar:na]
        	at com.atlassian.stash.internal.spring.security.StashAuthenticationFilter.doFilter(StashAuthenticationFilter.java:88) [StashAuthenticationFilter.class:na]
        	at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doInsideSpringSecurityChain(BeforeLoginPluginAuthenticationFilter.java:109) [BeforeLoginPluginAuthenticationFilter.class:na]
        	at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter(BeforeLoginPluginAuthenticationFilter.java:75) [BeforeLoginPluginAuthenticationFilter.class:na]
        	at com.atlassian.security.auth.trustedapps.filter.TrustedApplicationsFilter.doFilter(TrustedApplicationsFilter.java:94) [atlassian-trusted-apps-core-4.2.0.jar:na]
        	at com.atlassian.oauth.serviceprovider.internal.servlet.OAuthFilter.doFilter(OAuthFilter.java:67) [atlassian-oauth-service-provider-plugin-2.0.3_1446198404000.jar:na]
        	at com.atlassian.analytics.client.filter.DefaultAnalyticsFilter.doFilter(DefaultAnalyticsFilter.java:36) [analytics-client-4.2.6_1446198404000.jar:na]
        	at com.atlassian.analytics.client.filter.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:32) [analytics-client-4.2.6_1446198404000.jar:na]
        	at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doBeforeBeforeLoginFilters(BeforeLoginPluginAuthenticationFilter.java:87) [BeforeLoginPluginAuthenticationFilter.class:na]
        	at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter(BeforeLoginPluginAuthenticationFilter.java:73) [BeforeLoginPluginAuthenticationFilter.class:na]
        	at com.atlassian.stash.internal.request.DefaultRequestManager.doAsRequest(DefaultRequestManager.java:85) [bitbucket-service-impl-4.0.4.jar:na]
        	at com.atlassian.stash.internal.hazelcast.ConfigurableWebFilter.doFilter(ConfigurableWebFilter.java:38) [ConfigurableWebFilter.class:na]
        	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_40]
        	at java.lang.Thread.run(Thread.java:745) [na:1.8.0_40]
        	... 331 frames trimmed
        Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near ','.
        	at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:191) ~[sqljdbc-4.2.6420.jar:na]
        	at com.microsoft.sqlserver.jdbc.SQLServerParameterMetaData.<init>(SQLServerParameterMetaData.java:423) ~[sqljdbc-4.2.6420.jar:na]
        	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.getParameterMetaData(SQLServerPreparedStatement.java:1659) ~[sqljdbc-4.2.6420.jar:na]
        	at com.zaxxer.hikari.proxy.HikariPreparedStatementProxy.getParameterMetaData(HikariPreparedStatementProxy.java) ~[HikariCP-2.4.1.jar:na]
        	at net.java.ao.DatabaseProvider.putNull(DatabaseProvider.java:1953) ~[na:na]
        	at net.java.ao.EntityProxy.save(EntityProxy.java:560) ~[na:na]
        	at net.java.ao.EntityProxy.invoke(EntityProxy.java:115) ~[na:na]
        	... 71 common frames omitted
        

      Workaround

      No workaround is available for this bug.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              sgoodhew Scott Goodhew (Inactive)
              Reporter:
              sgoodhew Scott Goodhew (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: