Failed XML import leads to error No row with the given identifier exists

Platform Notice: Cloud and Data Center - This article applies equally to both cloud and data center platforms.

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

Problem

After a failed XML import, attempting to link to a page that was part of the XML import can result in errors when making the following actions:

  1. In a space, configure the sidebar to include a Space Shortcut to a space that was part of the XML backup

  2. The Link location shows: Error retrieving breadcrumbs

    (Auto-migrated image: description temporarily unavailable)
  3. Select Insert

  4. After inserting a link to the erroneous page the page is broken and you see an Oops - an error has occurred page

The following appears in the atlassian-confluence.log

1 2 3 4 5 6 7 8 9 10 11 2017-04-07 13:42:20,735 ERROR [http-nio-8090-exec-14] [plugin.descriptor.web.ConfluenceWebInterfaceManager] getHtml Failed to render web panel: com.atlassian.plugin.web.descriptors.DefaultWebPanelModuleDescriptor$ContextAwareWebPanel@58fbb956 -- url: /display/KEY/Welcome+to+xxx+on+Confluence | traceId: 1e768e496a972180 | userName: xxxxx | action: viewpage | page: 11067117 java.lang.reflect.UndeclaredThrowableException [...] Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.GeneratedMethodAccessor685.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.atlassian.confluence.impl.security.SpacePermissionManagerFactory.lambda$new$0(SpacePermissionManagerFactory.java:70) ... 621 more Caused by: org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.atlassian.confluence.spaces.Space#xxxxxxx]

or

1 caused by: org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getNumberOfAttachments' in class com.atlassian.confluence.themes.PageHelper threw exception org.springframework.orm.hibernate.HibernateObjectRetrievalFailureException: No row with the given identifier exists: [com.atlassian.confluence.spaces.Space#xxxxxxx]; nested exception is net.sf.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.atlassian.confluence.spaces.Space#xxxxxxx] at /pages/page-breadcrumbs.vm[line 11, column 48]

Diagnosis

Diagnostic Steps

Run the following SQL queries to diagnose whether or not the space is missing:

  1. To verify whether the space exists run the following query with the Space# from the error: No row with the given identifier exists: [com.atlassian.confluence.spaces.Space#xxxxxxx]

    1  SELECT * FROM spaces WHERE spaceid=xxxxxxx;
    1. You should receive no results

  2. Then run all four of the below queries to identify any references this non-existent space:

    1  select * from content where spaceid=xxxxxxx;
    1 select * from pagetemplates where spaceid=xxxxxxx;
    1  select * from notifications where spaceid=xxxxxxx;
    1  select * from spacepermissions where spaceid=xxxxxxx;
  3. If you receive any results, move on to the resolution steps

Cause

This issue is caused by an incomplete import or removal of a space. The incomplete space import or removal leads to partial entries in our tables that all reference a space that does not currently exist. When that space is referenced Confluence throws an error as it is unable to find the specified space.

Solution

Resolution

Resolution 1

Restore a backup of your instance from prior to the XML import. This is the recommended way to restore your instance as it will be the easiest and cleanest way to restore your instance to an errorless state.

Resolution 2

If you're unable to restore to a previous backup, then the items can be manually removed via database deletions. Follow the directions for the tables in which you found data. If you encounter issues with foreign keys, please drop and recreate them after the deletion.

Always back up your data before making any database modifications. If possible, test any alter, insert, update, or delete SQL commands on a staging server first.

Deleting data from the content table

1 2 3 4 5 6 7 8 delete from USERCONTENT_RELATION where TARGETCONTENTID in (select CONTENTID from CONTENT where SPACEID='xxxxxxx'); delete from links where contentid in (select contentid from content where spaceid='xxxxxxx'); delete from imagedetails where attachmentid in(select contentid FROM content where spaceid='xxxxxxx'); delete from attachments where pageid in (SELECT contentid FROM content where spaceid='xxxxxxx'); delete from notifications where contentid in (select contentid from content where spaceid='xxxxxxx'); delete from confancestors where descendentid in (select contentid from content where spaceid='xxxxxxx'); delete from bodycontent where contentid in (select contentid from content where spaceid='xxxxxxx'); delete from content where where spaceid='xxxxxxx';

Deleting data from the pagetemplates table

1  DELETE FROM pagetemplates WHERE spaceid='xxxxxxx';

Deleting data from the notifications table

1  DELETE FROM pagetemplates WHERE spaceid='xxxxxxx';

Deleting data from the spacepermissions table

1  DELETE FROM spacepermissions WHERE spaceid='xxxxxxx';
Updated on April 24, 2025

Still need help?

The Atlassian Community is here for you.