After setting up Confluence staging instance refreshed from production, cannot create space/page
Asked by Bryan Guffey:

I get the following error when trying to create spaces or pages in my staging instances of Confluence:

![CleanShot 2022-04-30 at 14.25.33.png](https://community.atlassian.com/t5/image/serverpage/image-id/195390i81A01C542A621AB1/image-size/large?v=v2&px=999 "CleanShot 2022-04-30 at 14.25.33.png")

Both of the database instances are Azure SQL, so they are on the current version.

Here is what is in the logs when we're doing diagnostic logging. I expect this is somewhat a database issue somewhere, because Confluence is referencing production.dbo.SPACES - but this would not exist in the new database created from the backup of the previous database, because the new database is not called production - it has a different name:

2022-04-30 16:16:28,132 ERROR \[https-jsse-nio2-8443-exec-22\] \[engine.jdbc.spi.SqlExceptionHelper\] logExceptions Reference to database and/or server name in 'production.dbo.SPACES' is not supported in this version of SQL Server.  
-- referer: <https://confluencesandbox.ntst.com:8443/admin/viewlog4j.action> \| url: /rest/create-dialog/1.0/space-blueprint/create-space \| traceId: 130fbb311b51bcdc \| userName: BGuffey  
2022-04-30 16:16:28,133 ERROR \[https-jsse-nio2-8443-exec-22\] \[core.persistence.hibernate.HibernateObjectDao\] reIndex Unable to reIndex object: spacedesc: Create Space v.1 (51019779) -- Failed to add entry to queue  
-- referer: <https://confluencesandbox.ntst.com:8443/admin/viewlog4j.action> \| url: /rest/create-dialog/1.0/space-blueprint/create-space \| traceId: 130fbb311b51bcdc \| userName: BGuffey  
com.atlassian.confluence.api.service.exceptions.ServiceException: Failed to add entry to queue  
Caused by: org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute statement; SQL \[n/a\]; nested exception is org.hibernate.exception.SQLGrammarException: could not execute statement  
Caused by: org.hibernate.exception.SQLGrammarException: could not execute statement  
at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:106)  
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Reference to database and/or server name in 'production.dbo.SPACES' is not supported in this version of SQL Server.  
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:260)  
at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1547)  
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:528)  
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:461)  
at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7342)  
at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:2688)  
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:224)  
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:204)  
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeUpdate(SQLServerPreparedStatement.java:408)  
at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61)  
at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPreparedStatement.java)  
at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:175)  
... 490 more  
2022-04-30 16:16:28,188 ERROR \[https-jsse-nio2-8443-exec-22\] \[org.hibernate.AssertionFailure\] \<init\> HHH000099: an assertion failure occurred (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session): org.hibernate.AssertionFailure: null id in com.atlassian.confluence.impl.journal.JournalEntry entry (don't flush the Session after an exception occurs)  
-- referer: <https://confluencesandbox.ntst.com:8443/admin/viewlog4j.action> \| url: /rest/create-dialog/1.0/space-blueprint/create-space \| traceId: 130fbb311b51bcdc \| userName: BGuffey  
2022-04-30 16:16:28,190 WARN \[https-jsse-nio2-8443-exec-22\] \[confluence.impl.hibernate.ConfluenceHibernateTransactionManager\] doRollback Performing rollback. Transactions:  
-\>\[com.atlassian.confluence.spaces.DefaultSpaceManager.createSpace\]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT (Session #1550088789)  
-- referer: <https://confluencesandbox.ntst.com:8443/admin/viewlog4j.action> \| url: /rest/create-dialog/1.0/space-blueprint/create-space \| traceId: 130fbb311b51bcdc \| userName: BGuffey  
2022-04-30 16:16:28,193 ERROR \[https-jsse-nio2-8443-exec-22\] \[plugins.createcontent.exceptions.RestExceptionMapper\] toResponse  
-- referer: <https://confluencesandbox.ntst.com:8443/admin/viewlog4j.action> \| url: /rest/create-dialog/1.0/space-blueprint/create-space \| traceId: 130fbb311b51bcdc \| userName: BGuffey  
java.lang.reflect.UndeclaredThrowableException  
at com.sun.proxy.$Proxy123.createDefaultSpacePermissions(Unknown Source)  
at com.atlassian.confluence.security.SpacePermissionCoordinator.createDefaultSpacePermissions(SpacePermissionCoordinator.java:122)

Caused by: java.lang.reflect.InvocationTargetException  
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)  
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)  
at java.base/java.lang.reflect.Method.invoke(Unknown Source)  
at com.atlassian.confluence.impl.security.SpacePermissionManagerFactory.lambda$new$0(SpacePermissionManagerFactory.java:68)  
... 401 more  
Caused by: org.hibernate.AssertionFailure: null id in com.atlassian.confluence.impl.journal.JournalEntry entry (don't flush the Session after an exception occurs)  
at org.hibernate.event.internal.DefaultFlushEntityEventListener.checkId(DefaultFlushEntityEventListener.java:60)  
at org.hibernate.event.internal.DefaultFlushEntityEventListener.getValues(DefaultFlushEntityEventListener.java:175)  
at org.hibernate.event.internal.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:135)  
at org.hibernate.event.internal.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:216)  
at org.hibernate.event.internal.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:85)  
at org.hibernate.event.internal.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:44)  
at org.hibernate.internal.SessionImpl.autoFlushIfRequired(SessionImpl.java:1398)  
at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1483)  
at org.hibernate.query.internal.AbstractProducedQuery.doList(AbstractProducedQuery.java:1445)  
at org.hibernate.query.internal.AbstractProducedQuery.list(AbstractProducedQuery.java:1414)  
at com.atlassian.confluence.setup.bandana.persistence.dao.hibernate.HibernateConfluenceBandanaRecordDao.lambda$getRecord$0(HibernateConfluenceBandanaRecordDao.java:52)  
at org.springframework.orm.hibernate5.HibernateTemplate.doExecute(HibernateTemplate.java:385)  
at org.springframework.orm.hibernate5.HibernateTemplate.execute(HibernateTemplate.java:337)  
at com.atlassian.confluence.setup.bandana.persistence.dao.hibernate.HibernateConfluenceBandanaRecordDao.getRecord(HibernateConfluenceBandanaRecordDao.java:48)  
at com.atlassian.confluence.setup.bandana.ConfluenceDaoBandanaPersister.retrieve(ConfluenceDaoBandanaPersister.java:29)  
at com.atlassian.confluence.impl.bandana.ReadThroughCachingBandanaPersister.lambda$retrieve$0(ReadThroughCachingBandanaPersister.java:84)  
at com.atlassian.confluence.impl.cache.ReadThroughAtlassianCache.lambda$get$0(ReadThroughAtlassianCache.java:76)  
at com.atlassian.confluence.cache.CacheOperations.lambda$get$0(CacheOperations.java:172)  
at java.base/java.util.HashMap.computeIfAbsent(Unknown Source)  
at com.atlassian.confluence.cache.CacheOperations.get(CacheOperations.java:172)  
at com.atlassian.confluence.cache.DeferredOperationsCache.getOrLoad(DeferredOperationsCache.java:93)  
at com.atlassian.confluence.cache.DeferredOperationsCache.get(DeferredOperationsCache.java:57)  
at com.atlassian.confluence.cache.TransactionalCacheFactory$TransactionalCache.get(TransactionalCacheFactory.java:343)  
at com.atlassian.confluence.impl.cache.ReadThroughAtlassianCache.get(ReadThroughAtlassianCache.java:88)  
at com.atlassian.confluence.impl.cache.ReadThroughCache.get(ReadThroughCache.java:28)  
at com.atlassian.confluence.impl.bandana.ReadThroughCachingBandanaPersister.retrieve(ReadThroughCachingBandanaPersister.java:82)  
at com.atlassian.confluence.impl.bandana.ReadThroughCachingBandanaPersister.retrieve(ReadThroughCachingBandanaPersister.java:75)  
at jdk.internal.reflect.GeneratedMethodAccessor292.invoke(Unknown Source)  
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)  
at java.base/java.lang.reflect.Method.invoke(Unknown Source)  
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343)  
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)  
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)  
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:295)  
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)  
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)  
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)  
at com.sun.proxy.$Proxy84.retrieve(Unknown Source)  
at com.atlassian.bandana.DefaultBandanaManager.getValue(DefaultBandanaManager.java:32)  
at com.atlassian.bandana.DefaultBandanaManager.getValue(DefaultBandanaManager.java:24)  
at com.atlassian.confluence.security.DefaultSpacePermissionDefaultsStore.getBandanaValue(DefaultSpacePermissionDefaultsStore.java:143)  
at com.atlassian.confluence.security.DefaultSpacePermissionDefaultsStore.loadFromBandana(DefaultSpacePermissionDefaultsStore.java:46)  
at com.atlassian.confluence.security.DefaultSpacePermissionDefaultsStore.\<init\>(DefaultSpacePermissionDefaultsStore.java:42)  
at com.atlassian.confluence.security.DefaultSpacePermissionDefaultsStoreFactory.createStore(DefaultSpacePermissionDefaultsStoreFactory.java:22)  
at com.atlassian.confluence.security.DefaultSpacePermissionManager.createDefaultSpacePermissions(DefaultSpacePermissionManager.java:299)  
... 406 more


Answers:
author: Bryan Guffey
body: This is an accidental duplicate - please see here: [Cannot create space/page after setting up staging ... (atlassian.com)](https://community.atlassian.com/t5/Confluence-questions/Cannot-create-space-page-after-setting-up-staging-instance-of/qaq-p/2016469#U2016651)


author: Brant Schroeder
body: [@Bryan Guffey](/t5/user/viewprofilepage/user-id/325853) What version of SQL server is running on your azure instance?

comments: author: Bryan Guffey
body: [@Brant Schroeder](/t5/user/viewprofilepage/user-id/769100) Azure SQL is always running the latest stable version of SQL Server - this is not a SQL Server installation on an Azure VM, but the Azure SQL Database.


Tags: confluence-server

database

server