Unable to complete backup over SFTP
Open
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 272
- Forks
- 37
- PR merge metrics
- No merged PRs in 30d
Description
NC 24.0.4
Backup app 113
Backup fails after writing some metadata to external storage.
Fails when the backup is configured to write over sftp
Any idea?
/home/user/cloud $ php occ backup:point:create
> maintenance mode: on
> initialization of the AppData
> initialization of the RestoringPoint: 20220905085730-full-cwsnFq9muHLAMoe based on NC24.0.4.1
> initialization of the storage
> preparation of the data to be stored in the restoring point
> preparation of internal data
> maintenance mode: off
An unhandled exception has been thrown:
TypeError: fwrite(): Argument #1 ($stream) must be of type resource, bool given in /home/user/cloud/lib/private/Files/Storage/Common.php:209
Stack trace:
#0 /home/user/cloud/lib/private/Files/Storage/Common.php(209): fwrite(false, '')
#1 /home/user/cloud/lib/private/Files/Storage/Wrapper/Wrapper.php(258): OC\Files\Storage\Common->file_put_contents('backup/20220905...', '')
#2 /home/user/cloud/lib/private/Files/Storage/Wrapper/PermissionsMask.php(112): OC\Files\Storage\Wrapper\Wrapper->file_put_contents('backup/20220905...', '')
#3 /home/user/cloud/lib/private/Files/Storage/Wrapper/Wrapper.php(258): OC\Files\Storage\Wrapper\PermissionsMask->file_put_contents('backup/20220905...', '')
#4 /home/user/cloud/lib/private/Files/Storage/Wrapper/Availability.php(274): OC\Files\Storage\Wrapper\Wrapper->file_put_contents('backup/20220905...', '')
[...]
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.
Research direction
Reproduce the failure with php occ backup:point:create using an SFTP destination, then start at lib/private/Files/Storage/Common.php:209 and follow the storage wrapper frames shown in the trace. Done means identifying and resolving the failure so the backup completes over SFTP.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100