Cannot Add or Remove a Favourite Space from the Dashboard

お困りですか?

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

コミュニティに質問

プラットフォームについて: Data Center - この記事は、Data Center プラットフォームのアトラシアン製品に適用されます。

このナレッジベース記事は製品の Data Center バージョン用に作成されています。Data Center 固有ではない機能の Data Center ナレッジベースは、製品のサーバー バージョンでも動作する可能性はありますが、テストは行われていません。サーバー*製品のサポートは 2024 年 2 月 15 日に終了しました。サーバー製品を利用している場合は、アトラシアンのサーバー製品のサポート終了のお知らせページにて移行オプションをご確認ください。

*Fisheye および Crucible は除く

症状

  1. When you click on the star icon on the dashboard, the icon will change from gray to yellow, but when you refresh the page, the change is lost. 

  2. There are no errors in the log.

診断


次のクエリを実行します。

select count(*) from CONTENT where contentid in (select spaceid from SPACES);

If this returns any rows, you are affected by this issue.

原因

In Confluence 2.3, we introduced a Hi-Lo generator for page and space IDs and ensured that the two were staggered and would never overlap to allow the introduction of clustering.  The upgrade process, however, did not change the existing content and space IDs, which previously could overlap one another.  The code that works behind the scenes of the star icon on the dashboard makes the assumption that a contentID will never be the same as a spaceID.  The overlap in IDs causes the code to break.

ソリューション

These queries are tested for Confluence 3.5 and 4.0. You may need to make adjustments depending on your Confluence version and database specific query language. If you have any questions, please raise a support issue.

tip/resting Created with Sketch.

Make sure you backup your database prior to applying any of the DDLs below.

  1. Run the following queries in a test instance:

    For PostgreSQL:

    # If you installed Confluence prior to the release of 2.0, you may need to uncomment the three excluded queries.  Otherwise, the DESCSPACEID column should not be present in the database.
     
    ALTER TABLE spacepermissions DROP CONSTRAINT fkd33f23beb2dc6081;
    ALTER TABLE content DROP CONSTRAINT fk6382c059b2dc6081;
    ALTER TABLE notifications DROP CONSTRAINT fk594acc8b2dc6081;
    ALTER TABLE pagetemplates DROP CONSTRAINT fkbc7ce96a17d4a070;
    ALTER TABLE pagetemplates DROP CONSTRAINT fkbc7ce96ab2dc6081;
    # ALTER TABLE content DROP CONSTRAINT fk6382c059598614d0;
    update spaces set spaceid = (spaceid + (select max(contentid) * 10 from content));
    update spacepermissions set spaceid = (spaceid + (select max(contentid) * 10 from content));
    update notifications set spaceid = (spaceid + (select max(contentid) * 10 from content));
    update pagetemplates set spaceid = (spaceid + (select max(contentid) * 10 from content));
    update content set spaceid = (spaceid + (select max(contentid) * 10 from content)); #See note below
    # update content set descspaceid = (descspaceid + (select max(contentid) * 10 from content)) where contenttype='SPACEDESCRIPTION' and descspaceid is not null;
    # ALTER TABLE content ADD CONSTRAINT fk6382c059598614d0 FOREIGN KEY (descspaceid) REFERENCES spaces;
    ALTER TABLE spacepermissions ADD CONSTRAINT fkd33f23beb2dc6081 FOREIGN KEY (spaceid) REFERENCES spaces;
    ALTER TABLE content ADD CONSTRAINT fk6382c059b2dc6081 FOREIGN KEY (spaceid) REFERENCES spaces;
    ALTER TABLE notifications ADD CONSTRAINT fk594acc8b2dc6081 FOREIGN KEY (spaceid) REFERENCES spaces;
    ALTER TABLE pagetemplates ADD CONSTRAINT fkbc7ce96a17d4a070 FOREIGN KEY (prevver) REFERENCES pagetemplates(templateid);
    ALTER TABLE pagetemplates ADD CONSTRAINT fkbc7ce96ab2dc6081 FOREIGN KEY (spaceid) REFERENCES spaces; 

    In MySQL (and possibly some other DBs), you will need to replace the update to the spaces table with this query:

    UPDATE CONTENT SET SPACEID = (SPACEID + (SELECT * FROM (SELECT max(CONTENTID) * 10 FROM CONTENT) as tmptable));


    For MySQL:

    alter table SPACEPERMISSIONS drop foreign key FKD33F23BEB2DC6081;
    alter table CONTENT drop foreign key FK6382C059B2DC6081;
    alter table NOTIFICATIONS drop foreign key FK594ACC8B2DC6081;
    alter table PAGETEMPLATES drop foreign key FKBC7CE96A17D4A070;
    alter table PAGETEMPLATES drop foreign key FKBC7CE96AB2DC6081;
    
    update SPACES set spaceid = (spaceid + (select max(contentid) * 10 from CONTENT));
    update SPACEPERMISSIONS set spaceid = (spaceid + (select max(contentid) * 10 from CONTENT));
    update NOTIFICATIONS set spaceid = (spaceid + (select max(contentid) * 10 from CONTENT));
    update PAGETEMPLATES set spaceid = (spaceid + (select max(contentid) * 10 from CONTENT));
    update CONTENT set SPACEID = (SPACEID + (select * from (select max(CONTENTID) * 10 FROM CONTENT) as tmptable));
    
    alter table SPACEPERMISSIONS add CONSTRAINT FKD33F23BEB2DC6081 FOREIGN KEY (`SPACEID`) REFERENCES `SPACES` (`SPACEID`);
    alter table CONTENT add CONSTRAINT FK6382C059B2DC6081 FOREIGN KEY (`spaceid`) REFERENCES `SPACES` (`spaceid`);
    alter table NOTIFICATIONS add CONSTRAINT FK594ACC8B2DC6081 FOREIGN KEY (`SPACEID`) REFERENCES `SPACES` (`SPACEID`);
    alter table PAGETEMPLATES add CONSTRAINT FKBC7CE96A17D4A070 FOREIGN KEY (`PREVVER`) REFERENCES `PAGETEMPLATES` (`TEMPLATEID`);
    alter table PAGETEMPLATES add CONSTRAINT FKBC7CE96AB2DC6081 FOREIGN KEY (`SPACEID`) REFERENCES `SPACES` (`SPACEID`);
  2. Follow the instructions in the resolution section of the 'How to resolve missing attachments in Confluence' to ensure no attachments have been orphaned by the process
最終更新日: 2025 年 1 月 23 日

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

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