"No such file or directory in ... Updater.php on line 658" during 22.2.6 to 23.0.3 update

I like NextCloud’s potential, and have been limping along with a linxuserver Docker instance for years. Unfortunately, (literally) every time I try to do an upgrade SOMETHING goes wrong. It got so bad I’ve re-installed my Docker twice just to avoid doing an update then just gave up and didn’t bother updating for a year.

Then I decided to try again, and the first 2 major version updates both failed with stuff I already knew how to fix, but the last one (to 22.2.6 → 23.0.3) threw this new issue at me:

[✔] Check for expected files
[✔] Check for write permissions
[✔] Create backup
[✔] Downloading
[✔] Verify integrity
[ ] Extracting ...PHP Warning:  require(/config/www/nextcloud/updater/../version.php): failed to open stream: No such file or directory in phar:///config/www/nextcloud/updater/updater.phar/lib/Updater.php on line 658
PHP Fatal error:  require(): Failed opening required '/config/www/nextcloud/updater/../version.php' (include_path='.:/usr/share/php7') in phar:///config/www/nextcloud/updater/updater.phar/lib/Updater.php on line 658

Now my UI is stuck at “Update in process.”, “sudo -u abc php /config/www/nextcloud/updater/updater.phar” fails with the above, and “occ maintenance:repair” spits out “Could not open input file: /config/www/nextcloud/occ” (I checked, and indeed it doesn’t exist).

I’ve reviewed a few other posts with this error but they’re all pretty old (pre-v19) and I wasn’t able to apply them to my instance.

Are there any suggestion on how to recover this? If not, any thoughts on what I might be doing wrong at install to cause SO MUCH PAIN during updates?

Thanks!

Sorry i do not know if this notation is normal on using updater/updater.phar.
But the file needed is /config/www/nextcloud/version.php. Does the file exists? Can the user read the file?

Here the file for “master”
server/version.php at master ¡ nextcloud/server ¡ GitHub

Also this file must exist. Have you deleted files in /config/www/nextcloud?
What about e.g. /config/www/nextcloud/remote.php and /config/www/nextcloud/index.php?

I don’t recall deleting anything in /config/www/nextcloud, but maybe I did something by accident.
At this point I expect it will be faster to re-install from scratch than get the current install going again. :frowning:

As this is currently only used by me I plan to just move my “files” contents elsewhere, remove/reinstall the app & related DB then move my “files” contents back in & rescan everything. Not a fun afternoon, but it will get me running again sooner.

1 Like

I can confirm that when upgrading from 22.2.5 the occ and version.php files were gone. I managed to pick them up from the repo but the upgrade process is still failing.

I got this problem by updating from 25.0.1 to 25.0.3 with an Linuxserver.io Docker in unRAID.
What files do i need and where do i need to put them exactly?
Cause I put an version.php in the folder /config/www/nextcloud/updater but i got the exact same folder.
The version.php file looks like:


$OC_Version = [25, 0, 3, 2];

// The human readable string
$OC_VersionString = '25.0.3';

$OC_VersionCanBeUpgradedFrom = [
        'nextcloud' => [
                '25.0' => true,
                '26.0' => true,
        ],
        'owncloud' => [
                '10.11' => true,
        ],
];

// default Nextcloud channel
$OC_Channel = 'git';

// The build number
$OC_Build = '';

// Vendor of this package
$vendor = 'nextcloud';

I have a similar issue and similar setup:

i am running a nextcloud linuxserver.io container on unraid. I am on 25.0.1 and want to upgrade to 25.0.4

the error i run into is this:

Extracting …PHP Warning: require(/config/www/nextcloud/updater/…/version.php): Failed to open stream: No such file or directory in phar:///config/www/nextcloud/updater/updater.phar/lib/Updater.php on line 675
PHP Fatal error: Uncaught Error: Failed opening required ‘/config/www/nextcloud/updater/…/version.php’ (include_path=‘.:/usr/share/php81’) in phar:///config/www/nextcloud/updater/updater.phar/lib/Updater.php:675
Stack trace:
#0 phar:///config/www/nextcloud/updater/updater.phar/lib/Updater.php(713): NC\Updater\Updater->getVersionByVersionFile()
#1 phar:///config/www/nextcloud/updater/updater.phar/lib/UpdateCommand.php(371): NC\Updater\Updater->extractDownload()
#2 phar:///config/www/nextcloud/updater/updater.phar/lib/UpdateCommand.php(234): NC\Updater\UpdateCommand->executeStep()
#3 phar:///config/www/nextcloud/updater/updater.phar/vendor/symfony/console/Command/Command.php(255): NC\Updater\UpdateCommand->execute()
#4 phar:///config/www/nextcloud/updater/updater.phar/vendor/symfony/console/Application.php(1009): Symfony\Component\Console\Command\Command->run()
#5 phar:///config/www/nextcloud/updater/updater.phar/vendor/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand()
#6 phar:///config/www/nextcloud/updater/updater.phar/vendor/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun()
#7 phar:///config/www/nextcloud/updater/updater.phar/updater.php(10): Symfony\Component\Console\Application->run()
#8 /config/www/nextcloud/updater/updater.phar(14): require(‘…’)
#9 {main}
thrown in phar:///config/www/nextcloud/updater/updater.phar/lib/Updater.php on line 675
root@0e9d30847bcb:/config/www/nextcloud/updater#

@b0rgi85 in my case, the issue is not occuring in /config/www/nextcloud/updater, but rather within the update file: config/www/nextcloud/updater/updater.phar/lib/Updater.php

has anyone come across a solution yet? is it isolated to this docker container from linuxserver.io potentially?

I got rid of the error with downloading the whole repo and then put the files in my nextcloud installation. After a restart the system works again.

linuxserver.io has removed the updater.php:
changelog:

More info:

edit: the webupdater still works (announcement says it won’t). I just updated 27.0.0->27.0.1

Is there a reason you want to do it manually rather than updating the container image?

Yes, I get the nextcloud update one week earlier.
linuxserver updatet to [27.0.1-ls262] on 08-08-2023, nextcloud updated to 27.0.2 on the same day.
Now I have always to check the linuxserver.io releases about updates before I update manually via docker commands( linuxserver.io will update to 2.7.0.2 probably tomorrow).
But I understand why they removed the updater. Still it was handy.