Getting "Could not create unique constraint" Warning in Confluence 3.5 Upgrade
Symptoms
- Using DB2
The following appears in the atlassian-confluence.log
:
2011-09-13 10:59:02,947 WARN [main] [confluence.upgrade.upgradetask.AbstractConstraintCreationUpgradeTask] doUpgrade Could not create unique constraint: alter table cwd_membership add constraint cwd_unique_user_membership unique (parent_id, child_user_id), StatementCallback; bad SQL grammar [alter table cwd_membership add constraint cwd_unique_user_membership unique (parent_id, child_user_id)]; nested exception is com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-542, SQLSTATE=42831, SQLERRMC=CHILD_USER_ID, DRIVER=3.61.65
2011-09-13 10:59:03,019 WARN [main] [confluence.upgrade.upgradetask.AbstractConstraintCreationUpgradeTask] doUpgrade Could not create unique constraint: alter table cwd_user_attribute add constraint cwd_unique_usr_attr unique (directory_id, user_id, attribute_name, attribute_lower_value), StatementCallback; bad SQL grammar [alter table cwd_user_attribute add constraint cwd_unique_usr_attr unique (directory_id, user_id, attribute_name, attribute_lower_value)]; nested exception is com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-542, SQLSTATE=42831, SQLERRMC=ATTRIBUTE_LOWER_VALUE, DRIVER=3.61.65
2011-09-13 10:59:03,092 WARN [main] [confluence.upgrade.upgradetask.AbstractConstraintCreationUpgradeTask] doUpgrade Could not create unique constraint: alter table cwd_group_attribute add constraint cwd_unique_grp_attr unique (directory_id, group_id, attribute_name, attribute_lower_value), StatementCallback; bad SQL grammar [alter table cwd_group_attribute add constraint cwd_unique_grp_attr unique (directory_id, group_id, attribute_name, attribute_lower_value)]; nested exception is com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-542, SQLSTATE=42831, SQLERRMC=ATTRIBUTE_LOWER_VALUE, DRIVER=3.61.65
2011-09-13 10:59:03,100 WARN [main] [confluence.upgrade.upgradetask.AbstractConstraintCreationUpgradeTask] doUpgrade Could not create unique constraint: alter table cwd_membership add constraint cwd_unique_group_membership unique (parent_id, child_group_id), StatementCallback; bad SQL grammar [alter table cwd_membership add constraint cwd_unique_group_membership unique (parent_id, child_group_id)]; nested exception is com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-542, SQLSTATE=42831, SQLERRMC=CHILD_GROUP_ID, DRIVER=3.61.65
Diagnosis
If you encountered the same warning in other databases during upgrade, please contact Atlassian Support.
Cause
The warnings are expected in a DB2 installation and can be safely ignored. DB2 does not support the unique constraint on columns that can contain null, so considers the SQL invalid this is handled and logged as a warning.
Last modified on Mar 30, 2016
Powered by Confluence and Scroll Viewport.