DevHeads.net

Upgrade path from MySQL to MariaDB broken? (Akonadi)

Hi!

I'm trying to install Nextcloud. I'm following the instructions in the
Nextcloud 12 Server Administration Manual, Installation on Linux:
<a href="https://docs.nextcloud.com/server/12/admin_manual/installation/" title="https://docs.nextcloud.com/server/12/admin_manual/installation/">https://docs.nextcloud.com/server/12/admin_manual/installation/</a>
source_installation.html#installation-on-linux

According to these instructions, mariadb-server needs to be installed. This
seems to work:

~ % LANG=C apt-get install mariadb-server
...
The following additional packages will be installed:
mariadb-client-10.0 mariadb-client-core-10.0 mariadb-server-10.0 mariadb-
server-core-10.0
Suggested packages:
mariadb-test tinyca
The following packages will be REMOVED:
mysql-client-core-5.7 mysql-server-core-5.7
The following NEW packages will be installed:
mariadb-client-10.0 mariadb-client-core-10.0 mariadb-server mariadb-
server-10.0 mariadb-server-core-10.0
...

There is also this, twice:

...
dpkg: mysql-client-core-5.7: dependency problems, but removing anyway as you
requested:
akonadi-backend-mysql depends on mysql-client-core-5.7 | virtual-mysql-
client-core; however:
Package mysql-client-core-5.7 is to be removed.
Package virtual-mysql-client-core is not installed.
Package mysql-client-core-5.7 which provides virtual-mysql-client-core is to
be removed.
akonadi-backend-mysql depends on mysql-client-core-5.7 | virtual-mysql-
client-core; however:
Package mysql-client-core-5.7 is to be removed.
Package virtual-mysql-client-core is not installed.
Package mysql-client-core-5.7 which provides virtual-mysql-client-core is to
be removed.
...

This looks like an error, but it's okay. The missing dependency of akonadi-
backend-mysql is fulfilled later, when mariadb-server is installed.
mariadb-server depends on mariadb-server-10.0, and mariadb-server-10.0
provides virtual-mysql-server:

...
Selecting previously unselected package mariadb-server.
Preparing to unpack .../mariadb-server_10.0.31-0ubuntu0.16.04.2_all.deb ...
Unpacking mariadb-server (10.0.31-0ubuntu0.16.04.2) ...
...
Setting up mariadb-client-core-10.0 (10.0.31-0ubuntu0.16.04.2) ...

But, afterwards, Akonadi won't start any longer! It says:

desktop ~ $ akonadictl stop
desktop ~ $ akonadictl start
Starting Akonadi Server...
done.
Connecting to deprecated signal
QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
desktop ~ $ akonadiprivate_log: search paths: ("/root/bin", "/home/v/bin", "/
sbin", "/usr/sbin", "/bin", "/usr/bin", "/usr/local/bin", "/usr/local/sbin",
"/usr/bin/X11", "/usr/local/opt/kde/kdesrc-build", "/usr/sbin", "/usr/local/
sbin", "/usr/local/libexec", "/usr/libexec", "/opt/mysql/libexec", "/opt/
local/lib/mysql5/bin", "/opt/mysql/sbin")
Found mysql_install_db: "/usr/bin/mysql_install_db"
Found mysqlcheck: "/usr/bin/mysqlcheck"
Using mysqld: "/usr/sbin/mysqld-akonadi"
mysqld reports version 10.0.31 (MariaDB)
Executing: "/usr/sbin/mysqld-akonadi" "--defaults-file=/home/v/.local/share/
akonadi/mysql.conf --datadir=/home/v/.local/share/akonadi/db_data/ --socket=/
tmp/akonadi-v.FJ0ric/mysql.socket"
Database process exited unexpectedly during initial connection!
executable: "/usr/sbin/mysqld-akonadi"
arguments: ("--defaults-file=/home/v/.local/share/akonadi/mysql.conf", "--
datadir=/home/v/.local/share/akonadi/db_data/", "--socket=/tmp/akonadi-
v.FJ0ric/mysql.socket")
stdout: ""
stderr: "170810 19:37:32 [Note] /usr/sbin/mysqld (mysqld 10.0.31-
MariaDB-0ubuntu0.16.04.2) starting as process 6971 ...\n"
exit code: 1
process error: "Unknown error"
terminating service threads
terminating connection threads
stopping db process
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/tmp/akonadi-
v.FJ0ric/mysql.socket' (2 "No such file or directory")'
Check that mysqld is running and that the socket: '/tmp/akonadi-v.FJ0ric/
mysql.socket' exists!
Failed to remove Unix socket
Failed to remove runtime connection config file
Application 'akonadiserver' exited normally...

desktop ~ $ akonadictl status
Akonadi Control: stopped
Akonadi Server: stopped
akonadiprivate_log: search paths: ("lib/x86_64-linux-gnu", "lib/x86_64-linux-
gnu/qt5/plugins/", "lib/x86_64-linux-gnu/kf5/", "lib/x86_64-linux-gnu/kf5/
plugins/", "/usr/lib/qt5/plugins/", "/usr/lib/x86_64-linux-gnu/qt5/plugins",
"/usr/bin")
Akonadi Server Search Support: available (Remote Search)
Available Agent Types: (...)

When I fall back to mysql, and install mysql-client-core-5.7 and mysql-server-
core-5.7 again, then Akonadi (and KMail and what else is using it) works
again.

The problem does not go away when you shut down akonadi before installing
mariadb-server. Neither does logging out and in again help.

This looks like a packaging problem to me. Should I file a bug report? Can this
be made work?

Thanks,
Volker

Comments

(Solved) Re: Upgrade path from MySQL to MariaDB broken? (Akonadi

By Volker Wysk at 08/14/2017 - 00:09

Hello!

I've found it out, how you can solve/work around the problem:

Nextcloud needs MariaDB. It won't work (so it seems) with MySQL. So mariadb-
server needs to be installed.

This replaces MySQL (mysql-server-core-5.7 and mysql-client-core-5.7) with
MariaDB. The problem is that after that, Akonadi won't start any longer.
"aconadictl start" outputs a lot of messages.

The problem can be repaired by doing this, after the installation of MariaDB:

akonadictl stop
rm -r ~/.local/share/akonadi
akonadictl start

Bye,
Volker

Re: (Solved) Re: Upgrade path from MySQL to MariaDB broken? (Ako

By Oliver Grawert at 08/14/2017 - 04:01

hi,
Am Montag, den 14.08.2017, 07:09 +0200 schrieb Volker Wysk:
just as a sidenote ... did you consider using the nextcloud snap ?

it is maintained by nextcloud themslves, updated timely and completely
independent from the OS or the deb (usually new releases are
immediately available when upstream releases) and thanks to the
isolated nature of snap packages nothing can interfere with any system
databases...

ciao
oli

Re: (Solved) Re: Upgrade path from MySQL to MariaDB broken? (Ako

By Volker Wysk at 08/14/2017 - 04:52

Am Montag, 14. August 2017, 11:01:04 CEST schrieb Oliver Grawert:
Yes, I have used it. I'm installing in accordance with the Nextcloud 12 Server
Administration Manual.

There it is written that first, "sudo snap install nextcloud" should be done,
and then "apt-get install apache2 mariadb-server libapache2-mod-php7.0".

Looks like MariaDB is _not_ contained in the snap package.

Happy hacking,
Volker

Re: (Solved) Re: Upgrade path from MySQL to MariaDB broken? (Ako

By Oliver Grawert at 08/14/2017 - 04:57

Am Montag, den 14.08.2017, 11:52 +0200 schrieb Volker Wysk:
hmm, do you have a URL ? that shouldnt be needed, i have the nextcloud
snap running standalone on several systems here that only run a minimal
installed OS... (it would also mean the snap wouldnt run on ubuntu core
(which is definitely does for many people), since you can not install
debs there)

ciao
oli

Re: (Solved) Re: Upgrade path from MySQL to MariaDB broken? (Ako

By Volker Wysk at 08/14/2017 - 05:16

Am Montag, 14. August 2017, 11:57:10 CEST schrieb Oliver Grawert:
Here are the instructions which I've followed:

<a href="https://docs.nextcloud.com/server/12/admin_manual/installation/" title="https://docs.nextcloud.com/server/12/admin_manual/installation/">https://docs.nextcloud.com/server/12/admin_manual/installation/</a>
source_installation.html#example-installation-on-ubuntu-16-04-lts-server

So far, I'm only at the beginning.

Good luck,
Volker

Re: (Solved) Re: Upgrade path from MySQL to MariaDB broken? (Ako

By Oliver Grawert at 08/14/2017 - 05:32

hi,
Am Montag, den 14.08.2017, 12:16 +0200 schrieb Volker Wysk:
disregard my other mail, i'm talking to nextcloud right now ... the
section you linked isnt really clear ... they were thinking:

"On a machine running a pristine Ubuntu 16.04 LTS server, you have two
options:" 

would make clear that it is either the snap or the deb installation
below ... we're fixing the doc now :)

ciao
oli

Re: (Solved) Re: Upgrade path from MySQL to MariaDB broken? (Ako

By Volker Wysk at 08/14/2017 - 05:47

Am Montag, 14. August 2017, 12:32:18 CEST schrieb Oliver Grawert:
So that instruction to install mariadb-server belongs to the installation from
the nextcloud tarball. I'll skip this, and continue below.

Bye,
Volker

Re: (Solved) Re: Upgrade path from MySQL to MariaDB broken? (Ako

By Oliver Grawert at 08/14/2017 - 05:42

hi,
Am Montag, den 14.08.2017, 12:32 +0200 schrieb Oliver Grawert:
and here it is:

<a href="https://github.com/nextcloud/documentation/pull/554" title="https://github.com/nextcloud/documentation/pull/554">https://github.com/nextcloud/documentation/pull/554</a>

;)

ciao
oli

Re: (Solved) Re: Upgrade path from MySQL to MariaDB broken? (Ako

By Oliver Grawert at 08/14/2017 - 05:22

hi,
Am Montag, den 14.08.2017, 12:16 +0200 schrieb Volker Wysk:
the section about snap is:

<a href="https://docs.nextcloud.com/server/12/admin_manual/installation/source_i" title="https://docs.nextcloud.com/server/12/admin_manual/installation/source_i">https://docs.nextcloud.com/server/12/admin_manual/installation/source_i</a>
nstallation.html#installing-via-snap-packages

and all it says is:

sudo snap install nextcloud 

(and that is definitely enough to get a fully running and default-
configured nextcloud up that you can then manage through the web UI)

i dont see a mention about any additional debs ...

ciao
oli

Re: (Solved) Re: Upgrade path from MySQL to MariaDB broken? (Ako

By Volker Wysk at 08/14/2017 - 12:02

Am Montag, 14. August 2017, 12:22:26 CEST schrieb Oliver Grawert:
Where does it reside? In /var/www, there is no nextcloud. How does one access
that web UI? Is there also an apache bundled with the snap package? How does
apache access the nextcloud server? There is no way configured in the /etc/
apache2/sites-enabled/nextcloud.conf file, which one should create.

It's the first time i cope with a snap package. I'm puzzled.

Cheers
Volker

Re: (Solved) Re: Upgrade path from MySQL to MariaDB broken? (Ako

By Oliver Grawert at 08/15/2017 - 04:52

hi,
Am Montag, den 14.08.2017, 19:02 +0200 schrieb Volker Wysk:
a snap is a self contained (all bits an application needs are bundled
and sanely pre-configured) squashfs file. the raw squashfs (.snap file)
gets put into /var/lib/snapd/snaps/<snapname>.snap and then mounted to
/snap/<snapname> ... you can see the (readonly) content under
/snap/<snapname>/current ... all writable system bits of a snap package
go to /var/snap/<snapname>/currrent, there you would find the webserver
logs for example ...

note that the nextclud snap runs its own setup scripts on first start
to create the databases and such, it will take a bit (a few minutes at
most), then you can access it through the web interface with your
browser by either going to
http://localhost/ or http://<your_ip_address>/
and simply finish the configuration there (set an admin username and a
password and click the "finish setup" button) see [1] ...

the snap package will automatically update when nextcloud releases
(security) updates (completely independent of your OS underneath), the
security mechanisms of the snap packaging system will prevent it from
doing bad things to your OS. all executables are wrapped by seccomp,
apparmor and namespace confinement via the kernel to not access
anything of the system outside of their designed purpose.

if you have more questions about snap packages, there is
<a href="https://forum.snapcraft.io/" title="https://forum.snapcraft.io/">https://forum.snapcraft.io/</a>

ciao
oli

[1] https://insights.ubuntu.com/wp-content/uploads/d92c/nextcloud-5.png

Re: (Solved) Re: Upgrade path from MySQL to MariaDB broken? (Ako

By Volker Wysk at 08/15/2017 - 08:55

Am Dienstag, 15. August 2017, 11:52:44 CEST schrieb Oliver Grawert:
Okay.

I had another apache2 running, which has shadowed the one which nextcloud
brings along. So I couldn't see nextcloud's web UI.

Later, I need to assemble both apache2's, because I also run a wiki.

Thanks for the explanation. I'm reading about Snap now.

Volker