Failed XML import leads to errors: No row with the given identifier exists: [com.atlassian.confluence.spaces.Space#xxxxxx

Still need help?

The Atlassian Community is here for you.

Ask the community

 

Platform Notice: Server, Data Center, and Cloud By Request - This article was written for the Atlassian server and data center platforms but may also be useful for Atlassian Cloud customers. If completing instructions in this article would help you, please contact Atlassian Support and mention it.

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

 

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


  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

 

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

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]

     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:

     select * from content where spaceid=xxxxxxx;
    select * from pagetemplates where spaceid=xxxxxxx;
     select * from notifications where spaceid=xxxxxxx;
     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.

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 performing any modifications to the database. If possible, test any alter, insert, update, or delete SQL commands on a staging server first.

Deleting data from the content table

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

 DELETE FROM pagetemplates WHERE spaceid='xxxxxxx';

 

Deleting data from the notifications table

 DELETE FROM pagetemplates WHERE spaceid='xxxxxxx';

 

Deleting data from the spacepermissions table

 DELETE FROM spacepermissions WHERE spaceid='xxxxxxx';
Last modified on Sep 30, 2022

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.