Cannot upload to SFTP external storage: Backends provided no user object
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start at apps/backup/lib/Service/ExternalFolderService.php around lines 385, 452, and 543, following the upload path from apps/backup/lib/Service/UploadService.php and the cron entry in apps/backup/lib/Cron/Manage.php. Compare this flow with the files_versions listener at FileEventsListener.php lines 107, 209, and 357, then reproduce the SFTP upload failure and verify that the restore point uploads without the reported NoUserException.
Written by the indexing model from the issue text.
Description
When trying to upload a restore point to a sftp external storage, the process crashes:
[files] Error: OC\User\NoUserException: Backends provided no user object at <<closure>>
0. <<closure>>
OC\Files\Node\Root->getUserFolder()
1. /var/www/nextcloud/lib/private/Files/Node/LazyFolder.php line 74
call_user_func_array()
2. /var/www/nextcloud/lib/private/Files/Node/LazyRoot.php line 40
OC\Files\Node\LazyFolder->__call()
3. /var/www/nextcloud/apps/files_versions/lib/Listener/FileEventsListener.php line 357
OC\Files\Node\LazyRoot->getUserFolder()
4. /var/www/nextcloud/apps/files_versions/lib/Listener/FileEventsListener.php line 209
OCA\Files_Versions\Listener\FileEventsListener->getPathForNode()
5. /var/www/nextcloud/apps/files_versions/lib/Listener/FileEventsListener.php line 107
OCA\Files_Versions\Listener\FileEventsListener->write_hook()
6. /var/www/nextcloud/lib/private/EventDispatcher/ServiceEventListener.php line 86
OCA\Files_Versions\Listener\FileEventsListener->handle()
7. /var/www/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php line 251
OC\EventDispatcher\ServiceEventListener->__invoke()
8. /var/www/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php line 73
Symfony\Component\EventDispatcher\EventDispatcher->callListeners()
9. /var/www/nextcloud/lib/private/EventDispatcher/EventDispatcher.php line 94
Symfony\Component\EventDispatcher\EventDispatcher->dispatch()
10. /var/www/nextcloud/lib/private/EventDispatcher/EventDispatcher.php line 106
OC\EventDispatcher\EventDispatcher->dispatch()
11. /var/www/nextcloud/lib/private/Files/Node/HookConnector.php line 112
OC\EventDispatcher\EventDispatcher->dispatchTyped()
12. /var/www/nextcloud/lib/private/legacy/OC_Hook.php line 105
OC\Files\Node\HookConnector->write()
13. /var/www/nextcloud/lib/private/Files/View.php line 1252
OC_Hook::emit()
14. /var/www/nextcloud/lib/private/Files/View.php line 1126
OC\Files\View->runHooks()
15. /var/www/nextcloud/lib/private/Files/View.php line 670
OC\Files\View->basicOperation()
16. /var/www/nextcloud/lib/private/Files/Node/File.php line 73
OC\Files\View->file_put_contents()
17. /var/www/nextcloud/apps/backup/lib/Service/ExternalFolderService.php line 543
OC\Files\Node\File->putContent()
18. /var/www/nextcloud/apps/backup/lib/Service/ExternalFolderService.php line 452
OCA\Backup\Service\ExternalFolderService->updateMetadataFile("*** sensitive parameters replaced ***")
19. /var/www/nextcloud/apps/backup/lib/Service/ExternalFolderService.php line 385
OCA\Backup\Service\ExternalFolderService->createPoint("*** sensitive parameters replaced ***")
20. /var/www/nextcloud/apps/backup/lib/Service/UploadService.php line 318
OCA\Backup\Service\ExternalFolderService->confirmPoint()
21. /var/www/nextcloud/apps/backup/lib/Service/UploadService.php line 178
OCA\Backup\Service\UploadService->uploadToExternalFolder()
22. /var/www/nextcloud/apps/backup/lib/Cron/Manage.php line 149
OCA\Backup\Service\UploadService->uploadPoint()
23. /var/www/nextcloud/apps/backup/lib/Cron/Manage.php line 119
OCA\Backup\Cron\Manage->manage()
24. /var/www/nextcloud/lib/private/BackgroundJob/Job.php line 54
OCA\Backup\Cron\Manage->run()
25. /var/www/nextcloud/lib/private/BackgroundJob/TimedJob.php line 60
OC\BackgroundJob\Job->execute()
26. /var/www/nextcloud/cron.php line 152
OC\BackgroundJob\TimedJob->execute()
at 2023-09-12T03:50:03+00:00
[files] Error: OC\User\NoUserException: Backends provided no user object at <<closure>>
0. <<closure>>
OC\Files\Node\Root->getUserFolder()
1. /var/www/nextcloud/lib/private/Files/Node/LazyFolder.php line 74
call_user_func_array()
2. /var/www/nextcloud/lib/private/Files/Node/LazyRoot.php line 40
OC\Files\Node\LazyFolder->__call()
3. /var/www/nextcloud/apps/files_versions/lib/Listener/FileEventsListener.php line 357
OC\Files\Node\LazyRoot->getUserFolder()
4. /var/www/nextcloud/apps/files_versions/lib/Listener/FileEventsListener.php line 209
OCA\Files_Versions\Listener\FileEventsListener->getPathForNode()
5. /var/www/nextcloud/apps/files_versions/lib/Listener/FileEventsListener.php line 107
OCA\Files_Versions\Listener\FileEventsListener->write_hook()
6. /var/www/nextcloud/lib/private/EventDispatcher/ServiceEventListener.php line 86
OCA\Files_Versions\Listener\FileEventsListener->handle()
7. /var/www/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php line 251
OC\EventDispatcher\ServiceEventListener->__invoke()
8. /var/www/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php line 73
Symfony\Component\EventDispatcher\EventDispatcher->callListeners()
9. /var/www/nextcloud/lib/private/EventDispatcher/EventDispatcher.php line 94
Symfony\Component\EventDispatcher\EventDispatcher->dispatch()
10. /var/www/nextcloud/lib/private/EventDispatcher/EventDispatcher.php line 106
OC\EventDispatcher\EventDispatcher->dispatch()
11. /var/www/nextcloud/lib/private/Files/Node/HookConnector.php line 112
OC\EventDispatcher\EventDispatcher->dispatchTyped()
12. /var/www/nextcloud/lib/private/legacy/OC_Hook.php line 105
OC\Files\Node\HookConnector->write()
13. /var/www/nextcloud/lib/private/Files/View.php line 1252
OC_Hook::emit()
14. /var/www/nextcloud/lib/private/Files/View.php line 1126
OC\Files\View->runHooks()
15. /var/www/nextcloud/lib/private/Files/View.php line 670
OC\Files\View->basicOperation()
16. /var/www/nextcloud/lib/private/Files/Node/File.php line 73
OC\Files\View->file_put_contents()
17. /var/www/nextcloud/apps/backup/lib/Service/ExternalFolderService.php line 543
OC\Files\Node\File->putContent()
18. /var/www/nextcloud/apps/backup/lib/Service/ExternalFolderService.php line 452
OCA\Backup\Service\ExternalFolderService->updateMetadataFile("*** sensitive parameters replaced ***")
19. /var/www/nextcloud/apps/backup/lib/Service/ExternalFolderService.php line 385
OCA\Backup\Service\ExternalFolderService->createPoint("*** sensitive parameters replaced ***")
20. /var/www/nextcloud/apps/backup/lib/Service/UploadService.php line 318
OCA\Backup\Service\ExternalFolderService->confirmPoint()
21. /var/www/nextcloud/apps/backup/lib/Service/UploadService.php line 178
OCA\Backup\Service\UploadService->uploadToExternalFolder()
22. /var/www/nextcloud/apps/backup/lib/Cron/Manage.php line 149
OCA\Backup\Service\UploadService->uploadPoint()
23. /var/www/nextcloud/apps/backup/lib/Cron/Manage.php line 119
OCA\Backup\Cron\Manage->manage()
24. /var/www/nextcloud/lib/private/BackgroundJob/Job.php line 54
OCA\Backup\Cron\Manage->run()
25. /var/www/nextcloud/lib/private/BackgroundJob/TimedJob.php line 60
OC\BackgroundJob\Job->execute()
26. /var/www/nextcloud/cron.php line 152
OC\BackgroundJob\TimedJob->execute()
at 2023-09-12T03:50:03+00:00
There are a little more details in the initial forum post I initially opened.
Nextcloud: 27.0.2
Backup: 1.2.0
The SFTP server is a Hetzner storage box, with login/username auth.
- Dominant language
- PHP
- Stars
- 272
- Forks
- 37
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nextcloud/backup
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
Difficulty 1/5 Under an hour Newbie friendliness 70/100
-
Update to NX 32 Open
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
Update to NX 30 Open
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
All issues in nextcloud/backup
Similar issues
-
jira-created
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 1/5 Under an hour Newbie friendliness 70/100
nunomaduro/phpinsights#745 ·
-
status/awaiting_triage
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
WordPress/plugin-check#1486 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
az-digital/az_quickstart#6019 ·