Getting 'Duplicate entry' when Using MySQL on OS X
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Symptoms
Using MySQL 5.5.9 or higher
Using OS X
The following appears in the atlassian-confluence.log
:
1
2
3
4
5
2011-04-04 21:38:31,742 ERROR [http-8081-4] [atlassian.confluence.servlet.ConfluenceServletDispatcher] sendError Could not execute action
-- referer: http://localhost:8081/spaces/createspace-start.action | url: /spaces/createspace.action | userName: admin
org.springframework.dao.DataIntegrityViolationException: Hibernate operation: could not insert: [com.atlassian.confluence.spaces.Space#458753]; SQL []; Duplicate entry '458753' for key 'PRIMARY'; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '458753' for key 'PRIMARY'
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '458753' for key 'PRIMARY'
Cause
This is a bug in MySQL being tracked here.
Workaround
Change the lower_case_table_name
to 1 in MySQL configuration file (eg. /etc/my.cnf
):
1
2
lower_case_table_name=1
Resolution
Downgrade MySQL to the supported version.
Was this helpful?