S3 upload fails with Argument #1 ($user) must be of type OCP\IUser, null given
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 38/100
Research direction
Reproduce with the provided occ backup:point:upload command, then inspect apps/files_versions/lib/Storage.php around line 230 and lib/Versions/VersionManager.php around line 90. Trace the call from custom_apps/backup/lib/Service/ExternalFolderService.php line 223 and verify that uploading a backup to the S3 external folder completes without the null IUser TypeError.
Written by the indexing model from the issue text.
Description
I can't upload backup archive (packed,compressed,encrypted) to s3, that is mounted as external storage and accessible in files interface. Folders are successfully created on s3, but files upload fails. Looks it tries to upload with a user owner in metadata, as seen in error message, that is inexistant as called from CLI.
NC 24.0.6 with official docker image. Backup 1.1.3.
$ ./occ backup:point:upload 20221018174455-full-xxxx --remote="amazon::external::xxxxxxxxxxxxxxxxxxxxxxxxxxx" -vvv
- uploading 20221018174455-full-xxxx to external folders
- checking external folder 26:ncc
> restoring point not found
* Creating Restoring Point on external folder: ok
> restoring point created
* initiating health check
An unhandled exception has been thrown:
TypeError: OCA\Files_Versions\Versions\VersionManager::createVersion(): Argument #1 ($user) must be of type OCP\IUser, null given, called in /var/www/html/apps/files_versions/lib/Storage.php on line 230 and defined in /var/www/html/apps/files_versions/lib/Versions/VersionManager.php:90
Stack trace:
#0 /var/www/html/apps/files_versions/lib/Storage.php(230): OCA\Files_Versions\Versions\VersionManager->createVersion(NULL, Object(OC\Files\Node\File))
#1 /var/www/html/apps/files_versions/lib/Hooks.php(56): OCA\Files_Versions\Storage::store('/backups3bis/nc...')
#2 /var/www/html/lib/private/legacy/OC_Hook.php(106): OCA\Files_Versions\Hooks::write_hook(Array)
#3 /var/www/html/lib/private/Files/View.php(1290): OC_Hook::emit('OC_Filesystem', 'write', Array)
#4 /var/www/html/lib/private/Files/View.php(1160): OC\Files\View->runHooks(Array, '/backups3bis/nc...')
#5 /var/www/html/lib/private/Files/View.php(711): OC\Files\View->basicOperation('file_put_conten...', '/jeremy/files/bac...', Array, '{\n "id": "20...')
#6 /var/www/html/lib/private/Files/Node/File.php(71): OC\Files\View->file_put_contents('/jeremy/files/bac...', '{\n "id": "20...')
#7 /var/www/html/custom_apps/backup/lib/Service/ExternalFolderService.php(223): OC\Files\Node\File->putContent('{\n "id": "20...')
#8 /var/www/html/custom_apps/backup/lib/Service/ExternalFolderService.php(388): OCA\Backup\Service\ExternalFolderService->getRestoringPoint(Object(OCA\Backup\Model\ExternalFolder), '20221018174455-...', true)
#9 /var/www/html/custom_apps/backup/lib/Service/UploadService.php(318): OCA\Backup\Service\ExternalFolderService->confirmPoint(Object(OCA\Backup\Model\ExternalFolder), Object(OCA\Backup\Model\RestoringPoint))
#10 /var/www/html/custom_apps/backup/lib/Command/PointUpload.php(129): OCA\Backup\Service\UploadService->uploadToExternalFolder(Object(OCA\Backup\Model\RestoringPoint), 0)
#11 /var/www/html/3rdparty/symfony/console/Command/Command.php(255): OCA\Backup\Command\PointUpload->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 /var/www/html/core/Command/Base.php(168): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 /var/www/html/3rdparty/symfony/console/Application.php(1009): OC\Core\Command\Base->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 /var/www/html/3rdparty/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand(Object(OCA\Backup\Command\PointUpload), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 /var/www/html/3rdparty/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 /var/www/html/lib/private/Console/Application.php(211): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#17 /var/www/html/console.php(100): OC\Console\Application->run()
#18 /var/www/html/occ(11): require_once('/var/www/html/c...')
#19 {main}
- 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
-
Solved site promotion gate fails on runner PHP patch drift (expects 8.2.33, runner installs 8.2.34) Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Automattic/blocks-engine#2161 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Automattic/static-site-importer#1824 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
0. Needs triage bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
0. Needs triage 35-feedback bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100