Nextcloud/MariaDB install failure

I’m having a problem installing Nextcloud on an Odroid HC-1 with an external drive. The install fails during MariaDB installation. This is pretty much identical to: https://dietpi.com/forum/t/nextcloud-mariadb-install-error/2378/1 (and therefore https://github.com/Fourdee/DietPi/issues/1850). That was put down to a ‘hardware issue’ due to insufficient power, but I’m not convinced that’s the case. I have a 3A supply driving the Odroid and it’s never pulling even half that amount.

During the install, any existing /var/lib/mysql symlink is removed and recreated pointing to /mnt/dietpi_userdata/mysql. In my case, the latter actually resolves as /media/data/dietpi_userdata/mysql and is owned by mysql:mysql.

I successfully set up DP/Nextcloud on this machine, but then realised that I hadn’t changed the user data location to the hard drive. So I know everything installs okay on this rig. I then did a completely fresh install (reflashed the SD), did all the necessary setting up as normal, then mounted the HD (including an fstab entry) and then changed the user data. Then I tried installing Nextcloud and started hitting the MariaDB install issues.

I’ve tried completely removing/purging MariaDB and trying again, and even all other non-default software, but same failure every time.

Here’s the error output:

#### Details:
- Date           | Fri  7 Dec 18:42:30 CET 2018
- Bug report     | N/A
- DietPi version | v6.19.6 (Fourdee/master)
- Img creator    | DietPi Core Team
- Pre-image      | Meveric
- SBC device     | Odroid XU3/XU4/HC1/HC2 (armv7l) (index=11)
- Kernel version | #1 SMP PREEMPT Thu Aug 23 05:59:33 UTC 2018
- Distro         | stretch (index=4)
- Command        | G_AGI: mariadb-server
- Exit code      | 100
- Software title | DietPi-Software

#### Additional logs:

Log file contents:
Selecting previously unselected package rsync.
Preparing to unpack …/13-rsync_3.1.2-1+deb9u1_armhf.deb …
Unpacking rsync (3.1.2-1+deb9u1) …
Selecting previously unselected package libwrap0:armhf.
Preparing to unpack …/14-libwrap0_7.6.q-26_armhf.deb …
Unpacking libwrap0:armhf (7.6.q-26) …
Selecting previously unselected package socat.
Preparing to unpack …/15-socat_1.7.3.1-2+deb9u1_armhf.deb …
Unpacking socat (1.7.3.1-2+deb9u1) …
Setting up mysql-common (5.8+1.0.2) …
update-alternatives: using /etc/mysql/my.cnf.fallback to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Setting up mariadb-common (10.1.37-0+deb9u1) …
update-alternatives: using /etc/mysql/mariadb.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Selecting previously unselected package mariadb-server-10.1.
(Reading database … 16727 files and directories currently installed.)
Preparing to unpack …/mariadb-server-10.1_10.1.37-0+deb9u1_armhf.deb …
Unpacking mariadb-server-10.1 (10.1.37-0+deb9u1) …
Selecting previously unselected package mariadb-server.
Preparing to unpack …/mariadb-server_10.1.37-0+deb9u1_all.deb …
Unpacking mariadb-server (10.1.37-0+deb9u1) …
Setting up libatomic1:armhf (6.3.0-18+deb9u1) …
Setting up libconfig-inifiles-perl (2.94-1) …
Setting up libjemalloc1 (3.6.0-9.1) …
Setting up lsof (4.89+dfsg-0.1) …
Setting up rsync (3.1.2-1+deb9u1) …
Processing triggers for libc-bin (2.24-11+deb9u3) …
Setting up libaio1:armhf (0.3.110-3) …
Setting up galera-3 (25.3.19-2) …
Processing triggers for systemd (232-25+deb9u6) …
Setting up libreadline5:armhf (5.2+dfsg-3+b1) …
Setting up libdbi-perl (1.636-1+b1) …
Setting up libwrap0:armhf (7.6.q-26) …
Setting up mariadb-server-core-10.1 (10.1.37-0+deb9u1) …
Setting up socat (1.7.3.1-2+deb9u1) …
Setting up mariadb-client-core-10.1 (10.1.37-0+deb9u1) …
Setting up mariadb-client-10.1 (10.1.37-0+deb9u1) …
Setting up mariadb-server-10.1 (10.1.37-0+deb9u1) …
dpkg: error processing package mariadb-server-10.1 (–configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mariadb-server:
mariadb-server depends on mariadb-server-10.1 (>= 10.1.37-0+deb9u1); however:
Package mariadb-server-10.1 is not configured yet.

dpkg: error processing package mariadb-server (–configure):
dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.24-11+deb9u3) …
Errors were encountered while processing:
mariadb-server-10.1
mariadb-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

Hmm, jep you are not the only one with this issue indeed. I’m still not sure about the reason, since Fourdee and me could not replicate. Even with userdata moved to external drive it works well here :thinking:.

Which file system do you use on the external drive and does it have an external PSU, so not receive all power via USB?
To really sort out insufficient power issues, please check: dmesg

If we cannot find out the reason for MariaDB install failing with external userdata, we could reorder the install steps:

  • First install MariaDB to not symlinked /var/lib/mysql.
  • Then stop service, mv /var/lib/mysql /mnt/dietpi_userdata/mysql and place the symlink.
  • Hope that then MariaDB starts up without error.

On reinstalls (mariadb-server package already installed), we then need to skip these steps.

Can you please try to install MariaDB first, then run dietpi-software:

apt-get -y purge mariadb*
rm -R /var/lib/mysql
rm -R /mnt/dietpi_userdata/mysql
rm -R /media/data/dietpi_userdata/mysql
apt-get -y install mariadb-server
dietpi-software install 114 # This installs Nextcloud

As I mentioned, I’m using an HC1 so the HD is powered via the computer’s SATA port - it’s not USB. But the computer is getting plenty of power to do this.

On one of the occasions when it failed (I’ve tried many times now), I did ensure that MariaDB was fully uninstalled, then tried installing it on its own via apt, and that failed too. Can’t remember what I did about symlinks, though.

I’ve since got Nextcloud up and running on Armbian on this device. (FYI, I metered the power consumption and it was pulling an absolute max of 1.9A from a 3.2A supply.) However, I have a second HC1 so will try again with that and report back.

Okay, so I had a moment to play with my second Odroid HC1 and here’s how it went:

  • 1st boot - updated & upgraded. Then reboot per normal.
  • 2nd boot - finished install - no special config - reboot per normal.
  • Formatted HD, amended fstab, mounted HD.
  • Installed mariadb-server using apt.
  • Used dietpi-software to move userdata location to /media/data/dietpi_userdata
  • Ran: dietpi-software install 114
  • Waited for a very long time just after: systemctl restart mariadb - but eventually installed without error.
  • Going to the Nextcloud server via the web interface I was greeted with a normal login screen, not the ‘set up an admin account’ screen I was expecting.
  • Set a new admin password from command line using: sudo -u www-data php /var/www/nextcloud/occ user:resetpassword admin
  • But when I tried to log in via the web interface, nothing happened - just spinning wheel of death on login page, so…
  • Rebooted & then all okay

So, finally a successful install. Hope this helps. Please don’t ask for more info because, as I said, I’ve already got Nextcloud running fine on the first HC1 on Armbian. This second HC1 is destined to be an OMV box and I need to get on installing that now.

Awesome…great job