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.
We had the same thing.
The workaround was to use the OLD Space Export.
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=
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you, great find!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If I copy space so backup is working
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Radek Dostál Anyway, I got workaround, I think it is enough. :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.