com.atlassian.bitbucket.DataStoreException: A database error has occurred.

Atlassian JIRA | Christian Rolf | 5 months ago
  1. 0

    Gives a 500 with the following stack trace, possibly same issue applies for groups:. Reproduced with OpenDJ and the large dataset from here: https://extranet.atlassian.com/display/BSERV/Crowd+Resources+for+Support {noformat} 2016-06-22 10:48:51,805 ERROR [http-nio-7990-exec-6] admin @1XWNN0Dx648x199x0 uhvc4l 0:0:0:0:0:0:0:1 "GET /admin/users HTTP/1.1" c.a.s.i.w.HandlerExceptionResolverImpl A database error has occurred. com.atlassian.bitbucket.DataStoreException: A database error has occurred. at com.atlassian.stash.internal.aop.ExceptionRewriteAdvice.afterThrowing(ExceptionRewriteAdvice.java:41) ~[bitbucket-platform-4.7.0-SNAPSHOT.jar:na] at com.atlassian.stash.internal.web.admin.UserAndGroupListController.listUsers(UserAndGroupListController.java:41) ~[classes/:na] at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24) [applinks-plugin-5.2.2_1464655676000.jar:na] at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24) [applinks-plugin-5.2.2_1464655676000.jar:na] at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24) [applinks-plugin-5.2.2_1464655676000.jar:na] at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24) [applinks-plugin-5.2.2_1464655676000.jar:na] at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24) [applinks-plugin-5.2.2_1464655676000.jar:na] at com.atlassian.stash.internal.spring.security.StashAuthenticationFilter.doFilter(StashAuthenticationFilter.java:88) [classes/:na] at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doInsideSpringSecurityChain(BeforeLoginPluginAuthenticationFilter.java:109) [classes/:na] at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter(BeforeLoginPluginAuthenticationFilter.java:75) [classes/: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_1443759955000.jar: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_1443759955000.jar:na] at com.atlassian.core.filters.ServletContextThreadLocalFilter.doFilter(ServletContextThreadLocalFilter.java:21) [atlassian-core-4.6.19.jar:na] at com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31) [atlassian-core-4.6.19.jar:na] at com.atlassian.plugin.connect.plugin.auth.user.ThreeLeggedAuthFilter.doFilter(ThreeLeggedAuthFilter.java:109) [atlassian-connect-plugin-1.1.86-bitbucket-04.jar:na] at com.atlassian.jwt.internal.servlet.JwtAuthFilter.doFilter(JwtAuthFilter.java:32) [jwt-plugin-1.5.11-0002_1461023611000.jar:na] at com.atlassian.analytics.client.filter.DefaultAnalyticsFilter.doFilter(DefaultAnalyticsFilter.java:38) [analytics-client-5.2.7_1464655676000.jar:na] at com.atlassian.analytics.client.filter.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:39) [analytics-client-5.2.7_1464655676000.jar:na] at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doBeforeBeforeLoginFilters(BeforeLoginPluginAuthenticationFilter.java:87) [classes/:na] at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter(BeforeLoginPluginAuthenticationFilter.java:73) [classes/:na] at com.atlassian.stash.internal.request.DefaultRequestManager.doAsRequest(DefaultRequestManager.java:86) ~[bitbucket-service-impl-4.7.0-SNAPSHOT.jar:na] at com.atlassian.stash.internal.hazelcast.ConfigurableWebFilter.doFilter(ConfigurableWebFilter.java:38) ~[classes/:na] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) ~[na:1.8.0_60] at java.lang.Thread.run(Thread.java:745) ~[na:1.8.0_60] ... 265 frames trimmed Caused by: org.hibernate.PessimisticLockException: could not execute statement at org.hibernate.dialect.H2Dialect$2.convert(H2Dialect.java:342) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final] at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final] at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:126) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final] at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:112) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final] at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:211) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final] at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3127) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final] at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3581) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final] at org.hibernate.action.internal.EntityInsertAction.execute(EntityInsertAction.java:104) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final] at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:465) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final] at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:351) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final] at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:350) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final] at org.hibernate.event.internal.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:67) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final] at org.hibernate.internal.SessionImpl.autoFlushIfRequired(SessionImpl.java:1227) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final] at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1293) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final] at org.hibernate.internal.QueryImpl.list(QueryImpl.java:103) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final] at org.hibernate.internal.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:966) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final] at com.atlassian.stash.internal.user.HibernateStashUserDao.findByName(HibernateStashUserDao.java:172) ~[bitbucket-dao-impl-4.7.0-SNAPSHOT.jar:na] at com.atlassian.stash.internal.user.HibernateStashUserDao.createFor(HibernateStashUserDao.java:331) ~[bitbucket-dao-impl-4.7.0-SNAPSHOT.jar:na] at com.atlassian.stash.internal.user.DefaultUserHelper.newStashUser(DefaultUserHelper.java:60) ~[bitbucket-service-impl-4.7.0-SNAPSHOT.jar:na] at com.atlassian.stash.internal.user.DefaultUserHelper.lambda$transformOrCreate$136(DefaultUserHelper.java:53) ~[bitbucket-service-impl-4.7.0-SNAPSHOT.jar:na] at com.google.common.collect.Iterators$8.transform(Iterators.java:799) ~[guava-18.0.jar:na] at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:48) ~[guava-18.0.jar:na] at com.google.common.collect.ImmutableCollection$Builder.addAll(ImmutableCollection.java:301) ~[guava-18.0.jar:na] at com.google.common.collect.ImmutableList$Builder.addAll(ImmutableList.java:691) ~[guava-18.0.jar:na] at com.google.common.collect.ImmutableList.copyOf(ImmutableList.java:275) ~[guava-18.0.jar:na] at com.google.common.collect.ImmutableList.copyOf(ImmutableList.java:226) ~[guava-18.0.jar:na] at com.atlassian.bitbucket.util.PageImpl.transform(PageImpl.java:93) ~[bitbucket-api-4.7.0-SNAPSHOT.jar:na] at com.atlassian.bitbucket.util.PageImpl.transform(PageImpl.java:11) ~[bitbucket-api-4.7.0-SNAPSHOT.jar:na] at com.atlassian.stash.internal.user.DefaultUserHelper.transformOrCreate(DefaultUserHelper.java:50) ~[bitbucket-service-impl-4.7.0-SNAPSHOT.jar:na] at com.atlassian.stash.internal.user.DefaultUserAdminService.transformOrCreateUsers(DefaultUserAdminService.java:700) ~[bitbucket-service-impl-4.7.0-SNAPSHOT.jar:na] at com.atlassian.stash.internal.user.DefaultUserAdminService.findUsersByName(DefaultUserAdminService.java:402) ~[bitbucket-service-impl-4.7.0-SNAPSHOT.jar:na] ... 26 common frames omitted Caused by: org.h2.jdbc.JdbcSQLException: Timeout trying to lock table ; SQL statement: insert into sta_normal_user (deleted_timestamp, locale, slug, time_zone, name, user_id) values (?, ?, ?, ?, ?, ?) [50200-176] at org.h2.message.DbException.getJdbcSQLException(DbException.java:344) ~[h2-1.3.176.jar:1.3.176] at org.h2.message.DbException.get(DbException.java:167) ~[h2-1.3.176.jar:1.3.176] at org.h2.command.Command.filterConcurrentUpdate(Command.java:301) ~[h2-1.3.176.jar:1.3.176] at org.h2.command.Command.executeUpdate(Command.java:256) ~[h2-1.3.176.jar:1.3.176] at org.h2.jdbc.JdbcPreparedStatement.executeUpdateInternal(JdbcPreparedStatement.java:158) ~[h2-1.3.176.jar:1.3.176] at org.h2.jdbc.JdbcPreparedStatement.executeUpdate(JdbcPreparedStatement.java:144) ~[h2-1.3.176.jar:1.3.176] at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61) ~[HikariCP-2.4.5.jar:na] at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPreparedStatement.java) ~[HikariCP-2.4.5.jar:na] at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:208) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final] ... 52 common frames omitted Caused by: org.h2.jdbc.JdbcSQLException: Concurrent update in table "UQ_NORMAL_USER_NAME_INDEX_3": another transaction has updated or deleted the same row [90131-176] at org.h2.message.DbException.getJdbcSQLException(DbException.java:344) ~[h2-1.3.176.jar:1.3.176] at org.h2.message.DbException.get(DbException.java:178) ~[h2-1.3.176.jar:1.3.176] at org.h2.message.DbException.get(DbException.java:154) ~[h2-1.3.176.jar:1.3.176] at org.h2.table.RegularTable.addRow(RegularTable.java:145) ~[h2-1.3.176.jar:1.3.176] at org.h2.command.dml.Insert.insertRows(Insert.java:157) ~[h2-1.3.176.jar:1.3.176] at org.h2.command.dml.Insert.update(Insert.java:115) ~[h2-1.3.176.jar:1.3.176] at org.h2.command.CommandContainer.update(CommandContainer.java:79) ~[h2-1.3.176.jar:1.3.176] at org.h2.command.Command.executeUpdate(Command.java:254) ~[h2-1.3.176.jar:1.3.176] ... 57 common frames omitted {noformat}

    Atlassian JIRA | 5 months ago | Christian Rolf
    com.atlassian.bitbucket.DataStoreException: A database error has occurred.

    Root Cause Analysis

    1. com.atlassian.bitbucket.DataStoreException

      A database error has occurred.

      at com.atlassian.stash.internal.aop.ExceptionRewriteAdvice.afterThrowing()
    2. com.atlassian.stash
      UserAndGroupListController.listUsers
      1. com.atlassian.stash.internal.aop.ExceptionRewriteAdvice.afterThrowing(ExceptionRewriteAdvice.java:41)[bitbucket-platform-4.7.0-SNAPSHOT.jar:na]
      2. com.atlassian.stash.internal.web.admin.UserAndGroupListController.listUsers(UserAndGroupListController.java:41)[classes/:na]
      2 frames
    3. com.atlassian.applinks
      ContextFilter.doFilter
      1. com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24)[applinks-plugin-5.2.2_1464655676000.jar:na]
      2. com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24)[applinks-plugin-5.2.2_1464655676000.jar:na]
      3. com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24)[applinks-plugin-5.2.2_1464655676000.jar:na]
      4. com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24)[applinks-plugin-5.2.2_1464655676000.jar:na]
      5. com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24)[applinks-plugin-5.2.2_1464655676000.jar:na]
      5 frames
    4. com.atlassian.stash
      BeforeLoginPluginAuthenticationFilter.doFilter
      1. com.atlassian.stash.internal.spring.security.StashAuthenticationFilter.doFilter(StashAuthenticationFilter.java:88)[classes/:na]
      2. com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doInsideSpringSecurityChain(BeforeLoginPluginAuthenticationFilter.java:109)[classes/:na]
      3. com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter(BeforeLoginPluginAuthenticationFilter.java:75)[classes/:na]
      3 frames
    5. com.atlassian.security
      TrustedApplicationsFilter.doFilter
      1. com.atlassian.security.auth.trustedapps.filter.TrustedApplicationsFilter.doFilter(TrustedApplicationsFilter.java:94)[atlassian-trusted-apps-core-4.2.0.jar:na]
      1 frame
    6. com.atlassian.oauth
      OAuthFilter.doFilter
      1. com.atlassian.oauth.serviceprovider.internal.servlet.OAuthFilter.doFilter(OAuthFilter.java:67)[atlassian-oauth-service-provider-plugin-2.0.3_1443759955000.jar:na]
      1 frame
    7. com.atlassian.security
      TrustedApplicationsFilter.doFilter
      1. com.atlassian.security.auth.trustedapps.filter.TrustedApplicationsFilter.doFilter(TrustedApplicationsFilter.java:94)[atlassian-trusted-apps-core-4.2.0.jar:na]
      1 frame
    8. com.atlassian.oauth
      OAuthFilter.doFilter
      1. com.atlassian.oauth.serviceprovider.internal.servlet.OAuthFilter.doFilter(OAuthFilter.java:67)[atlassian-oauth-service-provider-plugin-2.0.3_1443759955000.jar:na]
      1 frame
    9. com.atlassian.core
      AbstractHttpFilter.doFilter
      1. com.atlassian.core.filters.ServletContextThreadLocalFilter.doFilter(ServletContextThreadLocalFilter.java:21)[atlassian-core-4.6.19.jar:na]
      2. com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31)[atlassian-core-4.6.19.jar:na]
      2 frames
    10. com.atlassian.plugin
      ThreeLeggedAuthFilter.doFilter
      1. com.atlassian.plugin.connect.plugin.auth.user.ThreeLeggedAuthFilter.doFilter(ThreeLeggedAuthFilter.java:109)[atlassian-connect-plugin-1.1.86-bitbucket-04.jar:na]
      1 frame
    11. com.atlassian.jwt
      JwtAuthFilter.doFilter
      1. com.atlassian.jwt.internal.servlet.JwtAuthFilter.doFilter(JwtAuthFilter.java:32)[jwt-plugin-1.5.11-0002_1461023611000.jar:na]
      1 frame
    12. com.atlassian.analytics
      AbstractHttpFilter.doFilter
      1. com.atlassian.analytics.client.filter.DefaultAnalyticsFilter.doFilter(DefaultAnalyticsFilter.java:38)[analytics-client-5.2.7_1464655676000.jar:na]
      2. com.atlassian.analytics.client.filter.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:39)[analytics-client-5.2.7_1464655676000.jar:na]
      2 frames
    13. com.atlassian.stash
      ConfigurableWebFilter.doFilter
      1. com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doBeforeBeforeLoginFilters(BeforeLoginPluginAuthenticationFilter.java:87)[classes/:na]
      2. com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter(BeforeLoginPluginAuthenticationFilter.java:73)[classes/:na]
      3. com.atlassian.stash.internal.request.DefaultRequestManager.doAsRequest(DefaultRequestManager.java:86)[bitbucket-service-impl-4.7.0-SNAPSHOT.jar:na]
      4. com.atlassian.stash.internal.hazelcast.ConfigurableWebFilter.doFilter(ConfigurableWebFilter.java:38)[classes/:na]
      4 frames
    14. Java RT
      Thread.run
      1. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[na:1.8.0_60]
      2. java.lang.Thread.run(Thread.java:745)[na:1.8.0_60]
      2 frames