It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Confluence Update from 3.5.7 to 4.0: Database mirgration fails

Dennis Bayer Sep 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 Sep 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 Sep 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

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 Sep 20, 2011

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

0 votes
Steffen Becker Sep 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

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


					
				
			
			
			
				
			
			
			
			
			
			
		

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Confluence

6 Awesome Ways to Apply Trello, JIRA and Confluence to your Project

I attended  Atlassian Summit 2019  and learned a lot from the presenters, attendees and knowledgeable Atlassian product managers. The presentations I attended focused on applying Agile, pla...

2,110 views 11 27
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you