Duplicate space appears in Space Directory

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. 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.

*Except Fisheye and Crucible

Summary

When navigating to the Space Directory page in Confluence, you will see a space with a duplicate entry.

ximage

Diagnosis

This is the behaviour observed:

  1. Rebuilding the index doesn't help resolve the issue.

  2. Clicking on each space will link the user to the same exact space.

  3. Adding one space to the user's "favourites" will favourite the other as well.

  4. 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.

  5. You will also notice that one of your other spaces in the site will be missing in the Space Directory.

  6. 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';

Cause

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.

  1. content_type='SPACEDESCRIPTION'

  2. spaceid=1234; where 1234 is the spaceid value from the spaces 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

Solution

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:

  1. Reindex Confluence.

  2. Flush Confluence cache by navigating to:

    • Confluence Administration > General Configuration > Cache Management > Flush All

  3. Access the Space Directory again and you'll see the duplicate is no longer present.

Updated on June 11, 2025

Still need help?

The Atlassian Community is here for you.