When we try to create new repositories we are getting a message to say "A Database Error Has Occurred"

Have tried restarting bitbucket.
The logs show the following:
2022-01-11 13:57:47,633 ERROR [http-nio-7990-exec-3] david.read @7HCOUZx837x154x0 1ikzj8n 172.22.100.224,127.0.0.1 "POST /projects/IO/repos HTTP/1.1" o.h.e.j.batch.internal.BatchingBatch HHH000315: Exception executing batch [java.sql.BatchUpdateException: Batch entry 0 insert into repository (store_id, description, is_forkable, hierarchy_id, name, project_id, is_public, scm_id, slug, state, id) values (NULL, 'Testing Repo', 'TRUE', '93eaee3fd7e0ea415987', 'TestRepo', 105, 'FALSE', 'git', 'testrepo', 0, 162) was aborted: ERROR: null value in column "is_read_only" violates not-null constraint
Detail: Failing row contains (162, testrepo, TestRepo, 0, 105, git, 93eaee3fd7e0ea415987, t, f, null, Testing Repo, null, null). Call getNextException to see other errors in the batch.], SQL: insert into repository (store_id, description, is_forkable, hierarchy_id, name, project_id, is_public, scm_id, slug, state, id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
2022-01-11 13:57:47,635 WARN [http-nio-7990-exec-3] david.read @7HCOUZx837x154x0 1ikzj8n 172.22.100.224,127.0.0.1 "POST /projects/IO/repos HTTP/1.1" o.h.e.jdbc.spi.SqlExceptionHelper SQL Error: 0, SQLState: 23502
2022-01-11 13:57:47,635 ERROR [http-nio-7990-exec-3] david.read @7HCOUZx837x154x0 1ikzj8n 172.22.100.224,127.0.0.1 "POST /projects/IO/repos HTTP/1.1" o.h.e.jdbc.spi.SqlExceptionHelper Batch entry 0 insert into repository (store_id, description, is_forkable, hierarchy_id, name, project_id, is_public, scm_id, slug, state, id) values (NULL, 'Testing Repo', 'TRUE', '93eaee3fd7e0ea415987', 'TestRepo', 105, 'FALSE', 'git', 'testrepo', 0, 162) was aborted: ERROR: null value in column "is_read_only" violates not-null constraint
Detail: Failing row contains (162, testrepo, TestRepo, 0, 105, git, 93eaee3fd7e0ea415987, t, f, null, Testing Repo, null, null). Call getNextException to see other errors in the batch.
2022-01-11 13:57:47,635 ERROR [http-nio-7990-exec-3] david.read @7HCOUZx837x154x0 1ikzj8n 172.22.100.224,127.0.0.1 "POST /projects/IO/repos HTTP/1.1" o.h.e.jdbc.spi.SqlExceptionHelper ERROR: null value in column "is_read_only" violates not-null constraint
Detail: Failing row contains (162, testrepo, TestRepo, 0, 105, git, 93eaee3fd7e0ea415987, t, f, null, Testing Repo, null, null).
2022-01-11 13:57:47,647 DEBUG [http-nio-7990-exec-3] david.read @7HCOUZx837x154x0 1ikzj8n 172.22.100.224,127.0.0.1 "POST /projects/IO/repos HTTP/1.1" c.a.s.i.r.DefaultRepositoryService Could not create repository IO/testrepo
javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: could not execute batch
at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:154)
at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:181)
at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:188)
at org.hibernate.internal.SessionImpl.doFlush(SessionImpl.java:1360)
at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1343)
at com.atlassian.stash.internal.repository.HibernateRepositoryDao.create(HibernateRepositoryDao.java:81)
at com.atlassian.stash.internal.repository.HibernateRepositoryDao.create(HibernateRepositoryDao.java:33)
at com.atlassian.stash.internal.repository.DefaultRepositoryService.createRepositoryInDatabase(DefaultRepositoryService.java:754)
at com.atlassian.stash.internal.repository.DefaultRepositoryService.lambda$null$7(DefaultRepositoryService.java:808)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)
at com.atlassian.stash.internal.repository.DefaultRepositoryService.lambda$createRepositoryWithRetry$8(DefaultRepositoryService.java:807)
at io.atlassian.fugue.retry.RetrySupplier.get(RetrySupplier.java:100)
at com.atlassian.stash.internal.repository.DefaultRepositoryService.createRepositoryWithRetry(DefaultRepositoryService.java:825)
at com.atlassian.stash.internal.repository.DefaultRepositoryService.create(DefaultRepositoryService.java:196)
at com.atlassian.stash.internal.repository.DefaultRepositoryService.create(DefaultRepositoryService.java:94)
<snip>
Caused by: org.hibernate.exception.ConstraintViolationException: could not execute batch
at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:109)
at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:42)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:113)
at org.hibernate.engine.jdbc.batch.internal.BatchingBatch.performExecution(BatchingBatch.java:129)
at org.hibernate.engine.jdbc.batch.internal.BatchingBatch.doExecuteBatch(BatchingBatch.java:105)
at org.hibernate.engine.jdbc.batch.internal.AbstractBatchImpl.execute(AbstractBatchImpl.java:148)
at org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.executeBatch(JdbcCoordinatorImpl.java:198)
at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:633)
at org.hibernate.engine.spi.ActionQueue.lambda$executeActions$1(ActionQueue.java:478)
at java.util.LinkedHashMap.forEach(LinkedHashMap.java:684)
at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:475)
at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:348)
at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:40)
at org.hibernate.event.service.internal.EventListenerGroupImpl.fireEventOnEachListener(EventListenerGroupImpl.java:102)
at org.hibernate.internal.SessionImpl.doFlush(SessionImpl.java:1356)
... 44 common frames omitted
Caused by: java.sql.BatchUpdateException: Batch entry 0 insert into repository (store_id, description, is_forkable, hierarchy_id, name, project_id, is_public, scm_id, slug, state, id) values (NULL, 'Testing Repo', 'TRUE', '93eaee3fd7e0ea415987', 'TestRepo', 105, 'FALSE', 'git', 'testrepo', 0, 162) was aborted: ERROR: null value in column "is_read_only" violates not-null constraint
Detail: Failing row contains (162, testrepo, TestRepo, 0, 105, git, 93eaee3fd7e0ea415987, t, f, null, Testing Repo, null, null). Call getNextException to see other errors in the batch.
at org.postgresql.jdbc.BatchResultHandler.handleError(BatchResultHandler.java:159)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2268)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:510)
at org.postgresql.jdbc.PgStatement.internalExecuteBatch(PgStatement.java:851)
at org.postgresql.jdbc.PgStatement.executeBatch(PgStatement.java:874)
at org.postgresql.jdbc.PgPreparedStatement.executeBatch(PgPreparedStatement.java:1563)
at com.zaxxer.hikari.pool.ProxyStatement.executeBatch(ProxyStatement.java:128)
at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeBatch(HikariProxyPreparedStatement.java)
at org.hibernate.engine.jdbc.batch.internal.BatchingBatch.performExecution(BatchingBatch.java:119)
... 55 common frames omitted
Next exception: org.postgresql.util.PSQLException: ERROR: null value in column "is_read_only" violates not-null constraint
Detail: Failing row contains (162, testrepo, TestRepo, 0, 105, git, 93eaee3fd7e0ea415987, t, f, null, Testing Repo, null, null).
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2532)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2267)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:510)
at org.postgresql.jdbc.PgStatement.internalExecuteBatch(PgStatement.java:851)
at org.postgresql.jdbc.PgStatement.executeBatch(PgStatement.java:874)
at org.postgresql.jdbc.PgPreparedStatement.executeBatch(PgPreparedStatement.java:1563)
at com.zaxxer.hikari.pool.ProxyStatement.executeBatch(ProxyStatement.java:128)
at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeBatch(HikariProxyPreparedStatement.java)
at org.hibernate.engine.jdbc.batch.internal.BatchingBatch.performExecution(BatchingBatch.java:119)
at org.hibernate.engine.jdbc.batch.internal.BatchingBatch.doExecuteBatch(BatchingBatch.java:105)
at org.hibernate.engine.jdbc.batch.internal.AbstractBatchImpl.execute(AbstractBatchImpl.java:148)
at org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.executeBatch(JdbcCoordinatorImpl.java:198)
at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:633)
at org.hibernate.engine.spi.ActionQueue.lambda$executeActions$1(ActionQueue.java:478)
at java.util.LinkedHashMap.forEach(LinkedHashMap.java:684)
<snip>
Caused by: org.postgresql.util.PSQLException: ERROR: null value in column "is_read_only" violates not-null constraint
Detail: Failing row contains (162, testrepo, TestRepo, 0, 105, git, 93eaee3fd7e0ea415987, t, f, null, Testing Repo, null, null).
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2532)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2267)
... 62 common frames omitted
2022-01-11 13:57:47,656 ERROR [http-nio-7990-exec-3] david.read @7HCOUZx837x154x0 1ikzj8n 172.22.100.224,127.0.0.1 "POST /projects/IO/repos HTTP/1.1" c.a.s.i.w.a.RepositoryAdminController 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.admin.RepositoryAdminController.createRepository(RepositoryAdminController.java:138)
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.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:26)
at com.atlassian.analytics.client.filter.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:48)
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)
... 297 frames trimmed
Caused by: org.hibernate.exception.ConstraintViolationException: could not execute batch
at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:109)
at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:42)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:113)
at org.hibernate.engine.jdbc.batch.internal.BatchingBatch.performExecution(BatchingBatch.java:129)
at org.hibernate.engine.jdbc.batch.internal.BatchingBatch.doExecuteBatch(BatchingBatch.java:105)
at org.hibernate.engine.jdbc.batch.internal.AbstractBatchImpl.execute(AbstractBatchImpl.java:148)
at org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.executeBatch(JdbcCoordinatorImpl.java:198)
at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:633)
at org.hibernate.engine.spi.ActionQueue.lambda$executeActions$1(ActionQueue.java:478)
at java.util.LinkedHashMap.forEach(LinkedHashMap.java:684)
at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:475)
at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:348)
at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:40)
at org.hibernate.event.service.internal.EventListenerGroupImpl.fireEventOnEachListener(EventListenerGroupImpl.java:102)
at org.hibernate.internal.SessionImpl.doFlush(SessionImpl.java:1356)
at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1343)
at com.atlassian.stash.internal.repository.HibernateRepositoryDao.create(HibernateRepositoryDao.java:81)
at com.atlassian.stash.internal.repository.HibernateRepositoryDao.create(HibernateRepositoryDao.java:33)
at com.atlassian.stash.internal.repository.DefaultRepositoryService.createRepositoryInDatabase(DefaultRepositoryService.java:754)
at com.atlassian.stash.internal.repository.DefaultRepositoryService.lambda$null$7(DefaultRepositoryService.java:808)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)
at com.atlassian.stash.internal.repository.DefaultRepositoryService.lambda$createRepositoryWithRetry$8(DefaultRepositoryService.java:807)
at io.atlassian.fugue.retry.RetrySupplier.get(RetrySupplier.java:100)
at com.atlassian.stash.internal.repository.DefaultRepositoryService.createRepositoryWithRetry(DefaultRepositoryService.java:825)
at com.atlassian.stash.internal.repository.DefaultRepositoryService.create(DefaultRepositoryService.java:196)
at com.atlassian.stash.internal.repository.DefaultRepositoryService.create(DefaultRepositoryService.java:94)
... 33 common frames omitted
Caused by: java.sql.BatchUpdateException: Batch entry 0 insert into repository (store_id, description, is_forkable, hierarchy_id, name, project_id, is_public, scm_id, slug, state, id) values (NULL, 'Testing Repo', 'TRUE', '93eaee3fd7e0ea415987', 'TestRepo', 105, 'FALSE', 'git', 'testrepo', 0, 162) was aborted: ERROR: null value in column "is_read_only" violates not-null constraint
Detail: Failing row contains (162, testrepo, TestRepo, 0, 105, git, 93eaee3fd7e0ea415987, t, f, null, Testing Repo, null, null). Call getNextException to see other errors in the batch.
at org.postgresql.jdbc.BatchResultHandler.handleError(BatchResultHandler.java:159)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2268)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:510)
at org.postgresql.jdbc.PgStatement.internalExecuteBatch(PgStatement.java:851)
at org.postgresql.jdbc.PgStatement.executeBatch(PgStatement.java:874)
at org.postgresql.jdbc.PgPreparedStatement.executeBatch(PgPreparedStatement.java:1563)
at com.zaxxer.hikari.pool.ProxyStatement.executeBatch(ProxyStatement.java:128)
at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeBatch(HikariProxyPreparedStatement.java)
at org.hibernate.engine.jdbc.batch.internal.BatchingBatch.performExecution(BatchingBatch.java:119)
... 55 common frames omitted
Next exception: org.postgresql.util.PSQLException: ERROR: null value in column "is_read_only" violates not-null constraint
Detail: Failing row contains (162, testrepo, TestRepo, 0, 105, git, 93eaee3fd7e0ea415987, t, f, null, Testing Repo, null, null).
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2532)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2267)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:510)
at org.postgresql.jdbc.PgStatement.internalExecuteBatch(PgStatement.java:851)
at org.postgresql.jdbc.PgStatement.executeBatch(PgStatement.java:874)
at org.postgresql.jdbc.PgPreparedStatement.executeBatch(PgPreparedStatement.java:1563)
at com.zaxxer.hikari.pool.ProxyStatement.executeBatch(ProxyStatement.java:128)
at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeBatch(HikariProxyPreparedStatement.java)
at org.hibernate.engine.jdbc.batch.internal.BatchingBatch.performExecution(BatchingBatch.java:119)
at org.hibernate.engine.jdbc.batch.internal.BatchingBatch.doExecuteBatch(BatchingBatch.java:105)
at org.hibernate.engine.jdbc.batch.internal.AbstractBatchImpl.execute(AbstractBatchImpl.java:148)
at org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.executeBatch(JdbcCoordinatorImpl.java:198)
<snip>
Caused by: org.postgresql.util.PSQLException: ERROR: null value in column "is_read_only" violates not-null constraint
Detail: Failing row contains (162, testrepo, TestRepo, 0, 105, git, 93eaee3fd7e0ea415987, t, f, null, Testing Repo, null, null).
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2532)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2267)
... 62 common frames omitted
Does anyone have any suggestions? The "is_read_only" column in the table is set to require a value and does not have a default value assigned. I could set this but obviously hesitant to make any changes here without knowing consequences.
Thanks in advance.