Confluence Update from 3.5.7 to 4.0: Database mirgration fails

Dennis Bayer September 20, 2011

I tried to update to 4.0 but in several tries I always end up in a failure like this. The first try ended up in "Contraint already exits: Bandana ..." So I did a revert to the old installation. Try #2 and #3 ended in a migration issue too (every time a different one raised).

Is this a known issue? At the moment I cannot find a hint in the documentation.

[atlassian.confluence.upgrade.UpgradeLauncherServletContextListener] contextInitialized Upgrade failed, application will not start: Upgrade task com.atlassian.confluence.upgrade.upgradetask.ContentPermissionConstraintsUpgradeTask@6f4ea4a2 failed during the SCHEMA_UPGRADE phase due to: StatementCallback; bad SQL grammar [alter table CONTENT_PERM alter column CPS_ID set not null, add constraint cp_unique_user unique (CPS_ID, CP_TYPE, USERNAME), add constraint cp_unique_group unique (CPS_ID, CP_TYPE, GROUPNAME)]; nested exception is org.postgresql.util.PSQLException: FEHLER: Relation »cp_unique_user« existiert bereits

4 answers

1 accepted

3 votes
Answer accepted
Adam Laskowski
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 20, 2011

There is a known issue for SQL Server that causes upgrades to fail due to some exisitng database constraints. The bug is outlined here:

CONF-23193

The provided SQL queries in the workaround should allow you to complete your upgrade:

alter table CONTENT_PERM drop constraint cp_unique_user;
  alter table CONTENT_PERM drop constraint cp_unique_group;

Since your upgrade failed, you'll still need to roll back to your backup before running the queries.

Dennis Bayer September 20, 2011

Hi,
executing the given commands solved the issue. Confluence 4 is running. :) thx.

Nevertheless I had to execute an additional command:

alter table CONTENT_PERM_SET drop constraint cps_unique_type;

0 votes
Mezzanotte November 3, 2011

I had this bandana problems too.

What solved my problem is:

1. Do an upgrade from 3.5.7 to 3.5.9

2. Run the SQLs

alter table CONTENT_PERM drop constraint cp_unique_user;
alter table CONTENT_PERM drop constraint cp_unique_group;
alter table CONTENT_PERM_SET drop constraint cps_unique_type;

3. Do the upgrade to 4.0

Regards,

Mezza


					
				
			
			
			
				
			
			
			
			
			
			
		
0 votes
Steffen Becker September 21, 2011

We're running into the same Problem upgrading from 3.5.9. After the first failure we thought it might be a good idea to upgrade to 3.5.13 first an then going to 4.0. But the error allready occures when trying to upgrade from 3.5.9 to 3.5.13.

I can post the full log if it helps as there are some more errors in the eventlog

Regards

Steffen

0 votes
HuseinA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 20, 2011

That sounds you are hitting this new bug CONF-23248. The current workaround is to run the following SQL queries before you re-run the upgrade:

delete from CONTENT_PERM where CPS_ID is null;
delete from CONTENT_PERM_SET where CONTENT_ID is null;

Dennis Bayer September 20, 2011

Hi,
I tried these queries too, but postgress reported that none rows were affected. Thx anyways for the quick response. :)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events