镜像越级升级导致NextCloud无法打开

     一般情形下,通过

docker pull nextcloud 

可以获取到最新的nextcloud容器镜像,然后nextcloud会自行更新到最新版本。

      由于我使用了一段时间nextcloud应该是在16这个版本,然后直接pull下来了18版本。此时,发现我的nextcloud无法打开,出现如下错误:

Initializing nextcloud 18.0.1.3 ...
Upgrading nextcloud from 16.0.0.9 ...
Initializing finished
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
Set log level to debug
Turned on maintenance mode
Exception: Updates between multiple major versions and downgrades are unsupported.
Update failed
Maintenance mode is kept active
Reset log level
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.22.0.3. Set the 'ServerName' directive globally to suppress this message
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.22.0.3. Set the 'ServerName' directive globally to suppress this message
[Mon Feb 17 19:37:10.137612 2020] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.38 (Debian) PHP/7.3.14 configured -- resuming normal operations
[Mon Feb 17 19:37:10.137666 2020] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'
[Mon Feb 17 19:37:12.460440 2020] [autoindex:error] [pid 30] [client 172.22.0.1:60460] AH01276: Cannot serve directory /var/www/html/apps/files/: No matching DirectoryIndex (index.php,in   dex.html) found, and server-generated directory index forbidden by Options directive

通过以下命令,查询到相关的版本

docker exec --user www-data nc php /var/www/html/occ status

结果


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
  - installed: true
  - version: 18.0.1.3
  - versionstring: 18.0.1
  - edition:

通过以下命令进行升级

docker exec --user www-data nc php /var/www/html/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
Set log level to debug
Turned on maintenance mode
Exception: Updates between multiple major versions and downgrades are unsupported.
Update failed
Maintenance mode is kept active
Reset log level

发现不允许升级。

       以下高能到来,强制进行升级 参考链接

       修改以下这个文件 nextcloud/lib/private/Updater.php

 修改保存之后,再次通过以下命令就可以升级

docker exec --user www-data nc php /var/www/html/occ upgrade

等待升级完成之后,使用以下命令关闭维护模式

docker exec --user www-data nc php /var/www/html/occ  maintenance:mode --off

结果

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
Maintenance mode disabled

完成以上步骤之后,重新打开网页即可进入到Nextcloud里面。

一句话忠告:尽量不要夸太多版本升级,否则会出现太多的异常无法解决

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章