Duplicate space appears in Space Directory
Platform Notice: Server and Data Center Only. This article only applies to Atlassian products on the server and data center platforms.
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.
spacestable 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:
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.
spaceidvalue from the
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.
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.
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