Update failed while extracting: Stale file handle

Nextcloud version: 21.0.4
Operating system and version: Ubuntu 21.04
Apache or nginx version: 2.4.46
PHP version: 7.4.16

Hello, more than once while trying to update Nextcloud I encountered this error, and never found a reliable solution. Sometimes I’ve been able to successfully update after a few attempts, also by emptying the extracted folder before running it again.

I have php-zip installed, all permissions seem to be set correctly. I have tried both from the CLI and the web interface. Php is configured with memory_limit set to 512M and max_execution_time set to 120.

Apache’s logs had nothing useful, while in the updater.log file this is written:

updater.log
2021-10-06T14:59:27+0000 5q6mADomvw [info] endStep("5")
2021-10-06T14:59:27+0000 5q6mADomvw [info] executeStep request for step "6"
2021-10-06T14:59:27+0000 5q6mADomvw [info] startStep("6")
2021-10-06T14:59:27+0000 5q6mADomvw [info] extractDownload()
2021-10-06T14:59:27+0000 5q6mADomvw [info] storage location: /mnt/Nextcloud/updater-oc3o6mvrafkc/downloads/
2021-10-06T14:59:45+0000 5q6mADomvw [error] executeStep request failed with other exception
2021-10-06T14:59:45+0000 5q6mADomvw [error] Exception: Exception
Message: Error during unpacking zipfile: Read error: Stale file handle
Code:0
Trace:
#0 phar:///var/www/nextcloud/updater/updater.phar/lib/UpdateCommand.php(372): NC\Updater\Updater->extractDownload()
#1 phar:///var/www/nextcloud/updater/updater.phar/lib/UpdateCommand.php(233): NC\Updater\UpdateCommand->executeStep()
#2 phar:///var/www/nextcloud/updater/updater.phar/vendor/symfony/console/Command/Command.php(256): NC\Updater\UpdateCommand->execute()
#3 phar:///var/www/nextcloud/updater/updater.phar/vendor/symfony/console/Application.php(820): Symfony\Component\Console\Command\Command->run()
#4 phar:///var/www/nextcloud/updater/updater.phar/vendor/symfony/console/Application.php(187): Symfony\Component\Console\Application->doRunCommand()
#5 phar:///var/www/nextcloud/updater/updater.phar/vendor/symfony/console/Application.php(118): Symfony\Component\Console\Application->doRun()
#6 phar:///var/www/nextcloud/updater/updater.phar/updater.php(10): Symfony\Component\Console\Application->run()
#7 /var/www/nextcloud/updater/updater.phar(10): require('phar:///var/www...')
#8 {main}
File:phar:///var/www/nextcloud/updater/updater.phar/lib/Updater.php
Line:682

2021-10-06T14:59:45+0000 5q6mADomvw [info] rollbackChanges("6")
2021-10-06T14:59:45+0000 5q6mADomvw [info] unlink .step
2021-10-06T14:59:45+0000 5q6mADomvw [info] end of  rollbackChanges()

Before giving up and updating manually, is there anything more that I can try, or that I’m missing?

Thanks in advance,
Marco