[Solved] NextCloudPi: Curl installation on Debian failing - Mariadb won't start

I’ve been running NCP for a year or so on a Rock64, in a Docker container. It’s a bit sluggish, and it loses the SSL certificate every 3 months, so I decided to set up Debian on an old Core2Duo, and do a standard install of NCP.

(I appreciate the convenience of NCP’s web interface and the ncp-config utility, so would prefer to use NCP if at all possible.)

I ran the Curl installer, but have hit a snag that I can’t seem to find a solution for anywhere online. I’ll be very grateful if the community here is able to help.

Everything seems to work with the installation until it gets to this point:

Downloading Nextcloud 19.0.3...
Installing  Nextcloud 19.0.3...
Creating possible missing Directories
chmod Files and Directories
chown Directories
chmod/chown .htaccess
Setting up database...
Setting up Apache...
Enabling site nextcloud.
To activate the new configuration, you need to run:
  systemctl reload apache2
Setting up system...
Don't forget to run nc-init
Job for mariadb.service failed because the control process exited with error code.
See "systemctl status mariadb.service" and "journalctl -xe" for details.

Running systemctl status mariadb.service produces:

mariadb.service - MariaDB 10.3.23 database server
   Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Thu 2020-10-08 23:05:51 PDT; 18h ago
     Docs: man:mysqld(8)
           https://mariadb.com/kb/en/library/systemd/
  Process: 26374 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exi
  Process: 26375 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=ex
  Process: 26377 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`cd /us
  Process: 26472 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION
 Main PID: 26472 (code=exited, status=1/FAILURE)
   Status: "MariaDB server is down"

And journalctl -xe gives:

Oct 09 17:31:51 [myserver] anacron[27411]: Anacron 2.3 started on 2020-10-09
Oct 09 17:31:51 [myserver] anacron[27411]: Normal exit (0 jobs run)
Oct 09 17:31:51 [myserver] systemd[1]: anacron.service: Succeeded.
-- Subject: Unit succeeded
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- The unit anacron.service has successfully entered the 'dead' state.
Oct 09 17:39:01 [myserver] CRON[27413]: pam_unix(cron:session): session opened for user root by (uid=0)
Oct 09 17:39:01 [myserver] CRON[27414]: (root) CMD (  [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)
Oct 09 17:39:01 [myserver] CRON[27413]: pam_unix(cron:session): session closed for user root
Oct 09 17:45:01 [myserver] CRON[27417]: pam_unix(cron:session): session opened for user www-data by (uid=0)
Oct 09 17:45:01 [myserver] CRON[27418]: (www-data) CMD (php -f /var/www/nextcloud/cron.php)
Oct 09 17:45:01 [myserver] CRON[27417]: pam_unix(cron:session): session closed for user www-data
Oct 09 17:58:36 [myserver] sudo[27429]:     clay : TTY=pts/1 ; PWD=/home/[myuser] ; USER=root ; COMMAND=/usr/bin/journalctl -xe
Oct 09 17:58:36 [myserver] sudo[27429]: pam_unix(sudo:session): session opened for user root by [myuser](uid=0)

In researching, I came across this thread, so tried running mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql, but that gave the following output:

Installing MariaDB/MySQL system tables in '/var/lib/mysql' ...

Installation of system tables failed!  Examine the logs in
/var/lib/mysql for more information.

The problem could be conflicting information in an external
my.cnf files. You can ignore these by doing:

    shell> /usr/bin/mysql_install_db --defaults-file=~/.my.cnf

You can also try to start the mysqld daemon with:

    shell> /usr/sbin/mysqld --skip-grant-tables --general-log &

and use the command line tool /usr/bin/mysql
to connect to the mysql database and look at the grant tables:

    shell> /usr/bin/mysql -u root mysql
    mysql> show tables;

Try 'mysqld --help' if you have problems with paths.  Using
--general-log gives you a log in /var/lib/mysql that may be helpful.

The latest information about mysql_install_db is available at
https://mariadb.com/kb/en/installing-system-tables-mysql_install_db
You can find the latest source at https://downloads.mariadb.org and
the maria-discuss email list at https://launchpad.net/~maria-discuss

Please check all of the above before submitting a bug report
at http://mariadb.org/jira

Hopefully that’s a good start to get the troubleshooting going. If there’s anything else that would be helpful, I’ll be happy to add.

Thanks!

Hmm, unsure. I do see a lot of hits possibly related to this on the Nextcloud Github repo.

Thanks! I looked through the search hits you linked on the NCP GItHub site. I’d found a couple of them in my earlier search, but the list you provided had a few more, so went through all of them. Unfortunately, if any of them are the same as what I’m running into (or closely related), I’m not quite able to make the connection enough to fix my issue. :frowning:

I appreciate the help!

Hi,
Sometimes the curl installer breaks due to upstream changes, to check;
I ran the curl installer, this morning, on a fresh installed debian 10 VM, and it works without a problem.
Maybe you encountered a temporary network error.
I suggest you try again and/or check integrity of fs and drives.

Unfortunately, running the installer again didn’t seem to do the trick. It gets stuck at the same point. For what it’s worth, in case it’s helpful additional detail, I’m running the command with sudo bash because it wouldn’t work at all without that:

curl -sSL https://raw.githubusercontent.com/nextcloud/nextcloudpi/master/install.sh | sudo bash

I’m not sure if that hints at anything else that could be going wrong, but I figured it couldn’t hurt to mention.

I appreciate all the ideas!

The curl installer will not fix things when running a second time.
I meant doing a clean basic and minimal Debian 10 install, with only ssh and curl installed.
If you already have components (mariadb, apache2, etc.) installed, it will fail.
And sudo is required, when not running as root.

This one is definitely a head scratcher. I just did a full reinstall of Debian 10 (10.6 LXQt Edition, for what it’s worth). Literally all I ran was an update, an upgrade, installed SSH server, installed curl, ran sudo su, and ran the NCP curl installer… Then it failed again at the same point (starting Mariadb). This seems so strange.

The machine I’m working on is an old Mac Mini 3,1 (early-2009). I doubt that would make a difference, but figured it couldn’t hurt to err on the side of too much info. :slight_smile:

Please share the full log if you can. Remove any sensitive info.

Sounds good. Here goes…

First up, the three logs in the apache2 directory were all blank (access.log, error.log, and other_vhosts_access.log).

MySQL error.log:

2020-10-12 10:40:40 0 [Warning] The parameter innodb_file_format is deprecated and has no effect. It may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-$
2020-10-12 10:40:40 0 [Note] InnoDB: Using Linux native AIO
2020-10-12 10:40:40 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2020-10-12 10:40:40 0 [Note] InnoDB: Uses event mutexes
2020-10-12 10:40:40 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2020-10-12 10:40:40 0 [Note] InnoDB: Number of pools: 1
2020-10-12 10:40:40 0 [Note] InnoDB: Using generic crc32 instructions
2020-10-12 10:40:40 0 [Note] InnoDB: Initializing buffer pool, total size = 256M, instances = 1, chunk size = 128M
2020-10-12 10:40:40 0 [Note] InnoDB: Completed initialization of buffer pool
2020-10-12 10:40:40 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2020-10-12 10:40:40 0 [Note] InnoDB: Resizing redo log from 2*50331648 to 2*33554432 bytes; LSN=1625457
2020-10-12 10:40:40 0 [Note] InnoDB: Starting to delete and rewrite log files.
2020-10-12 10:40:40 0 [Note] InnoDB: Setting log file ./ib_logfile101 size to 33554432 bytes
2020-10-12 10:40:40 0 [Note] InnoDB: Setting log file ./ib_logfile1 size to 33554432 bytes
2020-10-12 10:40:40 0 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2020-10-12 10:40:40 0 [Note] InnoDB: New log files created, LSN=1625457
2020-10-12 10:40:40 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2020-10-12 10:40:40 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2020-10-12 10:40:40 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2020-10-12 10:40:40 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2020-10-12 10:40:40 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2020-10-12 10:40:40 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2020-10-12 10:40:40 0 [Note] InnoDB: 10.3.23 started; log sequence number 1625457; transaction id 21
2020-10-12 10:40:40 0 [Note] Plugin 'FEEDBACK' is disabled.
2020-10-12 10:40:40 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2020-10-12 10:40:40 0 [Note] InnoDB: Buffer pool(s) load completed at 201012 10:40:40
2020-10-12 10:40:40 0 [Note] Server socket created on IP: '127.0.0.1'.
2020-10-12 10:40:40 0 [Note] Reading of all Master_info entries succeeded
2020-10-12 10:40:40 0 [Note] Added new Master_info '' to hash table
2020-10-12 10:40:40 0 [Note] mysqld: ready for connections.
Version: '10.3.23-MariaDB-0+deb10u1'  socket: '/run/mysqld/mysqld.sock'  port: 3306  Debian 10
2020-10-12 10:41:59 0 [ERROR] mysqld: Can't lock aria control file '/var/lib/mysql/aria_log_control' for exclusive use, error: 11. Will retry for 30 seconds
2020-10-12 10:42:30 0 [ERROR] mysqld: Got error 'Could not get an exclusive lock; file is probably in use by another process' when trying to use aria control file '/var/lib/mysql/aria_log_cont$
2020-10-12 10:42:30 0 [ERROR] Plugin 'Aria' init function returned error.
2020-10-12 10:42:30 0 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed.
2020-10-12 10:42:30 0 [Warning] The parameter innodb_file_format is deprecated and has no effect. It may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-$
2020-10-12 10:42:30 0 [Note] InnoDB: Using Linux native AIO
2020-10-12 10:42:30 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2020-10-12 10:42:30 0 [Note] InnoDB: Uses event mutexes
2020-10-12 10:42:30 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2020-10-12 10:42:30 0 [Note] InnoDB: Uses event mutexes
2020-10-12 10:42:30 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2020-10-12 10:42:30 0 [Note] InnoDB: Number of pools: 1
2020-10-12 10:42:30 0 [Note] InnoDB: Using generic crc32 instructions
2020-10-12 10:42:30 0 [Note] InnoDB: Initializing buffer pool, total size = 256M, instances = 1, chunk size = 128M
2020-10-12 10:42:30 0 [Note] InnoDB: Completed initialization of buffer pool
2020-10-12 10:42:30 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2020-10-12 10:42:30 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11
2020-10-12 10:42:30 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
2020-10-12 10:42:30 0 [Note] InnoDB: Retrying to lock the first data file
2020-10-12 10:42:31 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11
2020-10-12 10:42:31 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
2020-10-12 10:42:32 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11
2020-10-12 10:42:32 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
2020-10-12 10:42:33 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11
2020-10-12 10:42:33 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
2020-10-12 10:42:34 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11
2020-10-12 10:42:34 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
2020-10-12 10:42:35 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11
2020-10-12 10:42:35 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
2020-10-12 10:44:10 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11
2020-10-12 10:44:10 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
2020-10-12 10:44:10 0 [Note] InnoDB: Unable to open the first data file
2020-10-12 10:44:10 0 [ERROR] InnoDB: Operating system error number 11 in a file operation.
2020-10-12 10:44:10 0 [ERROR] InnoDB: Error number 11 means 'Resource temporarily unavailable'
2020-10-12 10:44:10 0 [Note] InnoDB: Some operating system error numbers are described at https://mariadb.com/kb/en/library/operating-system-error-codes/
2020-10-12 10:44:10 0 [ERROR] InnoDB: Cannot open datafile './ibdata1'
2020-10-12 10:44:10 0 [ERROR] InnoDB: Could not open or create the system tablespace. If you tried to add new data files to the system tablespace, and it failed here, you should now edit innod$
2020-10-12 10:44:10 0 [ERROR] InnoDB: Plugin initialization aborted with error Cannot open a file
2020-10-12 10:44:10 0 [Note] InnoDB: Starting shutdown...
2020-10-12 10:44:11 0 [ERROR] Plugin 'InnoDB' init function returned error.
2020-10-12 10:44:11 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2020-10-12 10:44:11 0 [Note] Plugin 'FEEDBACK' is disabled.
2020-10-12 10:44:11 0 [ERROR] Unknown/unsupported storage engine: InnoDB
2020-10-12 10:44:11 0 [ERROR] Aborting

Warning: Memory not freed: 520

php7.3-fpm.log

[12-Oct-2020 10:41:19] NOTICE: fpm is running, pid 17833
[12-Oct-2020 10:41:19] NOTICE: ready to handle connections
[12-Oct-2020 10:41:19] NOTICE: systemd monitor interval set to 10000ms

ncp.log

[ nc-nextcloud ] (Mon 12 Oct 2020 10:41:20 AM PDT)
Downloading Nextcloud 19.0.3...
Installing  Nextcloud 19.0.3...
Creating possible missing Directories
chmod Files and Directories
chown Directories
chmod/chown .htaccess
Setting up database...
Setting up Apache...
Enabling site nextcloud.
To activate the new configuration, you need to run:
  systemctl reload apache2
Setting up system...
Don't forget to run nc-init

The MySQL log looks to have some interesting issues, but I’m not sure how to interpret them. If I missed any logs that could be helpful, I’ll be happy to add them. Thanks again!

The ncp.log indicates it did not complete.
Try running nc-init as it suggests and monitor ncp.log
It should report init done when completed.

Sorry, I should have mentioned that I’ve tried to run nc-init, and it returns a command not found error. :frowning:

Okay, I got this one whipped, so I wanted to post the fix in case anybody else ever runs into this same issue.

In short, the workaround is to do a manual install of MariaDB. It seems so obvious/simple in retrospect, but I guess that’s how these things go sometimes. :smiley: I restarted from a totally clean Debian install, and didn’t test whether or not it would also work after an initial NCP install attempt had failed.

In case the steps are handy, here’s how to install MariaDB:
apt install mariadb-server

Check to make sure the service is up and running:
systemctl status mariadb

For me, it wasn’t running. To fix that, you can do:
systemctl enable mariadb

Then:
systemctl start mariadb

Running systemctl status mariadb again should show you that the service is up and running. If it is indeed running, you should be good to go now with the curl installer.