Nextcloud 实例从 Debian 12 迁移到 Rocky Linux 9 服务器时出现内部服务器错误

Nextcloud 实例从 Debian 12 迁移到 Rocky Linux 9 服务器时出现内部服务器错误

我按照官方指南做了所有事情,可在此处找到https://docs.nextcloud.com/server/latest/admin_manual/maintenance/migrating.html

这不是 SELinux 的问题。我尝试将 SEL 置于宽容模式,重新启动 httpd、php-fpm、mariadb 和 redis 服务,但仍然遇到同样的问题。

问题描述:当尝试从 Web 访问迁移的实例时,浏览器中显示以下内容:

“内部服务器错误

服务器遇到内部错误,无法完成您的请求。如果此错误多次出现,请联系服务器管理员,请在您的报告中包含以下技术详细信息。更多详细信息可在服务器日志中找到。

这是nextcloud日志中的相关错误:

{"reqId":"Zc3t-mU9wVyFiRqbTb5fKAAAAJc","level":3,"time":"2024-02-15T10:56:58+00:00","remoteAddr":"<redacted>","user":"--","app":"core","method":"GET","url":"/","message":"Exception thrown: Doctrine\\DBAL\\Exception","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:122.0) Gecko/20100101 Firefox/122.0","version":"28.0.1.1","exception":{"Exception":"Doctrine\\DBAL\\Exception","Message":"Failed to connect to the database: An exception occurred in the driver: could not find driver","Code":0,"Trace":[{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1654,"function":"connect","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1081,"function":"getWrappedConnection","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/Connection.php","line":261,"function":"executeQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":341,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":377,"function":"executeQuery","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php","line":280,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppConfig.php","line":418,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppConfig.php","line":184,"function":"loadConfigValues","class":"OC\\AppConfig","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppConfig.php","line":374,"function":"getApps","class":"OC\\AppConfig","type":"->"},{"file":"/var/www/nextcloud/lib/private/legacy/OC_App.php","line":734,"function":"getValues","class":"OC\\AppConfig","type":"->"},{"file":"/var/www/nextcloud/lib/private/TemplateLayout.php","line":236,"function":"getAppVersions","class":"OC_App","type":"::"},{"file":"/var/www/nextcloud/lib/private/legacy/OC_Template.php","line":142,"function":"__construct","class":"OC\\TemplateLayout","type":"->"},{"file":"/var/www/nextcloud/lib/private/Template/Base.php","line":132,"function":"fetchPage","class":"OC_Template","type":"->"},{"file":"/var/www/nextcloud/lib/private/legacy/OC_Template.php","line":291,"function":"printPage","class":"OC\\Template\\Base","type":"->"},{"file":"/var/www/nextcloud/index.php","line":104,"function":"printExceptionErrorPage","class":"OC_Template","type":"::"}],"File":"/var/www/nextcloud/lib/private/DB/Connection.php","Line":139,"CustomMessage":"Exception thrown: Doctrine\\DBAL\\Exception"}}

数据库已正确迁移,用户和密码已正确设置。我已检查,可以从本地主机访问数据库。

以下是有关我的新环境的一些数据:

Rocky Linux 9.3(蓝色玛瑙)x86_64

Nextcloud 版本 28.0.1.1

Web 服务器版本 Apache/2.4.57

MySQL 版本 15.1 发行版 10.5.22-MariaDB

Redis 服务器 v=6.2.7

PHP 8.1.27

Zend 引擎 v4.1.27

Zend OPcache v8.1.27

[PHP 模块] bz2 日历 核心 ctype curl 日期 dom exif fileinfo 过滤器 ftp gettext hash iconv json libxml mbstring mcrypt(使用 pecl 构建,其余为 EPEL 发布包) mysqli mysqlnd openssl pcntl pcre PDO pdo_mysql pdo_sqlite Phar posix readline 反射会话 shmop SimpleXML 套接字 SPL sqlite3 标准 sysvmsg sysvsem sysvshm 标记器 xml xmlreader xmlwriter xsl Zend OPcache zlib

这是我的 /var/www/nextcloud/config/config.php

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

帮帮我吧,我真的宁愿迁移我的旧实例而不是部署一个新的实例。

答案1

通过完全卸载 EPEL repo 中的 php 和所有模块,然后从 REMI repo 安装 PHP 8.3 和所需模块,解决了该问题。现在 Web 界面已启动并运行。

相关内容