Cannot pull from branch to master, error is "A database error has occurred."
Asked by KLASS ENGINEERING:

We are trying to pull from branch to master. Keep on getting the above error... Seems we cannot create merge request...![Screenshot 2021-02-09 101120.jpg](/t5/image/serverpage/image-id/129492i2247C7E7029F840F/image-size/large?v=v2&px=999 "Screenshot 2021-02-09 101120.jpg")


Answers:
author: KLASS ENGINEERING
body: Error log looks like this:

2021-02-16 07:11:07,807 WARN \[http-nio-7990-exec-3\] user.id.1user.id.1 @1YN1AW8x431x37667x0 vm3293 xx.xx.xx.xx,172.22.0.8 "POST /projects/KDEV/repos/atlassian/pull-requests HTTP/1.0" o.h.e.jdbc.spi.SqlExceptionHelper SQL Error: 0, SQLState: XX000  
2021-02-16 07:11:07,807 ERROR \[http-nio-7990-exec-3\] user.id.1 @1YN1AW8x431x37667x0 vm3293 xx.xx.xx.xx,172.22.0.8 "POST /projects/KDEV/repos/atlassian/pull-requests HTTP/1.0" o.h.e.jdbc.spi.SqlExceptionHelper ERROR: missing chunk number 0 for toast value 51149 in pg_toast_2619  
2021-02-16 07:11:07,813 ERROR \[http-nio-7990-exec-3\] user.id.1 @1YN1AW8x431x37667x0 vm3293 xx.xx.xx.xx,172.22.0.8 "POST /projects/KDEV/repos/atlassian/pull-requests HTTP/1.0" c.a.s.i.w.pull.PullRequestController Exception occurred  
com.atlassian.bitbucket.DataStoreException: A database error has occurred.  
at com.atlassian.stash.internal.aop.ExceptionRewriteAdvice.afterThrowing(ExceptionRewriteAdvice.java:47)  
at com.atlassian.stash.internal.web.pull.PullRequestController.createPullRequest(PullRequestController.java:171)  
at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24)  
at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24)  
at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24)  
at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24)  
at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24)  
at com.atlassian.bitbucket.internal.importer.web.RepositoryImportFilter.doFilter(RepositoryImportFilter.java:64)  
at com.atlassian.stash.internal.spring.lifecycle.LifecycleJohnsonServletFilterModuleContainerFilter.doFilter(LifecycleJohnsonServletFilterModuleContainerFilter.java:42)  
at com.atlassian.bitbucket.internal.ratelimit.servlet.filter.RateLimitFilter.doFilter(RateLimitFilter.java:75)  
at com.atlassian.stash.internal.spring.lifecycle.LifecycleJohnsonServletFilterModuleContainerFilter.doFilter(LifecycleJohnsonServletFilterModuleContainerFilter.java:42)  
at com.atlassian.stash.internal.web.auth.AuthorizationFailureInterceptor.doFilterInternal(AuthorizationFailureInterceptor.java:39)  
at com.atlassian.stash.internal.spring.security.StashAuthenticationFilter.doFilter(StashAuthenticationFilter.java:85)  
at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doInsideSpringSecurityChain(BeforeLoginPluginAuthenticationFilter.java:112)  
at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter(BeforeLoginPluginAuthenticationFilter.java:75)  
at com.atlassian.security.auth.trustedapps.filter.TrustedApplicationsFilter.doFilter(TrustedApplicationsFilter.java:94)  
at com.atlassian.oauth.serviceprovider.internal.servlet.OAuthFilter.doFilter(OAuthFilter.java:67)  
at com.atlassian.stash.internal.spring.lifecycle.LifecycleJohnsonServletFilterModuleContainerFilter.doFilter(LifecycleJohnsonServletFilterModuleContainerFilter.java:42)  
at com.atlassian.stash.internal.spring.lifecycle.LifecycleJohnsonServletFilterModuleContainerFilter.doFilter(LifecycleJohnsonServletFilterModuleContainerFilter.java:42)  
at com.atlassian.security.auth.trustedapps.filter.TrustedApplicationsFilter.doFilter(TrustedApplicationsFilter.java:94)  
at com.atlassian.oauth.serviceprovider.internal.servlet.OAuthFilter.doFilter(OAuthFilter.java:67)  
at com.atlassian.stash.internal.spring.lifecycle.LifecycleJohnsonServletFilterModuleContainerFilter.doFilter(LifecycleJohnsonServletFilterModuleContainerFilter.java:42)  
at com.atlassian.plugin.connect.plugin.auth.oauth2.DefaultSalAuthenticationFilter.doFilter(DefaultSalAuthenticationFilter.java:69)  
at com.atlassian.plugin.connect.plugin.auth.user.ThreeLeggedAuthFilter.doFilter(ThreeLeggedAuthFilter.java:109)  
at com.atlassian.jwt.internal.servlet.JwtAuthFilter.doFilter(JwtAuthFilter.java:37)  
at com.atlassian.analytics.client.filter.DefaultAnalyticsFilter.doFilter(DefaultAnalyticsFilter.java:33)  
at com.atlassian.analytics.client.filter.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:33)  
at com.atlassian.stash.internal.spring.lifecycle.LifecycleJohnsonServletFilterModuleContainerFilter.doFilter(LifecycleJohnsonServletFilterModuleContainerFilter.java:42)  
at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doBeforeBeforeLoginFilters(BeforeLoginPluginAuthenticationFilter.java:90)  
at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter(BeforeLoginPluginAuthenticationFilter.java:73)  
at com.atlassian.stash.internal.request.DefaultRequestManager.doAsRequest(DefaultRequestManager.java:84)  
at com.atlassian.stash.internal.hazelcast.ConfigurableWebFilter.doFilter(ConfigurableWebFilter.java:38)  
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)  
at java.lang.Thread.run(Thread.java:748)  
... 299 frames trimmed  
Caused by: org.hibernate.exception.GenericJDBCException: could not extract ResultSet  
at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:47)  
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:113)  
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:99)  
at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:67)  
at org.hibernate.persister.entity.AbstractEntityPersister.getDatabaseSnapshot(AbstractEntityPersister.java:1541)  
at org.hibernate.engine.internal.StatefulPersistenceContext.getDatabaseSnapshot(StatefulPersistenceContext.java:320)  
at org.hibernate.engine.internal.ForeignKeys.isTransient(ForeignKeys.java:306)  
at org.hibernate.event.internal.EntityState.getEntityState(EntityState.java:59)  
at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:85)  
at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:75)  
at org.hibernate.event.service.internal.EventListenerGroupImpl.fireEventOnEachListener(EventListenerGroupImpl.java:102)  
at org.hibernate.internal.SessionImpl.fireSaveOrUpdate(SessionImpl.java:610)  
at org.hibernate.internal.SessionImpl.saveOrUpdate(SessionImpl.java:603)  
at org.hibernate.internal.SessionImpl.saveOrUpdate(SessionImpl.java:598)  
at com.atlassian.stash.internal.AbstractHibernateDao.create(AbstractHibernateDao.java:56)  
at com.atlassian.stash.internal.pull.InternalPullRequestCommitHelper.lambda$reindex$1(InternalPullRequestCommitHelper.java:151)  
at java.lang.Iterable.forEach(Iterable.java:75)  
at com.atlassian.stash.internal.pull.InternalPullRequestCommitHelper.reindex(InternalPullRequestCommitHelper.java:150)  
at com.atlassian.stash.internal.pull.DefaultPullRequestService.create(DefaultPullRequestService.java:354)  
at com.atlassian.stash.internal.pull.DefaultPullRequestService.create(DefaultPullRequestService.java:106)  
... 34 common frames omitted  
Caused by: org.postgresql.util.PSQLException: ERROR: missing chunk number 0 for toast value 51149 in pg_toast_2619  
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2440)  
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2183)  
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:308)  
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441)  
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365)  
at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:143)  
at org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:106)  
at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52)  
at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java)  
at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:57)  
... 50 common frames omitted  
2021-02-16 07:11:47,010 WARN \[http-nio-7990-exec-9\] user.id.1 @1YN1AW8x431x37686x0 vm3293 xx.xx.xx.xx,172.22.0.8 "POST /projects/KDEV/repos/atlassian/pull-requests HTTP/1.0" o.h.e.jdbc.spi.SqlExceptionHelper SQL Error: 0, SQLState: XX000  
2021-02-16 07:11:47,010 ERROR \[http-nio-7990-exec-9\] user.id.1 @1YN1AW8x431x37686x0 vm3293 xx.xx.xx.xx,172.22.0.8 "POST /projects/KDEV/repos/atlassian/pull-requests HTTP/1.0" o.h.e.jdbc.spi.SqlExceptionHelper ERROR: missing chunk number 0 for toast value 51149 in pg_toast_2619  
2021-02-16 07:11:47,012 ERROR \[http-nio-7990-exec-9\] user.id.1 @1YN1AW8x431x37686x0 vm3293 xx.xx.xx.xx,172.22.0.8 "POST /projects/KDEV/repos/atlassian/pull-requests HTTP/1.0" c.a.s.i.w.pull.PullRequestController Exception occurred  
com.atlassian.bitbucket.DataStoreException: A database error has occurred.  
at com.atlassian.stash.internal.aop.ExceptionRewriteAdvice.afterThrowing(ExceptionRewriteAdvice.java:47)  
at com.atlassian.stash.internal.web.pull.PullRequestController.createPullRequest(PullRequestController.java:171)  
at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24)  
at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24)  
at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24)  
at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24)  
at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24)  
at com.atlassian.bitbucket.internal.importer.web.RepositoryImportFilter.doFilter(RepositoryImportFilter.java:64)  
at com.atlassian.stash.internal.spring.lifecycle.LifecycleJohnsonServletFilterModuleContainerFilter.doFilter(LifecycleJohnsonServletFilterModuleContainerFilter.java:42)  
at com.atlassian.bitbucket.internal.ratelimit.servlet.filter.RateLimitFilter.doFilter(RateLimitFilter.java:75)  
at com.atlassian.stash.internal.spring.lifecycle.LifecycleJohnsonServletFilterModuleContainerFilter.doFilter(LifecycleJohnsonServletFilterModuleContainerFilter.java:42)  
at com.atlassian.stash.internal.web.auth.AuthorizationFailureInterceptor.doFilterInternal(AuthorizationFailureInterceptor.java:39)  
at com.atlassian.stash.internal.spring.security.StashAuthenticationFilter.doFilter(StashAuthenticationFilter.java:85)  
at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doInsideSpringSecurityChain(BeforeLoginPluginAuthenticationFilter.java:112)  
at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter(BeforeLoginPluginAuthenticationFilter.java:75)  
at com.atlassian.security.auth.trustedapps.filter.TrustedApplicationsFilter.doFilter(TrustedApplicationsFilter.java:94)  
at com.atlassian.oauth.serviceprovider.internal.servlet.OAuthFilter.doFilter(OAuthFilter.java:67)  
at com.atlassian.stash.internal.spring.lifecycle.LifecycleJohnsonServletFilterModuleContainerFilter.doFilter(LifecycleJohnsonServletFilterModuleContainerFilter.java:42)  
at com.atlassian.stash.internal.spring.lifecycle.LifecycleJohnsonServletFilterModuleContainerFilter.doFilter(LifecycleJohnsonServletFilterModuleContainerFilter.java:42)  
at com.atlassian.security.auth.trustedapps.filter.TrustedApplicationsFilter.doFilter(TrustedApplicationsFilter.java:94)  
at com.atlassian.oauth.serviceprovider.internal.servlet.OAuthFilter.doFilter(OAuthFilter.java:67)  
at com.atlassian.stash.internal.spring.lifecycle.LifecycleJohnsonServletFilterModuleContainerFilter.doFilter(LifecycleJohnsonServletFilterModuleContainerFilter.java:42)  
at com.atlassian.plugin.connect.plugin.auth.oauth2.DefaultSalAuthenticationFilter.doFilter(DefaultSalAuthenticationFilter.java:69)  
at com.atlassian.plugin.connect.plugin.auth.user.ThreeLeggedAuthFilter.doFilter(ThreeLeggedAuthFilter.java:109)  
at com.atlassian.jwt.internal.servlet.JwtAuthFilter.doFilter(JwtAuthFilter.java:37)  
at com.atlassian.analytics.client.filter.DefaultAnalyticsFilter.doFilter(DefaultAnalyticsFilter.java:33)  
at com.atlassian.analytics.client.filter.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:33)  
at com.atlassian.stash.internal.spring.lifecycle.LifecycleJohnsonServletFilterModuleContainerFilter.doFilter(LifecycleJohnsonServletFilterModuleContainerFilter.java:42)  
at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doBeforeBeforeLoginFilters(BeforeLoginPluginAuthenticationFilter.java:90)  
at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter(BeforeLoginPluginAuthenticationFilter.java:73)  
at com.atlassian.stash.internal.request.DefaultRequestManager.doAsRequest(DefaultRequestManager.java:84)  
at com.atlassian.stash.internal.hazelcast.ConfigurableWebFilter.doFilter(ConfigurableWebFilter.java:38)  
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)  
at java.lang.Thread.run(Thread.java:748)  
... 299 frames trimmed  
Caused by: org.hibernate.exception.GenericJDBCException: could not extract ResultSet  
at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:47)  
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:113)  
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:99)  
at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:67)  
at org.hibernate.persister.entity.AbstractEntityPersister.getDatabaseSnapshot(AbstractEntityPersister.java:1541)  
at org.hibernate.engine.internal.StatefulPersistenceContext.getDatabaseSnapshot(StatefulPersistenceContext.java:320)  
at org.hibernate.engine.internal.ForeignKeys.isTransient(ForeignKeys.java:306)  
at org.hibernate.event.internal.EntityState.getEntityState(EntityState.java:59)  
at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:85)  
at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:75)  
at org.hibernate.event.service.internal.EventListenerGroupImpl.fireEventOnEachListener(EventListenerGroupImpl.java:102)  
at org.hibernate.internal.SessionImpl.fireSaveOrUpdate(SessionImpl.java:610)  
at org.hibernate.internal.SessionImpl.saveOrUpdate(SessionImpl.java:603)  
at org.hibernate.internal.SessionImpl.saveOrUpdate(SessionImpl.java:598)  
at com.atlassian.stash.internal.AbstractHibernateDao.create(AbstractHibernateDao.java:56)  
at com.atlassian.stash.internal.pull.InternalPullRequestCommitHelper.lambda$reindex$1(InternalPullRequestCommitHelper.java:151)  
at java.lang.Iterable.forEach(Iterable.java:75)  
at com.atlassian.stash.internal.pull.InternalPullRequestCommitHelper.reindex(InternalPullRequestCommitHelper.java:150)  
at com.atlassian.stash.internal.pull.DefaultPullRequestService.create(DefaultPullRequestService.java:354)  
at com.atlassian.stash.internal.pull.DefaultPullRequestService.create(DefaultPullRequestService.java:106)  
... 34 common frames omitted  
Caused by: org.postgresql.util.PSQLException: ERROR: missing chunk number 0 for toast value 51149 in pg_toast_2619  
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2440)  
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2183)  
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:308)  
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441)  
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365)  
at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:143)  
at org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:106)  
at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52)  
at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java)  
at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:57)  
... 50 common frames omitted


Tags: bitbucket-server

server