Upgrade process shows, "Internal Server Error" in the middle of the upgrade

Support intro

Sorry to hear you’re facing problems. :slightly_frowning_face:

The community help forum (help.nextcloud.com) is for home and non-enterprise users. Support is provided by other community members on a best effort / “as available” basis. All of those responding are volunteering their time to help you.

If you’re using Nextcloud in a business/critical setting, paid and SLA-based support services can be accessed via portal.nextcloud.com where Nextcloud engineers can help ensure your business keeps running smoothly.

Getting help

In order to help you as efficiently (and quickly!) as possible, please fill in as much of the below requested information as you can.

Before clicking submit: Please check if your query is already addressed via the following resources:

(Utilizing these existing resources is typically faster. It also helps reduce the load on our generous volunteers while elevating the signal to noise ratio of the forums otherwise arising from the same queries being posted repeatedly).

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can. :heart:

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • Unsure. I think it was upgrading to 27.0.1
  • Operating system and version (e.g., Ubuntu 24.04):
    • Debian 11
  • Web server and version (e.g, Apache 2.4.25):
    • Apache/2.4.62 (Debian)
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • NA
  • PHP version (e.g, 8.3):
    • 8.4.8
  • Is this the first time you’ve seen this error? (Yes / No):
    • Yes
  • When did this problem seem to first start?
    • In the middle of an upgrade from v26 after I opened the web updater
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • NA
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • No

Summary of the issue you are facing:

I see the following error when upgrading from v26 to v27. This shows after I opened the web updater:

Internal Server Error

The server was unable to complete your request.
If this happens again, please send the technical details below to the server administrator.
More details can be found in the server log.
Technical details

Remote Address: 192.168.29.7
Request ID: vmcP8yAsOoRc1Yhx8vuX

A tail of my apache log shows this:

[Wed Jun 11 20:34:24.145032 2025] [php:warn] [pid 245594:tid 245594] [client 192.168.29.7:51736] PHP Warning:  copy(/var/www/html/nextcloud/config/config.php.bkp): Failed to open stream: Permission denied in /var/www/html/nextcloud/updater/index.php on line 448, referer: http://192.168.29.215/nextcloud/updater/
[Wed Jun 11 20:44:57.019617 2025] [php:warn] [pid 245588:tid 245588] [client 192.168.29.7:51892] PHP Warning:  filemtime(): stat failed for /var/www/html/nextcloud/version.php in /var/www/html/nextcloud/lib/private/legacy/OC_Util.php on line 329
[Wed Jun 11 20:44:57.087706 2025] [php:error] [pid 245588:tid 245588] [client 192.168.29.7:51892] PHP Fatal error:  Trait "Psr\\Log\\LoggerAwareTrait" not found in /var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php on line 26
[Wed Jun 11 20:45:01.015888 2025] [php:warn] [pid 265347:tid 265347] [client 192.168.29.7:51893] PHP Warning:  filemtime(): stat failed for /var/www/html/nextcloud/version.php in /var/www/html/nextcloud/lib/private/legacy/OC_Util.php on line 329
[Wed Jun 11 20:45:01.028664 2025] [php:error] [pid 265347:tid 265347] [client 192.168.29.7:51893] PHP Fatal error:  Trait "Psr\\Log\\LoggerAwareTrait" not found in /var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php on line 26
[Wed Jun 11 20:46:03.047566 2025] [php:warn] [pid 265382:tid 265382] [client 192.168.29.7:51895] PHP Warning:  filemtime(): stat failed for /var/www/html/nextcloud/version.php in /var/www/html/nextcloud/lib/private/legacy/OC_Util.php on line 329
[Wed Jun 11 20:47:05.022719 2025] [php:warn] [pid 245586:tid 245586] [client 192.168.29.7:51897] PHP Warning:  filemtime(): stat failed for /var/www/html/nextcloud/version.php in /var/www/html/nextcloud/lib/private/legacy/OC_Util.php on line 329
[Wed Jun 11 20:47:05.023193 2025] [php:warn] [pid 265346:tid 265346] [client 192.168.29.7:51898] PHP Warning:  filemtime(): stat failed for /var/www/html/nextcloud/version.php in /var/www/html/nextcloud/lib/private/legacy/OC_Util.php on line 329
[Wed Jun 11 20:47:05.071937 2025] [php:warn] [pid 245589:tid 245589] [client 192.168.29.7:51899] PHP Warning:  filemtime(): stat failed for /var/www/html/nextcloud/version.php in /var/www/html/nextcloud/lib/private/legacy/OC_Util.php on line 329
[Wed Jun 11 20:48:07.056534 2025] [php:warn] [pid 245594:tid 245594] [client 192.168.29.7:51902] PHP Warning:  filemtime(): stat failed for /var/www/html/nextcloud/version.php in /var/www/html/nextcloud/lib/private/legacy/OC_Util.php on line 329

Log entries

Nextcloud

Please provide the log entries from your Nextcloud log that are generated during the time of problem (via the Copy raw option from Administration settings->Logging screen or from your nextcloud.log located in your data directory). Feel free to use a pastebin/gist service if necessary.

No entries.

Web Browser

If the problem is related to the Web interface, open your browser inspector Console and Network tabs while refreshing (reloading) and reproducing the problem. Provide any relevant output/errors here that appear.

NA

Web server / Reverse Proxy

The output of your Apache/nginx/system log in /var/log/____:

[Wed Jun 11 20:34:24.145032 2025] [php:warn] [pid 245594:tid 245594] [client 192.168.29.7:51736] PHP Warning:  copy(/var/www/html/nextcloud/config/config.php.bkp): Failed to open stream: Permission denied in /var/www/html/nextcloud/updater/index.php on line 448, referer: http://192.168.29.215/nextcloud/updater/
[Wed Jun 11 20:44:57.019617 2025] [php:warn] [pid 245588:tid 245588] [client 192.168.29.7:51892] PHP Warning:  filemtime(): stat failed for /var/www/html/nextcloud/version.php in /var/www/html/nextcloud/lib/private/legacy/OC_Util.php on line 329
[Wed Jun 11 20:44:57.087706 2025] [php:error] [pid 245588:tid 245588] [client 192.168.29.7:51892] PHP Fatal error:  Trait "Psr\\Log\\LoggerAwareTrait" not found in /var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php on line 26
[Wed Jun 11 20:45:01.015888 2025] [php:warn] [pid 265347:tid 265347] [client 192.168.29.7:51893] PHP Warning:  filemtime(): stat failed for /var/www/html/nextcloud/version.php in /var/www/html/nextcloud/lib/private/legacy/OC_Util.php on line 329
[Wed Jun 11 20:45:01.028664 2025] [php:error] [pid 265347:tid 265347] [client 192.168.29.7:51893] PHP Fatal error:  Trait "Psr\\Log\\LoggerAwareTrait" not found in /var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php on line 26
[Wed Jun 11 20:46:03.047566 2025] [php:warn] [pid 265382:tid 265382] [client 192.168.29.7:51895] PHP Warning:  filemtime(): stat failed for /var/www/html/nextcloud/version.php in /var/www/html/nextcloud/lib/private/legacy/OC_Util.php on line 329
[Wed Jun 11 20:47:05.022719 2025] [php:warn] [pid 245586:tid 245586] [client 192.168.29.7:51897] PHP Warning:  filemtime(): stat failed for /var/www/html/nextcloud/version.php in /var/www/html/nextcloud/lib/private/legacy/OC_Util.php on line 329
[Wed Jun 11 20:47:05.023193 2025] [php:warn] [pid 265346:tid 265346] [client 192.168.29.7:51898] PHP Warning:  filemtime(): stat failed for /var/www/html/nextcloud/version.php in /var/www/html/nextcloud/lib/private/legacy/OC_Util.php on line 329
[Wed Jun 11 20:47:05.071937 2025] [php:warn] [pid 245589:tid 245589] [client 192.168.29.7:51899] PHP Warning:  filemtime(): stat failed for /var/www/html/nextcloud/version.php in /var/www/html/nextcloud/lib/private/legacy/OC_Util.php on line 329
[Wed Jun 11 20:48:07.056534 2025] [php:warn] [pid 245594:tid 245594] [client 192.168.29.7:51902] PHP Warning:  filemtime(): stat failed for /var/www/html/nextcloud/version.php in /var/www/html/nextcloud/lib/private/legacy/OC_Util.php on line 329

Configuration

Nextcloud

The output of occ config:list system or similar is best, but, if not possible, the contents of your config.php file from /path/to/nextcloud is fine (make sure to remove any identifiable information!):

<?php
$CONFIG = array (
  'instanceid' => 'ocb8hjqxvlv5',
  'passwordsalt' => '###',
  'secret' => '###',
  'trusted_domains' =>
  array (
    0 => '192.168.29.215',
  ),
  'datadirectory' => '/exthdd/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '27.1.11.3',
  'overwrite.cli.url' => 'http://192.168.29.215/nextcloud',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nxc',
  'dbpassword' => '####',
  'installed' => true,
  'updater.secret' => '###',
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 2,
  'debug' => false,
  'memcache.local' => '\\OC\\Memcache\\APCu',
);

The entries you shared all suggest permission or ownership problems with various files within /var/www/html/nextcloud:


copy(/var/www/html/nextcloud/config/config.php.bkp): Failed to open stream: Permission denied

stat failed for /var/www/html/nextcloud/version.php

It’s happening only now. I’ve not had issues updating NC in the past.

I checked and the entire next cloud folder is owned by the apache web user (www-data). I also changed the permissions of all files and folders to 775 and still see the same error.

Update:

So I used the command line updater and got it all the way to the latest version (31.0.6). Now when I try and access the installation I see this message:

Downgrading is not supported and is likely to cause unpredictable issues (from 31.0.6.2 to 29.0.16.1) 

Unsure of what to do next. Any help is appreciated.

Update 2:

I was finally able to resolve this. I kept updating the instance using the built-in command line updater till I reached the most current version. I then took all the logs and errors and put them in ChatGPT. It gave me a list of step-by-step instructions to fix it. Basically it asked me to create a backup of the data and files folders and then replace them from the archive of the most recent version. It also helped me set the appropriate file and folder permissions.