Duplicate space appears in Space Directory
プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Fisheye および Crucible は除く
問題
When navigating to the Space Directory page in Confluence, you will see a space with a duplicate entry.
診断
This is the behaviour observed:
- Rebuilding the index doesn't help.
- Clicking on each space will link the user to the same exact space.
- Adding one space to the user's "favourites" will favourite the other as well.
- Searching for the space in the site will come up with two search results and they may differ in their last modified dates. However, they still link to the same, correct space.
- You will also notice that one of your other spaces in the site will be missing in the Space Directory.
Checking the
spaces
table in the Confluence database, we can see that there is only one row with the space key and space name that is duplicated.select * from SPACES where spacekey='TEST';
原因
There are two tables in the Confluence database that are responsible for displaying the content in the Space Directory: spaces
and content
. However, the actual list of spaces being displayed on that page is not dependent on the spaces
table. It actually looks at the content
table and follows these conditions.
content_type='SPACEDESCRIPTION'
spaceid=1234
; where1234
is thespaceid
value from thespaces
table.
In this case, there were two entries in the content
table whose spaceid
columns were pointing to a single space. This resulted in the duplicate to appear.
'content' table
contentid | content_type | spaceid |
---|---|---|
12345 | SPACEDESCRIPTION | 112233 |
67890 | SPACEDESCRIPTION | 112233 |
In the spaces
table, we can see that the space ID referenced in the content
table belongs to Test space, which is the duplicated space. However, that space is only pointing to the first space description, which is denoted by the spacedescid
column. The second is actually being referenced by a completely different space.
'spaces' table
spaceid | title | spacekey | spacedescid |
---|---|---|---|
112233 | Test space | TEST | 12345 |
445566 | Java Programming | JAVA | 67890 |
ソリューション
Based on the DB entries above, the erroneous entry is in the content
table with a content ID of '67890'. We'll need to update its spaceid
value so that it points to the correct space – Java Programming. This can easily be achieved using the query below.
update content set spaceid=445566 where contentid=67890;
Once that is done, you'll need to:
- Reindex Confluence.
- Flush Confluence cache by navigating to:
Confluence Administration > General Configuration > Cache Management > Flush All
- Access the Space Directory again and you'll see the duplicate is no longer present.