Unable to export a space due to missing content creator in USER_MAPPING table in Confluence Data Center

Still need help?

The Atlassian Community is here for you.

Ask the community


Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server 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

Exporting a Confluence space fails with an error in the UI:

There was an error in the export. Please check your log files.

Environment

This problem was identified in Confluence server and datacenter version 6.15.2. It could also affect later versions of Confluence.

Diagnosis

After the failed export attempt, we can see the following in the atlassian-confluence.log  file:

ERROR [http-nio-8080-exec-48] [atlassian.confluence.servlet.ConfluenceServletDispatcher] sendError Could not execute action
 -- url: /pages/listpermissionpages.action | traceId: 0004de360a84769a | userName: xxxxxx| referer: https://confluence/doauthenticate.action
org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.atlassian.confluence.user.ConfluenceUserImpl#ff8081814c2f3f5e014c2f3ffd9601da]
	at org.hibernate.boot.internal.StandardEntityNotFoundDelegate.handleEntityNotFound(StandardEntityNotFoundDelegate.java:28)
	at org.hibernate.proxy.AbstractLazyInitializer.checkTargetState(AbstractLazyInitializer.java:235)
	at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:157)
	at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:259)
	at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:73)
	at com.atlassian.hibernate.adapter.proxy.JavassistLazyInitializer_ImplementV2Proxy.invoke(JavassistLazyInitializer_ImplementV2Proxy.java:68)
	at com.atlassian.confluence.user.ConfluenceUserImpl_$$_jvstd48_3.getName(ConfluenceUserImpl_$$_jvstd48_3.java)
	at com.atlassian.confluence.security.ContentPermission.compareTo(ContentPermission.java:252)
	at com.atlassian.confluence.security.ContentPermission.compareTo(ContentPermission.java:31)
	at java.util.TreeMap.compare(TreeMap.java:1294)

To verify if the user_key  exists in the table USER_MAPPING, run the following SQL command in the database:

select * from user_mapping where user_key = 'ff8081814c2f3f5e014c2f3ffd9601da';

If no row returns with the command above, then you are affected by this issue.

Cause

The problem is caused by a missing row in the table USER_MAPPING. The content creator user_key no longer exists in that table and when the space XML is being generated, it throws the error above in the logs.

Solution

Always back up the database before running any modification for safety reasons. It's recommended to test the changes first on a staging instance to validate before doing on production.

We must add the missing row to the database using an insert command. In the example below, we have used the user test as a username but note that this user must not be duplicated in the user_mapping table:

insert into user_mapping values ('ff8081814c2f3f5e014c2f3ffd9601da', 'test', 'test');

After committing the changes, attempt to generate a new space XML backup.


Last modified on Sep 18, 2024

Was this helpful?

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