System Error on Setup: Failed to create default group: confluence-users

Issue Description:

First install on a new SQL Server 2014 SQL and Windows Server 2008 R2 Machine.

Database has been setup, error appeared when pressing submit on creating a new administrator account for a blank setup.

 

Cause

com.atlassian.core.exception.InfrastructureException: Failed to create default group: confluence-users
    at com.atlassian.confluence.setup.actions.SetupAdministrator.createDefaultGroups(SetupAdministrator.java:84)

caused by: org.springframework.dao.DataIntegrityViolationException: could not execute statement; SQL [n/a]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement
    at org.springframework.orm.hibernate5.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:241)

caused by: org.hibernate.exception.ConstraintViolationException: could not execute statement
    at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:112)

caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Violation of UNIQUE KEY constraint 'UK_esg7ywl12bt4wt5h1ka27m6u3'. Cannot insert duplicate key in object 'dbo.cwd_application'. The duplicate key value is (crowd-embedded).
    at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:260)

Stack Trace:[hide]

com.atlassian.core.exception.InfrastructureException: Failed to create default group: confluence-users
	at com.atlassian.confluence.setup.actions.SetupAdministrator.createDefaultGroups(SetupAdministrator.java:84)
	at com.atlassian.confluence.setup.actions.SetupAdministrator.execute(SetupAdministrator.java:50)
	at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:168)
	at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)
	at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)
	at com.atlassian.confluence.core.ConfluenceWorkflowInterceptor.intercept(ConfluenceWorkflowInterceptor.java:33)

Caused by: org.hibernate.exception.ConstraintViolationException: could not execute statement
	at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:112)
	at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:42)
	at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:111)
	at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:97)
	at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:208)
	at org.hibernate.engine.jdbc.batch.internal.NonBatchingBatch.addToBatch(NonBatchingBatch.java:45)
	at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3003)
	at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3503)
	at org.hibernate.action.internal.EntityInsertAction.execute(EntityInsertAction.java:89)
	at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:586)
	at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:460)
	at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:337)
	at org.hibernate.event.internal.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:50)
	at org.hibernate.internal.SessionImpl.autoFlushIfRequired(SessionImpl.java:1389)
	at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1882)
	at org.hibernate.internal.CriteriaImpl.list(CriteriaImpl.java:366)
	at org.hibernate.internal.CriteriaImpl.uniqueResult(CriteriaImpl.java:388)
	at com.atlassian.crowd.embedded.hibernate2.HibernateGroupDao.lambda$internalFindByName$6(HibernateGroupDao.java:325)
	at org.springframework.orm.hibernate5.HibernateTemplate.doExecute(HibernateTemplate.java:359)
	... 443 more
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Violation of UNIQUE KEY constraint 'UK_esg7ywl12bt4wt5h1ka27m6u3'. Cannot insert duplicate key in object 'dbo.cwd_application'. The duplicate key value is (crowd-embedded).
	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.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:410)
	at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:205)
	... 457 more

        

Referer URL

http://localhost:8090/setup/setupadministrator-start.action

1 answer

0 vote
Ann Worley Atlassian Team Dec 08, 2017

Hi Lulia,

Somehow there is already a value in the in the cwd_application table, then when the setup wizard tries to add it, a unique constraint is violated:

Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Violation of UNIQUE KEY constraint 'UK_esg7ywl12bt4wt5h1ka27m6u3'. Cannot insert duplicate key in object 'dbo.cwd_application'. The duplicate key value is (crowd-embedded)

Since this is a new installation I recommend shutting down Confluence, dropping the database, creating a fresh database and then running the installation again. 

I look forward to hearing how it goes, or any follow up questions.

Thanks,

Ann

Getting the same error. Aa part of migrating confluence 5.10.0 to 6.2.3 in linux.

 

when we mapped the fresh installed confluence instance to the restored DB, first it asked to overwrite the tables, we proceed. and now in next step, it is not allowing us to create admin user and getting the same error as mentioned above. We cant go with fresh DB now as its not handled by us. How we can troubleshoot the issue.

It sounds like the database permissions for the user connecting were wrong.

Your best option is to drop all the tables, then correct all the permissions, ensuring the user has access to do all actions inside its database.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Apr 13, 2018 in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

359 views 20 10
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you