Confluence cannot make a backup

Tony Montana
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 22, 2023

Hi!

Confluence cannot make a backup

WARN [ConfluenceBackupRestoreManager:thread-1] [confluence.impl.backuprestore.ConfluenceBackupRestoreManager] updateJobStateAfterCompletion Backup restore job BackupRestoreJob{id=17727489, jobOperation=BACKUP, jobScope=SPACE, jobState=PROCESSING, createTime=2023-11-22T08:15:48Z, startProcessingTime=2023-11-22T08:15:48Z, finishProcessingTime=null, cancelTime=null, owner='montana@supersite.net', whoCancelledTheJob='null', errorMessage='null'} failed: java.util.concurrent.ExecutionException: java.lang.NullPointerException: Cannot invoke \"com.atlassian.sal.api.user.UserKey.getStringValue()\" because \"userKey\" is null

Why?

 

I forgot to add that the problem is only with this space. All others are backed up well.

2 answers

2 accepted

2 votes
Answer accepted
Mårten Woxberg
Contributor
November 22, 2023

We had the same thing.

The workaround was to use the OLD Space Export.

Mårten Woxberg
Contributor
December 3, 2023

And since I didn't write down the workaround and had to find it again for myself here it is.

https://<url>/spaces/exportspacexml.action?key=

Like Esther Lansbergen likes this
Miklos Tix
Contributor
January 18, 2024

@Mårten Woxberg you da best, thanks for this, worked like a charm! :)

Like Mårten Woxberg likes this
Esther Lansbergen January 30, 2024

Thanks!

 

Like Mårten Woxberg likes this
Gary Smolyak
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 13, 2024

Thank you, great find!

Like Mårten Woxberg likes this
0 votes
Answer accepted
Radek Dostál
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 22, 2023

I'm not familiar with that in particular, but the message is a pointer:

Cannot invoke \"com.atlassian.sal.api.user.UserKey.getStringValue()\" because \"userKey\" is null


Each user must have a userkey, that's how Confluence maps a lot of stuff.

 

I wonder if any of these will return anything - can you access the db?

SELECT * FROM user_mapping WHERE user_key IS NULL;

SELECT id,user_name FROM cwd_user WHERE lower_user_name NOT IN (SELECT lower_username FROM user_mapping);


Not to say these are the definitive answer, but that's where I'd start looking for a null key. Either one should return the offending user or users.

Tony Montana
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 22, 2023

@Radek Dostál Postrgres

confdb1=# SELECT * FROM user_mapping WHERE user_key IS NULL;

SELECT id,user_name FROM cwd_user WHERE lower_user_name NOT IN (SELECT lower_username FROM user_mapping);
user_key | username | lower_username
----------+----------+----------------
(0 rows)

id | user_name
----+-----------
(0 rows)

 I forgot to add that the problem is only with this space. All others are backed up well.

Tony Montana
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 22, 2023

If I copy space so backup is working

Radek Dostál
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 22, 2023

Mhm, then I'm thinking during the export it tries to load some user reference (mention, author, etc.) and fails on that..

 

If you would be able to find the stacktrace from the backup job, we might see which methods it goes through before it throw the nullpointer. Then that would likely point us towards where to look next, what kind of content it is about.

 

The job should throw and print that to atlassian-confluence.log when it stops, perhaps grepping for 'NullPointerException' should make that search easy.

 

If the space copy works for you then perhaps this might not need solving in the end, it's not like this would seem to be anywhere common, at least internet search comes up empty.

Tony Montana
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 22, 2023
2023-11-22 14:27:32,793 INFO [ConfluenceBackupRestoreManager:thread-11] [impl.backuprestore.backup.SpaceBackupService] doBackupSynchronously SPACE backup [17727492] with keys [ADH] has started.
2023-11-22 14:27:32,803 INFO [ConfluenceBackupRestoreManager:thread-11] [impl.backuprestore.backup.AbstractBackupService] performBackup SPACE backup [17727492] is now backing up entities and attachments.
2023-11-22 14:27:37,732 WARN [ConfluenceBackupRestoreManager:thread-11] [confluence.impl.backuprestore.ConfluenceBackupRestoreManager] updateJobStateAfterCompletion Backup restore job BackupRestoreJob{id=17727492, jobOperation=BACKUP, jobScope=SPACE, jobState=PROCESSING, createTime=2023-11-22T12:27:32Z, startProcessingTime=2023-11-22T12:27:32Z, finishProcessingTime=null, cancelTime=null, owner='montana@supersite.net', whoCancelledTheJob='null', errorMessage='null'} failed: java.util.concurrent.ExecutionException: java.lang.NullPointerException: Cannot invoke \"com.atlassian.sal.api.user.UserKey.getStringValue()\" because \"userKey\" is null
-- url: /rest/api/backup-restore/backup/space | userName: montana@supersite.net | referer: https://kb.supersite.net/plugins/servlet/backup-and-restore/backup | traceId: f15aa0cdb33b028a
com.atlassian.confluence.backuprestore.exception.BackupRestoreException: java.util.concurrent.ExecutionException: java.lang.NullPointerException: Cannot invoke "com.atlassian.sal.api.user.UserKey.getStringValue()" because "userKey" is null
at com.atlassian.confluence.impl.backuprestore.backup.SpaceBackupService.doBackupSynchronously(SpaceBackupService.java:124)
at com.atlassian.confluence.impl.backuprestore.BackupRestoreJobRunner.runJobSynchronously(BackupRestoreJobRunner.java:58)
at com.atlassian.confluence.impl.backuprestore.ConfluenceBackupRestoreManager.runJobAndUpdateJobProperties(ConfluenceBackupRestoreManager.java:271)
at com.atlassian.confluence.impl.backuprestore.ConfluenceBackupRestoreManager.processJobsFromTheQueue(ConfluenceBackupRestoreManager.java:250)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.util.concurrent.ExecutionException: java.lang.NullPointerException: Cannot invoke "com.atlassian.sal.api.user.UserKey.getStringValue()" because "userKey" is null
at java.base/java.util.concurrent.FutureTask.report(Unknown Source)
at java.base/java.util.concurrent.FutureTask.get(Unknown Source)
at com.atlassian.confluence.impl.backuprestore.ParallelTasksExecutor.waitUntilAllTasksComplete(ParallelTasksExecutor.java:119)
at com.atlassian.confluence.impl.backuprestore.ParallelTasksExecutor.waitUntilAllStageJobsComplete(ParallelTasksExecutor.java:92)
at com.atlassian.confluence.impl.backuprestore.ParallelTasksExecutor.waitUntilAllStageJobsComplete(ParallelTasksExecutor.java:108)
at com.atlassian.confluence.impl.backuprestore.backup.SpaceBackupService.backupAllEntitiesAndAttachments(SpaceBackupService.java:167)
at com.atlassian.confluence.impl.backuprestore.backup.AbstractBackupService.performBackup(AbstractBackupService.java:75)
at com.atlassian.confluence.impl.backuprestore.backup.SpaceBackupService.doBackupSynchronously(SpaceBackupService.java:107)
... 8 more
Caused by: java.lang.NullPointerException: Cannot invoke "com.atlassian.sal.api.user.UserKey.getStringValue()" because "userKey" is null
at com.atlassian.confluence.impl.backuprestore.backup.exporters.UserKeyExtractorFragmentTransformer.lambda$getReferences$0(UserKeyExtractorFragmentTransformer.java:67)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
at java.base/java.util.HashMap$KeySpliterator.forEachRemaining(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source)
at java.base/java.util.stream.ReferencePipeline.collect(Unknown Source)
at com.atlassian.confluence.impl.backuprestore.backup.exporters.UserKeyExtractorFragmentTransformer.getReferences(UserKeyExtractorFragmentTransformer.java:68)
at com.atlassian.confluence.impl.backuprestore.backup.exporters.ReferenceEntityFromBodyContentExtractor.lambda$extractReferenceContentFrom$1(ReferenceEntityFromBodyContentExtractor.java:85)
at java.base/java.util.stream.ReferencePipeline$7$1.accept(Unknown Source)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Unknown Source)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source)
at java.base/java.util.stream.ReferencePipeline.forEach(Unknown Source)
at com.atlassian.confluence.impl.backuprestore.backup.exporters.ReferenceEntityFromBodyContentExtractor.extractReferenceContentFrom(ReferenceEntityFromBodyContentExtractor.java:90)
at com.atlassian.confluence.impl.backuprestore.backup.exporters.BodyContentDataExporter.extractReferencesFromBody(BodyContentDataExporter.java:162)
at com.atlassian.confluence.impl.backuprestore.backup.exporters.BodyContentDataExporter.extractReferencesFromBody(BodyContentDataExporter.java:130)
at com.atlassian.confluence.impl.backuprestore.backup.exporters.BodyContentDataExporter.lambda$exportInBatchByQueryWithCondition$0(BodyContentDataExporter.java:99)
... 4 more

So what. I agree, if I have workaround. But it is strange anyway

Tony Montana
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 22, 2023

@Radek Dostál

2023-11-22 14:27:32,793 INFO [ConfluenceBackupRestoreManager:thread-11] [impl.backuprestore.backup.SpaceBackupService] doBackupSynchronously SPACE backup [17727492] with keys [ADH] has started.
2023-11-22 14:27:32,803 INFO [ConfluenceBackupRestoreManager:thread-11] [impl.backuprestore.backup.AbstractBackupService] performBackup SPACE backup [17727492] is now backing up entities and attachments.
2023-11-22 14:27:37,732 WARN [ConfluenceBackupRestoreManager:thread-11] [confluence.impl.backuprestore.ConfluenceBackupRestoreManager] updateJobStateAfterCompletion Backup restore job BackupRestoreJob{id=17727492, jobOperation=BACKUP, jobScope=SPACE, jobState=PROCESSING, createTime=2023-11-22T12:27:32Z, startProcessingTime=2023-11-22T12:27:32Z, finishProcessingTime=null, cancelTime=null, owner='montana@supersite.net', whoCancelledTheJob='null', errorMessage='null'} failed: java.util.concurrent.ExecutionException: java.lang.NullPointerException: Cannot invoke \"com.atlassian.sal.api.user.UserKey.getStringValue()\" because \"userKey\" is null
-- url: /rest/api/backup-restore/backup/space | userName: montana@supersite.net | referer: https://kb.supersite.net/plugins/servlet/backup-and-restore/backup | traceId: f15aa0cdb33b028a
com.atlassian.confluence.backuprestore.exception.BackupRestoreException: java.util.concurrent.ExecutionException: java.lang.NullPointerException: Cannot invoke "com.atlassian.sal.api.user.UserKey.getStringValue()" because "userKey" is null
at com.atlassian.confluence.impl.backuprestore.backup.SpaceBackupService.doBackupSynchronously(SpaceBackupService.java:124)
at com.atlassian.confluence.impl.backuprestore.BackupRestoreJobRunner.runJobSynchronously(BackupRestoreJobRunner.java:58)
at com.atlassian.confluence.impl.backuprestore.ConfluenceBackupRestoreManager.runJobAndUpdateJobProperties(ConfluenceBackupRestoreManager.java:271)
at com.atlassian.confluence.impl.backuprestore.ConfluenceBackupRestoreManager.processJobsFromTheQueue(ConfluenceBackupRestoreManager.java:250)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.util.concurrent.ExecutionException: java.lang.NullPointerException: Cannot invoke "com.atlassian.sal.api.user.UserKey.getStringValue()" because "userKey" is null
at java.base/java.util.concurrent.FutureTask.report(Unknown Source)
at java.base/java.util.concurrent.FutureTask.get(Unknown Source)
at com.atlassian.confluence.impl.backuprestore.ParallelTasksExecutor.waitUntilAllTasksComplete(ParallelTasksExecutor.java:119)
at com.atlassian.confluence.impl.backuprestore.ParallelTasksExecutor.waitUntilAllStageJobsComplete(ParallelTasksExecutor.java:92)
at com.atlassian.confluence.impl.backuprestore.ParallelTasksExecutor.waitUntilAllStageJobsComplete(ParallelTasksExecutor.java:108)
at com.atlassian.confluence.impl.backuprestore.backup.SpaceBackupService.backupAllEntitiesAndAttachments(SpaceBackupService.java:167)
at com.atlassian.confluence.impl.backuprestore.backup.AbstractBackupService.performBackup(AbstractBackupService.java:75)
at com.atlassian.confluence.impl.backuprestore.backup.SpaceBackupService.doBackupSynchronously(SpaceBackupService.java:107)
... 8 more
Caused by: java.lang.NullPointerException: Cannot invoke "com.atlassian.sal.api.user.UserKey.getStringValue()" because "userKey" is null
at com.atlassian.confluence.impl.backuprestore.backup.exporters.UserKeyExtractorFragmentTransformer.lambda$getReferences$0(UserKeyExtractorFragmentTransformer.java:67)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
at java.base/java.util.HashMap$KeySpliterator.forEachRemaining(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source)
at java.base/java.util.stream.ReferencePipeline.collect(Unknown Source)
at com.atlassian.confluence.impl.backuprestore.backup.exporters.UserKeyExtractorFragmentTransformer.getReferences(UserKeyExtractorFragmentTransformer.java:68)
at com.atlassian.confluence.impl.backuprestore.backup.exporters.ReferenceEntityFromBodyContentExtractor.lambda$extractReferenceContentFrom$1(ReferenceEntityFromBodyContentExtractor.java:85)
at java.base/java.util.stream.ReferencePipeline$7$1.accept(Unknown Source)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Unknown Source)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source)
at java.base/java.util.stream.ReferencePipeline.forEach(Unknown Source)
at com.atlassian.confluence.impl.backuprestore.backup.exporters.ReferenceEntityFromBodyContentExtractor.extractReferenceContentFrom(ReferenceEntityFromBodyContentExtractor.java:90)
at com.atlassian.confluence.impl.backuprestore.backup.exporters.BodyContentDataExporter.extractReferencesFromBody(BodyContentDataExporter.java:162)
at com.atlassian.confluence.impl.backuprestore.backup.exporters.BodyContentDataExporter.extractReferencesFromBody(BodyContentDataExporter.java:130)
at com.atlassian.confluence.impl.backuprestore.backup.exporters.BodyContentDataExporter.lambda$exportInBatchByQueryWithCondition$0(BodyContentDataExporter.java:99)
... 4 more

 I agree, it's not important since I have a workaround. But it’s still strange and I’d like to know the reason

Tony Montana
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 22, 2023

@Radek Dostál Anyway, I got workaround, I think it is enough. :)

Radek Dostál
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 23, 2023

Yeah, if workaround works then it's all good.

The most I can read from this is 

Caused by: java.lang.NullPointerException: Cannot invoke "com.atlassian.sal.api.user.UserKey.getStringValue()" because "userKey" is null
[[
at com.atlassian.confluence.impl.backuprestore.backup.exporters.UserKeyExtractorFragmentTransformer.lambda$getReferences$0(UserKeyExtractorFragmentTransformer.java:67)
]]
finally dying trying to extract some missing userkey

[[
at java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
at java.base/java.util.HashMap$KeySpliterator.forEachRemaining(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source)
at java.base/java.util.stream.ReferencePipeline.collect(Unknown Source)
]]
more stream noise, collecting those references

[[
at com.atlassian.confluence.impl.backuprestore.backup.exporters.UserKeyExtractorFragmentTransformer.getReferences(UserKeyExtractorFragmentTransformer.java:68)
]]
getting key references from something

[[
at com.atlassian.confluence.impl.backuprestore.backup.exporters.ReferenceEntityFromBodyContentExtractor.lambda$extractReferenceContentFrom$1(ReferenceEntityFromBodyContentExtractor.java:85)
]]
body content

[[
at java.base/java.util.stream.ReferencePipeline$7$1.accept(Unknown Source)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Unknown Source)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source)
at java.base/java.util.stream.ReferencePipeline.forEach(Unknown Source)
]]
stream noise

[[
at com.atlassian.confluence.impl.backuprestore.backup.exporters.ReferenceEntityFromBodyContentExtractor.extractReferenceContentFrom(ReferenceEntityFromBodyContentExtractor.java:90)
at com.atlassian.confluence.impl.backuprestore.backup.exporters.BodyContentDataExporter.extractReferencesFromBody(BodyContentDataExporter.java:162)
]]
ReferenceEntityFromBodyContentExtractor.extractReferenceContentFrom
so extracting some references from body content

 

So at best, my next guess would have been some form of body content, but that could be anything, pages, comments, blogs. Personally if I had no workaround I'd start looking for comment author keys, then page authors/updaters, and finally whichever ways there are to reference another user. Pain either way.

Turning on TRACE loggers for these packages might also log something more useful, or enabling sql logging might give us a hint what kind of content it is getting before the thread starts processing it.

But anyway.. If it works it works.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
8.4.4
TAGS
AUG Leaders

Atlassian Community Events