Nextcloud version: 24.0.3
Operating system and version: TrueNAS-13.0-U1.1
nginx version: 1.22.0
PHP version: 8.0.22
The issue you are facing:
Nextcloud won’t update from version 24.0.3 to 24.0.4
Is this the first time you’ve seen this error?: No
Steps to replicate it:
- Login to Nextcloud Web Interface
- Try to Install Updates From Web Based Updater
The output of your Nextcloud log in Admin > Logging:
I can’t login to the web interface anymore to get this. Is there another way to get it?
The output of your config.php file in /path/to/nextcloud
(make sure you remove any identifiable information!):
<?php
$CONFIG = array (
'apps_paths' =>
array (
0 =>
array (
'path' => '/usr/local/www/nextcloud/apps',
'url' => '/apps',
'writable' => true,
),
1 =>
array (
'path' => '/usr/local/www/nextcloud/apps-pkg',
'url' => '/apps-pkg',
'writable' => false,
),
),
'logfile' => '/var/log/nextcloud/nextcloud.log',
'memcache.local' => '\\OC\\Memcache\\APCu',
'one-click-instance' => true,
'one-click-instance.user-limit' => 100,
'memcache.distributed' => '\\OC\\Memcache\\Redis',
'memcache.locking' => '\\OC\\Memcache\\Redis',
'redis' =>
array (
'host' => 'localhost',
),
'passwordsalt' => 'IDENTIFIABLE INFORMATION',
'secret' => 'IDENTIFIABLE INFORMATION',
'trusted_domains' =>
array (
0 => 'localhost',
1 => 'IDENTIFIABLE INFORMATION',
),
'datadirectory' => '/usr/local/www/nextcloud/data',
'dbtype' => 'mysql',
'version' => '24.0.3.2',
The output of your nginx error.log in `/var/log/nginx`:
2022/08/14 15:02:06 [error] 3212#100725: send() failed (54: Connection reset by peer)
Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.
There is no /www folder in /var. I found a nextcloud.log file stored in /var/log/nextcloud but I don't know how to copy it. I tried winscp but couldn't view that directory. If you need it please let me know how to copy this file and I'll be happy to get it for you.
I started my Nextcloud journey with the All In One 40GB VM machine distributed by Hanssonit. It seemed like the best beginner version of Nextcloud and I ran it on my VMware ESXI server. For the most part it ran smoothly. It’s when I went to do updates that I ran into HUGE problems. This first time was my own fault because I didn’t do any backups and when I ran sudo bash /var/scripts/menu.sh and went down to updates it failed. When I went to the web address it told me it was in Maintenance mode. So I turned that off in the config.php file and the website said Nextcloud will be updated to version 24.0.4 Please make sure that the database, the config folder and the data folder have been backed up before proceeding. *To avoid timeouts with larger installations, you can instead run the following command from your installation directory: ./occ upgrade* I tried clicking the update button here and it gave me a series of errors. So I tried the .occ upgrade command and again was met with tons of errors. I searched everywhere I could to find a solution to this problem and eventually decided to turn off network security temporarily to see if something different would happen when I ran sudo bash /var/scripts/menu.sh. It didn’t fail this time. Instead it told me that I couldn’t update between major versions with that script. It told me to visit https://shop.hanssonit.se/product/upgrade-between-major-owncloud-nextcloud-versions/ I would have to pay fifty euros every time I want to update. For this server I just want to recover my Nextcloud data, files, contacts, calendar etc. How do I do this?
Fast forward to today and I decided to host Nextcloud through TrueNas in hopes that updates would be more reliable or at least easier to roll back when I inevitably bricked something. Sadly I was wrong and I bricked my server again. This time I have lots of snapshots in TrueNas but when I click Rollback it doesn’t seem to do anything to restore my Nextcloud server.
The steps I did are as follows. I ran updates from the web based updater. It immediately popped up an error message: The following extra files have been found: .htaccess.dist but a quick google search told me to delete the file and it worked. It went through all 12 steps of the updater and then had an error message. Before I could save the error message it reloaded the page and wanted me to login using an updater.secret. I didn’t see it in my config.php file so I made one by running php -r '$password = trim(shell_exec(“openssl rand -base64 48”));if(strlen($password) === 64) {$hash = password_hash($password, PASSWORD_DEFAULT) . “\n”; echo "Insert as “updater.secret”: ".$hash; echo “The plaintext value is: “.$password.”\n”;}else{echo “Could not execute OpenSSL.\n”;}; as shown in this post: https://help.nextcloud.com/t/cant-access-nextcloud-need-updater-secret/62348/3 I added the updater.secret to my config.php file but it never would let me login to the page using the updater.secret. I gave that up and tried disabling maintenance mode and going to the web address of my server. I clicked the update button it showed and it gave more errors:
Preparing update
Set log level to debug
Turned on maintenance mode
Repair step: Repair MySQL collation
Repair info: All tables already have the correct collation -> nothing to do
Repair step: Repair SQLite autoincrement
Repair step: Copy data from accounts table when migrating from ownCloud
Repair step: Drop account terms table when migrating from ownCloud
Updating database schema
Updated database
Repair step: Repair MySQL collation
Repair info: All tables already have the correct collation -> nothing to do
Repair step: Repair mime types
Repair step: Clean tags and favorites
Repair info: 0 tags of deleted users have been removed.
Repair info: 0 tags for delete files have been removed.
Repair info: 0 tag entries for deleted tags have been removed.
Repair info: 0 tags with no entries have been removed.
Repair step: Repair invalid shares
Repair step: Move .step file of updater to backup location
Repair step: Add move avatar background job
Repair info: Repair step already executed
Repair step: Add preview cleanup background jobs
Repair step: Migrate oauth2_clients table to nextcloud schema
Repair info: Update the oauth2_access_tokens table schema.
Repair info: Update the oauth2_clients table schema.
Repair step: Fix potential broken mount points
Repair info: No mounts updated
Repair step: Repair language codes
Repair step: Install new core bundle components
Repair step: Add log rotate job
Repair step: Clear frontend caches
Repair info: Image cache cleared
An error occurred.
I gave that up and tried running occ upgrade on the TrueNas Jail Shell. It showed this:
root@Nextcloud:/ # occ upgrade
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
Setting log level to debug
Updating database schema
Updated database
An unhandled exception has been thrown:
TypeError: OC\EventDispatcher\ServiceEventListener::__invoke(): Argument #1 ($event) must be of type OCP\EventDispatcher\Event, OC\EventDispatcher\GenericEventWrapper given, called in /usr/local/www/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php on line 264 and defined in /usr/local/www/nextcloud/lib/private/EventDispatcher/ServiceEventListener.php:65
Stack trace:
#0 /usr/local/www/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php(264): OC\EventDispatcher\ServiceEventListener->__invoke(Object(OC\EventDispatcher\GenericEventWrapper), '\\OCP\\Files::pos...', Object(Symfony\Component\EventDispatcher\EventDispatcher))
#1 /usr/local/www/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php(239): Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, '\\OCP\\Files::pos...', Object(OC\EventDispatcher\GenericEventWrapper))
#2 /usr/local/www/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php(73): Symfony\Component\EventDispatcher\EventDispatcher->callListeners(Array, '\\OCP\\Files::pos...', Object(OC\EventDispatcher\GenericEventWrapper))
#3 /usr/local/www/nextcloud/lib/private/EventDispatcher/SymfonyAdapter.php(122): Symfony\Component\EventDispatcher\EventDispatcher->dispatch(Object(OC\EventDispatcher\GenericEventWrapper), '\\OCP\\Files::pos...')
#4 /usr/local/www/nextcloud/lib/private/Files/Node/Node.php(118): OC\EventDispatcher\SymfonyAdapter->dispatch('\\OCP\\Files::pos...', Object(Symfony\Component\EventDispatcher\GenericEvent))
#5 /usr/local/www/nextcloud/lib/private/Files/Node/File.php(133): OC\Files\Node\Node->sendHooks(Array, Array)
#6 /usr/local/www/nextcloud/lib/private/Files/SimpleFS/SimpleFile.php(149): OC\Files\Node\File->delete()
#7 /usr/local/www/nextcloud/lib/private/Template/SCSSCacher.php(386): OC\Files\SimpleFS\SimpleFile->delete()
#8 /usr/local/www/nextcloud/lib/private/Repair/ClearFrontendCaches.php(62): OC\Template\SCSSCacher->resetCache()
#9 /usr/local/www/nextcloud/lib/private/Repair.php(124): OC\Repair\ClearFrontendCaches->run(Object(OC\Repair))
#10 /usr/local/www/nextcloud/lib/private/Updater.php(293): OC\Repair->run()
#11 /usr/local/www/nextcloud/lib/private/Updater.php(133): OC\Updater->doUpgrade('24.0.4.1', '24.0.3.2')
#12 /usr/local/www/nextcloud/core/Command/Upgrade.php(235): OC\Updater->upgrade()
#13 /usr/local/www/nextcloud/3rdparty/symfony/console/Command/Command.php(255):OC\Core\Command\Upgrade->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 /usr/local/www/nextcloud/3rdparty/symfony/console/Application.php(1009): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 /usr/local/www/nextcloud/3rdparty/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand(Object(OC\Core\Command\Upgrade), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 /usr/local/www/nextcloud/3rdparty/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#17 /usr/local/www/nextcloud/lib/private/Console/Application.php(211): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#18 /usr/local/www/nextcloud/console.php(100): OC\Console\Application->run()
#19 /usr/local/www/nextcloud/occ(11): require_once('/usr/local/www/...')
#20 {main}root@Nextcloud:/ #
What can I do to save this mess I created? I would love to host Nextcloud in order to have privacy and control over my data but I'm a beginner at this and keep messing things up. This https://www.truenas.com/docs/ and https://docs.nextcloud.com/server/stable/admin_manual/ both have lots of info on how to set things up correctly and manage it but I still managed to mess it up. Is there any way to rollback the changes I made and/or make updates more reliable? Let me know if you need any more logs or info and I will do my best to supply.