Open arnowelzel opened 1 year ago
Just for the records - the problem also exists in Nextcloud 27.1.0.
Just for the records - the problem also exists in Nextcloud 27.1.0.
Notice the same issue. Does it mean it won't expire any files when it occurs?
Just for the records - the problem also exists in Nextcloud 27.1.0.
Notice the same issue. Does it mean it won't expire any files when it occurs?
Correct - as soon as there is only one deleted file with versions left, the whole expire process won't work any longer.
just for the records - the problem also exists in Nextcloud 27.1.1.
just for the records - the problem also exists in Nextcloud 27.1.1.
The next time, update the initial post instead of writing a comment.
just for the records - the problem also exists in Nextcloud 27.1.1.
The next time, update the initial post instead of writing a comment.
Done
Just a little addition. I was seeing this on a few files, and as a test I decided to re-create them, wait for the cronjob to run (may not be necessary), and then remove them again. Stopped seeing it. Also ran versions:expire --verbose
to double check, no such errors reported there or in the log. (NC 27.1.3)
Secondly I tried creating a new test file, modifying it a few times, checking versions were indeed present, and then deleting it. Running versions:expire --verbose
again, no errors were produced. So it seems possible that these issues were caused at some point in a previous version, but only encountered now (i.e., unexpected data). The underlying reason for them might have disappeared already. Nevertheless, the code could be made more robust against this.
Just a little addition. I was seeing this on a few files, and as a test I decided to re-create them, wait for the cronjob to run (may not be necessary), and then remove them again. Stopped seeing it. Also ran
versions:expire --verbose
to double check, no such errors reported there or in the log. (NC 27.1.3)Secondly I tried creating a new test file, modifying it a few times, checking versions were indeed present, and then deleting it. Running
versions:expire --verbose
again, no errors were produced. So it seems possible that these issues were caused at some point in a previous version, but only encountered now. The underlying reason for them might have disappeared already. Nevertheless, the code could be made more robust against this.
Still it happens here with NC 27.1.3:
32 [------------------>---------] < 1 sec
In Root.php line 206:
[OCP\Files\NotFoundException]
/SomeUser/files/somefolder/somefile.example
Exception trace:
at /var/nextcloud-root-folder/lib/private/Files/Node/Root.php:206
OC\Files\Node\Root->get() at /var/nextcloud-root-folder/lib/private/Files/Node/Folder.php:135
OC\Files\Node\Folder->get() at /var/nextcloud-root-folder/apps/files_versions/lib/Storage.php:595
OCA\Files_Versions\Storage::OCA\Files_Versions\{closure}() at n/a:n/a
array_filter() at /var/nextcloud-root-folder/apps/files_versions/lib/Storage.php:610
OCA\Files_Versions\Storage::expireOlderThanMaxForUser() at /var/nextcloud-root-folder/apps/files_versions/lib/Command/ExpireVersions.php:110
OCA\Files_Versions\Command\ExpireVersions->expireVersionsForUser() at /var/nextcloud-root-folder/apps/files_versions/lib/Command/ExpireVersions.php:97
OCA\Files_Versions\Command\ExpireVersions->OCA\Files_Versions\Command\{closure}() at /var/nextcloud-root-folder/lib/private/User/Manager.php:632
OC\User\Manager->callForSeenUsers() at /var/nextcloud-root-folder/apps/files_versions/lib/Command/ExpireVersions.php:98
OCA\Files_Versions\Command\ExpireVersions->execute() at /var/nextcloud-root-folder/3rdparty/symfony/console/Command/Command.php:298
Symfony\Component\Console\Command\Command->run() at /var/nextcloud-root-folder/3rdparty/symfony/console/Application.php:1040
Symfony\Component\Console\Application->doRunCommand() at /var/nextcloud-root-folder/3rdparty/symfony/console/Application.php:301
Symfony\Component\Console\Application->doRun() at /var/nextcloud-root-folder/3rdparty/symfony/console/Application.php:171
Symfony\Component\Console\Application->run() at /var/nextcloud-root-folder/lib/private/Console/Application.php:211
OC\Console\Application->run() at /var/nextcloud-root-folder/console.php:100
require_once() at /var/nextcloud-root-folder/occ:11
In addition - it seems the problem is triggered by this:
data/user/files
.data/user/files_version
.data/user/files
does not exist any linger.Now the version expiration will still see the old version(s) in data/user/files_version
and expects the original file to be present in data/user/files
.
The expected behaviour should be, that old version(s) in data/user/files_version
should just get deleted if the original file does not exist any longer.
The expected behaviour should be, that old version(s) in data/user/files_version should just get deleted if the original file does not exist any longer.
Only if retention period has been reached, like for other files, so that the file could be recovered according to those expectations.
Only if retention period has been reached, like for other files, so that the file could be recovered according to those expectations.
How to recover a deleted file in Nextcloud if it is not in the trash folder but only in file versions?
⚠️ This issue respects the following points: ⚠️
Bug description
When Nextcloud tries to expire versions for files which got deleted, it will fail because it will try to find the original file which does not exist any longer. This is what I get when I try to run that for a specific user (all private data anonymized):
Steps to reproduce
occ versions:expire
Note: I don't know if this will only happen, if there is at least one old version to be deleted.
Expected behavior
occ versions:expire
and the respective background job work without any error message.Installation method
Community Web installer on a VPS or web space
Nextcloud Server version
27.0.2, 27.1.0, 27.1.1, 27.1.3
Operating system
Debian/Ubuntu
PHP engine version
PHP 8.1
Web server
Apache (supported)
Database engine version
MariaDB
Is this bug present after an update or on a fresh install?
Updated from a MINOR version (ex. 22.1 to 22.2)
Are you using the Nextcloud Server Encryption module?
None
What user-backends are you using?
Configuration report
List of activated Apps
Nextcloud Signing status
Nextcloud Logs
No response
Additional info
No response