Bug 356008 - Unable to spawn mysqld server with mariadb 10.1
Summary: Unable to spawn mysqld server with mariadb 10.1
Status: RESOLVED NOT A BUG
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: server (show other bugs)
Version: unspecified
Platform: Arch Linux Linux
: NOR grave
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-27 22:44 UTC by Bruno J.
Modified: 2016-01-03 17:34 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bruno J. 2015-11-27 22:44:49 UTC
when starting akonadi:
Database process exited unexpectedly during initial connection! 
executable: "/usr/bin/mysqld" 
arguments: ("--defaults-file=/home/bruno/.local/share/akonadi/mysql.conf", "--datadir=/home/bruno/.local/share/akonadi/db_data/", "--socket=/tmp/akonadi-bruno.nfiyzD/mysql.socket") 
stdout: "" 
stderr: "2015-11-27 23:40:30 139693854136192 [Note] /usr/bin/mysqld (mysqld 10.1.9-MariaDB) starting as process 3282 ...\n" 
exit code: 1 
process error: "Unknown error"

When trying to run mysql myself with same params :
$ /usr/bin/mysqld -v --defaults-file=/home/bruno/.local/share/akonadi/mysql.conf --datadir=/home/bruno/.local/share/akonadi/db_data/ --socket=/tmp/akonadi-bruno.nfiyzD/mysql.socket -v
2015-11-27 23:42:31 140622178531200 [Note] /usr/bin/mysqld (mysqld 10.1.9-MariaDB-log) starting as process 3381 ...
2015-11-27 23:42:31 140622178531200 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2015-11-27 23:42:31 140622178531200 [Note] InnoDB: The InnoDB memory heap is disabled
2015-11-27 23:42:31 140622178531200 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-11-27 23:42:31 140622178531200 [Note] InnoDB: Memory barrier is not used
2015-11-27 23:42:31 140622178531200 [Note] InnoDB: Compressed tables use zlib 1.2.8
2015-11-27 23:42:31 140622178531200 [Note] InnoDB: Using Linux native AIO
2015-11-27 23:42:31 140622178531200 [Note] InnoDB: Using CPU crc32 instructions
2015-11-27 23:42:31 140622178531200 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-11-27 23:42:31 140622178531200 [Note] InnoDB: Completed initialization of buffer pool
2015-11-27 23:42:31 140622178531200 [Note] InnoDB: Highest supported file format is Barracuda.
2015-11-27 23:42:31 140622178531200 [Warning] InnoDB: Resizing redo log from 2*4096 to 2*3072 pages, LSN=14116095600
2015-11-27 23:42:31 140622178531200 [Warning] InnoDB: Starting to delete and rewrite log files.
2015-11-27 23:42:31 140622178531200 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
2015-11-27 23:42:32 140622178531200 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
2015-11-27 23:42:32 140622178531200 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2015-11-27 23:42:32 140622178531200 [Warning] InnoDB: New log files created, LSN=14116096012
2015-11-27 23:42:32 140622178531200 [Note] InnoDB: 128 rollback segment(s) are active.
2015-11-27 23:42:32 140622178531200 [Note] InnoDB: Waiting for purge to start
2015-11-27 23:42:32 140622178531200 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.26-74.0 started; log sequence number 14116095600
2015-11-27 23:42:32 140621752825600 [Note] InnoDB: Dumping buffer pool(s) not yet started
2015-11-27 23:42:32 140622178531200 [Note] Plugin 'FEEDBACK' is disabled.
2015-11-27 23:42:32 140622178531200 [ERROR] /usr/bin/mysqld: unknown variable 'defaults-file=/home/bruno/.local/share/akonadi/mysql.conf'
2015-11-27 23:42:32 140622178531200 [ERROR] Aborting

Support for switch "defaults-file" seems to have been dropped, preventing mysqld to start.
Using mariadb 10.1.9 and akonadi 15.08.3.

Reproducible: Always

Steps to Reproduce:
1. Start akonadi with mysql backend


Actual Results:  
Starts

Expected Results:  
Does not start
Comment 1 Guillaume DE BURE 2015-11-28 22:10:24 UTC
Confirmed here also on akonadi 15.11.80 on archlinux

@maxijac, can't find any evidence of defaults-file being dropped, could you find this information somewhere ?
Comment 2 Guillaume DE BURE 2015-11-28 23:30:23 UTC
I got this solved by deleting the whole ~/.local/share/akonadi. However, this is not the way to go, so I propose to leave this bug opened, as it is a sign that something changed between mariadb 10.1.8 and 10.1.9 that prevents akonadi from starting...
Comment 3 Bruno J. 2015-11-29 09:53:56 UTC
I did not find any evidence of --defaults-file being dropped, I can only assume.
By removing the whole configuration of akonadi you probably reverted to another DB backend like sqlite but it is not a solution.
Comment 4 Guillaume DE BURE 2015-11-29 10:10:39 UTC
Nope, my backend is still mysql, I did not change my ~/.config/akonadiserverrc :

[Debug]
Tracer=null

[%General]
Driver=QMYSQL

[QMYSQL]
Host=
Name=akonadi
Options="UNIX_SOCKET=/tmp/akonadi-guillaume.xVlx6G/mysql.socket"
ServerPath=/usr/bin/mysqld
StartServer=true

But I agree there must be a more elegant solution than removing the entire akonadi folder, as this means (in my case) resynchronisation of my whole imap accounts
Comment 5 Bruno J. 2015-11-29 10:33:21 UTC
I tried this earlier and it did not change anything for me.
Can you "ps aux | grep mysqld" and give the command line invocation of mysqld please?
Make sure to wait a bit after startup of akonadi as the several retries may skew the test.
Comment 6 Guillaume DE BURE 2015-11-29 20:21:04 UTC
ps aux | grep mysqld

/usr/bin/mysqld --defaults-file=/home/guillaume/.local/share/akonadi/mysql.conf --datadir=/home/guillaume/.local/share/akonadi/db_data/ --socket=/tmp/akonadi-guillaume.xVlx6G/mysql.socket

I have to add that I did a few things before deleting /.local/share/akonadi :
chown mysql:mysql /var/lib/mysql -R (there were indeed some permission issues)
mysql_upgrade
(both commands issued after reading the very excellent archlinux wiki on mysql troubleshooting : https://wiki.archlinux.org/index.php/MySQL#Troubleshooting)

Maybe it is the combination of the three actions that solved it for me ?
Comment 7 Bruno J. 2015-12-05 08:02:49 UTC
Indeed, this bug is so weird.
So I kind of fixed it on my side too.

I fixed it by wiping the entire db in .local/.

The weird part is that it is indeed still called with "defaults-file" and works. But if I call mysqld with tha same parameters AND -v il rejects the option and quits with an error.

So the error is not in akonadi. Not sure why mysqld does that though.
Comment 8 Daniel Vrátil 2016-01-03 17:34:46 UTC
Apparently --defaults-file *MUST* be the first switch on the command line, otherwise MySQL complains (this is behavior is documented in mysqld man pages).