[Solved] NextCloud Update Failure

Hi folks,

Doing updates last night and the NextCloud update failed. It appears that something went wrong in the database migration step, but I’m unable to determine what. All NextCloud actions throw an error where the nextcloud database user is denied access.

I tried to rerun the upgrade at command line, but the database user error immediately becomes an issue. At the moment, Nextcloud is inaccessible and gives an internal server error.

Any help would be greatly appreciated.

Here’s what I’m seeing:

# systemctl status -l mariadb mysqld rh-php73-php-fpm

● mariadb.service - MariaDB database server Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor preset: disabled) Active: inactive (dead)

● mysqld.service - MariaDB database server Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled) Active: active (running) since Mon 2021-07-19 20:56:28 UTC; 10h ago Main PID: 1494 (mysqld_safe) CGroup: /system.slice/mysqld.service ├─1494 /bin/sh /usr/bin/mysqld_safe --basedir=/usr └─2188 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --log-error=/var/log/mariadb/mariadb.log --pid-file=/var/run/mariadb/mariadb.pid --socket=/var/lib/mysql/mysql.sock

Jul 19 20:56:26 ruthie.coxbros.us systemd[1]: Starting MariaDB database server... Jul 19 20:56:26 ruthie.coxbros.us mariadb-prepare-db-dir[1341]: Database MariaDB is probably initialized in /var/lib/mysql already, nothing is done. Jul 19 20:56:26 ruthie.coxbros.us mariadb-prepare-db-dir[1341]: If this is not the case, make sure the /var/lib/mysql is empty before running mariadb-prepare-db-dir. Jul 19 20:56:27 ruthie.coxbros.us mysqld_safe[1494]: 210719 20:56:27 mysqld_safe Logging to '/var/log/mariadb/mariadb.log'. Jul 19 20:56:27 ruthie.coxbros.us mysqld_safe[1494]: 210719 20:56:27 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql Jul 19 20:56:28 ruthie.coxbros.us systemd[1]: Started MariaDB database server.

● rh-php73-php-fpm.service - The PHP FastCGI Process Manager Loaded: loaded (/usr/lib/systemd/system/rh-php73-php-fpm.service; enabled; vendor preset: disabled) Drop-In: /etc/systemd/system/rh-php73-php-fpm.service.d └─nethserver-rh-php73-php-fpm.conf Active: active (running) since Tue 2021-07-20 07:20:16 UTC; 9min ago Main PID: 22637 (php-fpm) Status: "Processes active: 0, idle: 27, Requests: 37, slow: 0, Traffic: 0.1req/sec" CGroup: /system.slice/rh-php73-php-fpm.service ├─22637 php-fpm: master process (/etc/opt/rh/rh-php73/php-fpm.conf ├─22703 php-fpm: pool nethserver-nextcloud ├─22705 php-fpm: pool nethserver-nextcloud ├─22708 php-fpm: pool nethserver-nextcloud ├─22709 php-fpm: pool nethserver-nextcloud ├─22711 php-fpm: pool nethserver-nextcloud ├─22714 php-fpm: pool b7fb446d9f40ef7 ├─22715 php-fpm: pool b7fb446d9f40ef7 ├─22718 php-fpm: pool b7fb446d9f40ef7 ├─22719 php-fpm: pool b7fb446d9f40ef7 ├─22720 php-fpm: pool b7fb446d9f40ef7 ├─22723 php-fpm: pool c7c2c4b1ecb6beb ├─22726 php-fpm: pool c7c2c4b1ecb6beb ├─22729 php-fpm: pool c7c2c4b1ecb6beb ├─22731 php-fpm: pool c7c2c4b1ecb6beb ├─22733 php-fpm: pool c7c2c4b1ecb6beb ├─22734 php-fpm: pool d9c77730ae762d5 ├─22736 php-fpm: pool d9c77730ae762d5 ├─22740 php-fpm: pool d9c77730ae762d5 ├─22743 php-fpm: pool d9c77730ae762d5 ├─22748 php-fpm: pool d9c77730ae762d5 ├─22751 php-fpm: pool www ├─22754 php-fpm: pool www ├─22757 php-fpm: pool www ├─22760 php-fpm: pool www ├─22764 php-fpm: pool www ├─24843 php-fpm: pool b7fb446d9f40ef7 └─25195 php-fpm: pool nethserver-nextcloud

Jul 20 07:20:16 ruthie.coxbros.us systemd[1]: Starting The PHP FastCGI Process Manager... Jul 20 07:20:16 ruthie.coxbros.us systemd[1]: Started The PHP FastCGI Process Manager.

# runuser -u apache -- scl enable rh-php73 -- php -d memory_limit=512M /usr/share/nextcloud/occ maintenance:mode

An unhandled exception has been thrown:
Doctrine\DBAL\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [1698] Access denied for user 'nxtcld'@'localhost' in /usr/share/nextcloud/lib/private/DB/Connection.php:85

Looking at the logs for the upgrade itself, everything looks fine to me, until it’s not.

Jul 19 21:45:01 ruthie systemd: Created slice User Slice of apache. Jul 19 21:45:01 ruthie systemd: Started Session 21 of user apache. Jul 19 21:45:02 ruthie systemd: Removed slice User Slice of apache. Jul 19 21:45:07 ruthie pkgaction[31422]: remove: Jul 19 21:45:07 ruthie pkgaction[31422]: update: @nethserver-nextcloud Jul 19 21:45:09 ruthie pkgaction[31422]: install: Jul 19 21:45:15 ruthie yum[31422]: Installed: rh-mariadb105-runtime-3.7-1.el7.x86_64 Jul 19 21:45:15 ruthie yum[31422]: Installed: 3:rh-mariadb105-mariadb-config-10.5.9-2.el7.x86_64 Jul 19 21:45:15 ruthie yum[31422]: Installed: 3:rh-mariadb105-mariadb-common-10.5.9-2.el7.x86_64 Jul 19 21:45:15 ruthie yum[31422]: Installed: 3:rh-mariadb105-mariadb-libs-10.5.9-2.el7.x86_64 Jul 19 21:45:15 ruthie yum[31422]: Installed: 3:rh-mariadb105-mariadb-10.5.9-2.el7.x86_64 Jul 19 21:45:15 ruthie yum[31422]: Installed: 3:rh-mariadb105-mariadb-errmsg-10.5.9-2.el7.x86_64 Jul 19 21:45:21 ruthie systemd: Reloading. Jul 19 21:45:21 ruthie systemd: [/usr/lib/systemd/system/netdata.service:72] Unknown lvalue 'ProtectControlGroups' in section 'Service' Jul 19 21:45:21 ruthie yum[31422]: Installed: 3:rh-mariadb105-mariadb-server-10.5.9-2.el7.x86_64 Jul 19 21:45:21 ruthie yum[31422]: Installed: 3:rh-mariadb105-mariadb-server-utils-10.5.9-2.el7.x86_64 Jul 19 21:45:21 ruthie yum[31422]: Installed: rh-mariadb105-3.7-1.el7.x86_64 Jul 19 21:45:21 ruthie yum[31422]: Installed: nethserver-rh-mariadb105-1.0.0-1.ns7.noarch Jul 19 21:45:36 ruthie yum[31422]: Updated: nethserver-nextcloud-1.17.1-1.ns7.noarch Jul 19 21:45:39 ruthie esmith::event[32200]: Event: nethserver-rh-mariadb105-update Jul 19 21:45:39 ruthie esmith::event[32200]: expanding /etc/opt/rh/rh-mariadb105/my.cnf.d/mariadb-server.cnf Jul 19 21:45:39 ruthie esmith::event[32200]: Action: /etc/e-smith/events/actions/generic_template_expand SUCCESS [0.106967] Jul 19 21:45:39 ruthie esmith::event[32200]: Event: nethserver-rh-mariadb105-update SUCCESS Jul 19 21:45:39 ruthie esmith::event[32202]: Event: nethserver-nextcloud-update Jul 19 21:45:39 ruthie esmith::event[32202]: Migrating existing database configuration Jul 19 21:45:39 ruthie /etc/e-smith/events/nethserver-nextcloud-update/S00initialize-default-databases[32203]: /var/lib/nethserver/db/configuration: OLD rh-mariadb105-mariadb@nextcloud=(undefined) Jul 19 21:45:39 ruthie /etc/e-smith/events/nethserver-nextcloud-update/S00initialize-default-databases[32203]: /var/lib/nethserver/db/configuration: NEW rh-mariadb105-mariadb@nextcloud=service|access||status|enabled Jul 19 21:45:39 ruthie esmith::event[32202]: Migrating existing database certificates Jul 19 21:45:39 ruthie esmith::event[32202]: Migrating existing database networks Jul 19 21:45:39 ruthie esmith::event[32202]: Migrating existing database routes Jul 19 21:45:39 ruthie esmith::event[32202]: Migrating existing database accounts Jul 19 21:45:39 ruthie esmith::event[32202]: Migrating existing database proxypass Jul 19 21:45:39 ruthie esmith::event[32202]: Migrating existing database hosts Jul 19 21:45:39 ruthie esmith::event[32202]: Migrating existing database dhcp Jul 19 21:45:39 ruthie esmith::event[32202]: Migrating existing database backups Jul 19 21:45:39 ruthie esmith::event[32202]: Migrating existing database fwrules Jul 19 21:45:39 ruthie esmith::event[32202]: Migrating existing database tc Jul 19 21:45:39 ruthie esmith::event[32202]: Migrating existing database fwservices Jul 19 21:45:39 ruthie esmith::event[32202]: Migrating existing database fwtimes Jul 19 21:45:39 ruthie esmith::event[32202]: Migrating existing database macs Jul 19 21:45:39 ruthie esmith::event[32202]: Migrating existing database portforward Jul 19 21:45:39 ruthie esmith::event[32202]: Migrating existing database smarthosts Jul 19 21:45:39 ruthie esmith::event[32202]: Migrating existing database domains Jul 19 21:45:39 ruthie esmith::event[32202]: Migrating existing database vhosts Jul 19 21:45:39 ruthie esmith::event[32202]: Migrating existing database vpn Jul 19 21:45:39 ruthie esmith::event[32202]: Action: /etc/e-smith/events/nethserver-nextcloud-update/S00initialize-default-databases SUCCESS [0.355021] Jul 19 21:45:39 ruthie esmith::event[32202]: expanding /etc/httpd/conf.d/default-virtualhost.inc Jul 19 21:45:39 ruthie esmith::event[32202]: expanding /etc/httpd/conf.d/nethserver.conf Jul 19 21:45:39 ruthie esmith::event[32202]: expanding /etc/httpd/conf.d/nextcloud.conf Jul 19 21:45:39 ruthie esmith::event[32202]: expanding /etc/httpd/conf.d/zz_nextcloud.conf Jul 19 21:45:39 ruthie esmith::event[32202]: expanding /etc/opt/rh/rh-mariadb105/my.cnf.d/mariadb-server.cnf Jul 19 21:45:39 ruthie esmith::event[32202]: Action: /etc/e-smith/events/actions/generic_template_expand SUCCESS [0.183114] Jul 19 21:45:39 ruthie systemd: Created slice system-rh\x2dmariadb105\x2dmariadb.slice. Jul 19 21:45:39 ruthie systemd: Starting MariaDB 10.5 database server... Jul 19 21:45:40 ruthie scl: Initializing MariaDB database Jul 19 21:45:41 ruthie scl: Two all-privilege accounts were created. Jul 19 21:45:41 ruthie scl: One is root@localhost, it has no password, but you need to Jul 19 21:45:41 ruthie scl: be system 'root' user to connect. Use, for example, sudo mysql Jul 19 21:45:41 ruthie scl: The second is mysql@localhost, it has no password either, but Jul 19 21:45:41 ruthie scl: you need to be the system 'mysql' user to connect. Jul 19 21:45:41 ruthie scl: After connecting you can set the password, if you would need to be Jul 19 21:45:41 ruthie scl: able to connect as any of these users with a password and without sudo Jul 19 21:45:41 ruthie scl: See the MariaDB Knowledgebase at https://mariadb.com/kb or the Jul 19 21:45:41 ruthie scl: MySQL manual for more instructions. Jul 19 21:45:41 ruthie scl: Please report any problems at https://mariadb.org/jira Jul 19 21:45:41 ruthie scl: The latest information about MariaDB is available at https://mariadb.org/. Jul 19 21:45:41 ruthie scl: You can find additional information about the MySQL part at: Jul 19 21:45:41 ruthie scl: https://dev.mysql.com Jul 19 21:45:41 ruthie scl: Consider joining MariaDB's strong and vibrant community: Jul 19 21:45:41 ruthie scl: https://mariadb.org/get-involved/ Jul 19 21:45:41 ruthie mysqld-scl-helper: 2021-07-19 21:45:41 0 [Note] /opt/rh/rh-mariadb105/root/usr/libexec/mysqld (mysqld 10.5.9-MariaDB) starting as process 32342 ... Jul 19 21:45:41 ruthie systemd: Started MariaDB 10.5 database server. Jul 19 21:45:41 ruthie esmith::event[32202]: Database Jul 19 21:45:41 ruthie esmith::event[32202]: information_schema Jul 19 21:45:41 ruthie esmith::event[32202]: mysql Jul 19 21:45:41 ruthie esmith::event[32202]: performance_schema Jul 19 21:45:41 ruthie esmith::event[32202]: Nextcloud or one of the apps require upgrade - only a limited number of commands are available Jul 19 21:45:41 ruthie esmith::event[32202]: You may use your browser or the occ upgrade command to do the upgrade Jul 19 21:45:42 ruthie esmith::event[32202]: System config value loglevel set to integer 2 Jul 19 21:45:42 ruthie esmith::event[32202]: Nextcloud or one of the apps require upgrade - only a limited number of commands are available Jul 19 21:45:42 ruthie esmith::event[32202]: You may use your browser or the occ upgrade command to do the upgrade Jul 19 21:45:42 ruthie esmith::event[32202]: Maintenance mode enabled Jul 19 21:45:42 ruthie esmith::event[32202]: Nextcloud or one of the apps require upgrade - only a limited number of commands are available Jul 19 21:45:42 ruthie esmith::event[32202]: You may use your browser or the occ upgrade command to do the upgrade Jul 19 21:45:42 ruthie esmith::event[32202]: accessibility 1.7.0 disabled Jul 19 21:45:43 ruthie esmith::event[32202]: Phase 1/7: Checking and upgrading mysql database Jul 19 21:45:43 ruthie esmith::event[32202]: Processing databases Jul 19 21:45:43 ruthie esmith::event[32202]: mysql Jul 19 21:45:43 ruthie esmith::event[32202]: mysql.column_stats OK Jul 19 21:45:43 ruthie esmith::event[32202]: mysql.columns_priv OK Jul 19 21:45:43 ruthie esmith::event[32202]: mysql.db OK Jul 19 21:45:43 ruthie esmith::event[32202]: mysql.event OK Jul 19 21:45:43 ruthie esmith::event[32202]: mysql.func OK Jul 19 21:45:43 ruthie esmith::event[32202]: mysql.global_priv OK Jul 19 21:45:43 ruthie esmith::event[32202]: mysql.gtid_slave_pos OK Jul 19 21:45:43 ruthie esmith::event[32202]: mysql.help_category OK Jul 19 21:45:43 ruthie esmith::event[32202]: mysql.help_keyword OK Jul 19 21:45:43 ruthie esmith::event[32202]: mysql.help_relation OK Jul 19 21:45:43 ruthie esmith::event[32202]: mysql.help_topic OK Jul 19 21:45:43 ruthie esmith::event[32202]: mysql.index_stats OK Jul 19 21:45:43 ruthie esmith::event[32202]: mysql.innodb_index_stats OK Jul 19 21:45:43 ruthie esmith::event[32202]: mysql.innodb_table_stats OK Jul 19 21:45:43 ruthie esmith::event[32202]: mysql.plugin OK Jul 19 21:45:43 ruthie esmith::event[32202]: mysql.proc OK Jul 19 21:45:43 ruthie esmith::event[32202]: mysql.procs_priv OK Jul 19 21:45:43 ruthie esmith::event[32202]: mysql.proxies_priv OK Jul 19 21:45:43 ruthie esmith::event[32202]: mysql.roles_mapping OK Jul 19 21:45:43 ruthie esmith::event[32202]: mysql.servers OK Jul 19 21:45:43 ruthie esmith::event[32202]: mysql.table_stats OK Jul 19 21:45:43 ruthie esmith::event[32202]: mysql.tables_priv OK Jul 19 21:45:43 ruthie esmith::event[32202]: mysql.time_zone OK Jul 19 21:45:43 ruthie esmith::event[32202]: mysql.time_zone_leap_second OK Jul 19 21:45:43 ruthie esmith::event[32202]: mysql.time_zone_name OK Jul 19 21:45:43 ruthie esmith::event[32202]: mysql.time_zone_transition OK Jul 19 21:45:43 ruthie esmith::event[32202]: mysql.time_zone_transition_type OK Jul 19 21:45:43 ruthie esmith::event[32202]: mysql.transaction_registry OK Jul 19 21:45:43 ruthie esmith::event[32202]: Phase 2/7: Installing used storage engines... Skipped Jul 19 21:45:43 ruthie esmith::event[32202]: Phase 3/7: Fixing views Jul 19 21:45:43 ruthie esmith::event[32202]: mysql.user OK Jul 19 21:45:43 ruthie esmith::event[32202]: Phase 4/7: Running 'mysql_fix_privilege_tables' Jul 19 21:45:43 ruthie esmith::event[32202]: Phase 5/7: Fixing table and database names Jul 19 21:45:43 ruthie esmith::event[32202]: Phase 6/7: Checking and upgrading tables Jul 19 21:45:43 ruthie esmith::event[32202]: Processing databases Jul 19 21:45:43 ruthie esmith::event[32202]: information_schema Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_accounts OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_activity OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_activity_mq OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_addressbookchanges OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_addressbooks OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_appconfig OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_authtoken OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_bruteforce_attempts OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_calendar_invitations OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_calendar_reminders OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_calendar_resources OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_calendar_resources_md OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_calendar_rooms OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_calendar_rooms_md OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_calendarchanges OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_calendarobjects OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_calendarobjects_props OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_calendars OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_calendarsubscriptions OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_cards OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_cards_properties OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_collres_accesscache OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_collres_collections OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_collres_resources OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_comments OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_comments_read_markers OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_dav_cal_proxy OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_dav_shares OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_direct_edit OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_directlink OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_federated_reshares OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_file_locks OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_filecache OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_filecache_extended OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_files_trash OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_flow_checks OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_flow_operations OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_flow_operations_scope OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_group_admin OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_group_user OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_groups OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_jobs OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_ldap_group_mapping OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_ldap_group_members OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_ldap_user_mapping OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_login_flow_v2 OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_migrations OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_mimetypes OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_mounts OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_notifications OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_notifications_pushtokens OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_oauth2_access_tokens OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_oauth2_clients OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_preferences OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_privacy_admins OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_properties OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_recent_contact OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_schedulingobjects OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_share OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_share_external OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_storages OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_storages_credentials OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_systemtag OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_systemtag_group OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_systemtag_object_mapping OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_text_documents OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_text_sessions OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_text_steps OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_trusted_servers OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_twofactor_backupcodes OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_twofactor_providers OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_user_status OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_user_transfer_owner OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_users OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_vcategory OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_vcategory_to_object OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_webauthn OK Jul 19 21:45:43 ruthie esmith::event[32202]: nextcloud.oc_whats_new OK Jul 19 21:45:43 ruthie esmith::event[32202]: performance_schema Jul 19 21:45:43 ruthie esmith::event[32202]: Phase 7/7: Running 'FLUSH PRIVILEGES' Jul 19 21:45:43 ruthie esmith::event[32202]: OK Jul 19 21:45:44 ruthie esmith::event[32202]: Nextcloud or one of the apps require upgrade - only a limited number of commands are available Jul 19 21:45:44 ruthie esmith::event[32202]: You may use your browser or the occ upgrade command to do the upgrade Jul 19 21:45:44 ruthie esmith::event[32202]: System config value dbhost set to string localhost:/run/rh-mariadb105-mariadb/nextcloud-mysql.sock Jul 19 21:45:44 ruthie esmith::event[32202]: An unhandled exception has been thrown: Jul 19 21:45:44 ruthie esmith::event[32202]: Doctrine\DBAL\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [1698] Access denied for user 'nxtcld'@'localhost' in /usr/share/nextcloud/lib/private/DB/Connection.php:85

NethServer Version: 7.9.2009
Module: nethserver-nextcloud-1.17.1-1

Hi @Ted,
could you try to update nextcloud again from terminal.

yum update nethserver-nextcloud

Also you can try to connect to the right database like @giacomo described at the following thread:

2 Likes

It is trying to connect to the database with a user that does not exists or has no privileges for it. Check the dbuser on nextcloud’s config.php and on the mariadb105 server.

1 Like

Hi there,

Thanks for having a look. This doesn’t seem to yield any new results.

Yum says the nextcloud packages are fully up to date (I think they installed correctly).

# yum update nethserver-nextcloud
No packages marked for update

1.17.1-1 is the updated version, right?

# rpm -qa | grep nextcloud
nethserver-nextcloud-1.17.1-1.ns7.noarch

I don’t understand what should be happening with the command @giacomo is using, however, nothing happens in the logs when I execute:

# scl enable rh-mariadb105 /bin/bash

Running the signal event update just gives me a long series of stack traces as each nextcloud execution fails to connect to the database:

esmith::event[18131]: Doctrine\DBAL\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [1698] Access denied for user 'nxtcld'@'localhost' in /usr/share/nextcloud/lib/private/DB/Connection.php:85
Jul 20 11:30:40 ruthie esmith::event[18131]: Stack trace:
[snip]

I’ve read through the linked thread. I’m not following how they determined that nextcloud’s db was still in an old version of mariadb. How would I check for that? Also, my database is not called nextcloud. Is there a way to check the name of the database mariadb is querying? Could it be as simple as a standard db name hardcoded somewhere?

Thanks!
Ted

/usr/share/nextcloud/config/config.php file but you also have to have the db user with matching credentials and sufficient privileges on the rh-mariadb105

2 Likes

Ah! I think we’re getting somewhere!

config.php all looks correct. It contains the nxcld user and password and points to the db which in this case is named “coxcloud.”

/opt/rh/rh-mariadb105/root/bin/mysqlshow --socket="/var/run/rh-mariadb105-mariadb/nextcloud-mysql.sock"
+--------------------+
| Databases |
+--------------------+
| information_schema |
| mysql |
| nextcloud |
| performance_schema |
+--------------------+

Note that the above does not display the coxcloud db but instead shows nextcloud. Am I correct in assuming this is the problem?

# mysqlshow
+--------------------+
| Databases |
+--------------------+
| information_schema |
| coxcloud |
| mysql |
| performance_schema |
+--------------------+

It does show up there.

# /opt/rh/rh-mariadb105/root/bin/mysql --socket="/var/run/rh-mariadb105-mariadb/nextcloud-mysql.sock" -e 'SELECT user FROM mysql.user'
+-------------+
| User |
+-------------+
| mariadb.sys |
| mysql |
| nextcloud |
| root |
+-------------+

# mysql -e 'SELECT user FROM mysql.user'
+-----------+
| user |
+-----------+
| oc_admin |
| oc_admin1 |
| oc_admin2 |
| root |
| root |
| |
| nextcloud |
| nxtcld |
| oc_admin |
| oc_admin1 |
| oc_admin2 |
| root |
| |
| root |
+-----------+

# grep \'db /usr/share/nextcloud/config/config.php |grep -v dbpass
'dbtype' => 'mysql',
'dbname' => 'coxcloud',
'dbhost' => 'localhost:/run/rh-mariadb105-mariadb/nextcloud-mysql.sock',
'dbport' => '',
'dbtableprefix' => 'oc_',
'dbuser' => 'nxtcld',

So you have to import the database and user from default centos mysql/mariadb (5.x) to the new rh-mariadb105

2 Likes

Thanks @dnutan! That was the problem! :slight_smile:

Here were my steps to solve for the next person:

  1. Dump a copy of the database from the old mariadb:

# mysqldump [database_name] > [database_name].dump

  1. Create a new database using the same name in RH MariaDB 105:

# /opt/rh/rh-mariadb105/root/bin/mysqladmin --socket="/var/run/rh-mariadb105-mariadb/nextcloud-mysql.sock" -p create [database_name]

  1. Load your data into the new db:

# /opt/rh/rh-mariadb105/root/bin/mysql --socket="/var/run/rh-mariadb105-mariadb/nextcloud-mysql.sock" -p [database_name] < [database_name].dump

  1. Create the old user on the new Maria DB instance:

# /opt/rh/rh-mariadb105/root/bin/mysql --socket="/var/run/rh-mariadb105-mariadb/nextcloud-mysql.sock"
MariaDB [(none)]> CREATE USER '[username]'@'localhost' IDENTIFIED BY '[password]';\

  1. Grant the user privileges to access and edit the db.

MariaDB [(none)]> connect [database_name]
MariaDB [database_name]> GRANT ALL PRIVILEGES ON *.* TO '[username]'@'localhost';\
MariaDB [database_name]> FLUSH PRIVILEGES;

2 Likes