Upgrade Fails with User_Mapping Constraint Error

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

症状

Upgrading Confluence fails. The following appears in the atlassian-confluence.log:

2014-07-16 12:06:40,841 ERROR [main] [atlassian.confluence.upgrade.UpgradeLauncherServletContextListener] contextInitialized 1: StatementCallback; SQL [alter table user_mapping drop constraint user_mapping_unq_lwr_username]; 'user_mapping_unq_lwr_username' is not a constraint.; nested exception is java.sql.SQLException: 'user_mapping_unq_lwr_username' is not a constraint.

原因

 A previous upgrade failed and the database was not rolled back properly to its pre-upgrade state, which caused some inconsistency on the user_mapping table.

This behaviour affects users that are under Confluence version 5.3 and try to upgrade to 5.3 or later.

ソリューション

We recommend testing this resolution in a staging/development instance before applying it in production. And before applying in production, be sure to backup your database.

  1. Upgrade Confluence to the latest version.
  2. If you still see the same error, shutdown Confluence and run the following SQL query to add the constraint to your Confluence database:

    ALTER TABLE [dbo].[user_mapping] ADD  CONSTRAINT [unq_lwr_username] UNIQUE NONCLUSTERED 
    (
    [lower_username] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    GO
    
  3. Start Confluence again to see if that addresses the problem.
  4. If the issue persists rollback your Confluence database to its previous state one more time.
  5. Download a new Confluence archive on the same version as your pre-upgraded version.
  6. Install Confluence using the same database.
  7. Now compare the user_mapping table of both databases
  8. Add or remove any missing constraints from your Confluence database so that the user_mapping table is exactly the same as the vanilla installation.
  9. Try the upgrade again.
最終更新日: 2016 年 2 月 19 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.