Bug #80835 Server crashes on startup with invalid server-id
Submitted: 23 Mar 2016 9:40 Modified: 29 Mar 2016 13:19
Reporter: Cédric Bruderer Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.6.25 OS:Ubuntu (14.04)
Assigned to: CPU Architecture:Any

[23 Mar 2016 9:40] Cédric Bruderer
Description:
When the server-id is set to an invalid value, the server crashes on startup.

Following you can find the last six lines of the log file:

Unknown suffix 'n' used for variable 'server_id' (value 'no')
2016-03-22 08:55:05 0 [ERROR] /home/mysql/product/mysql-5.6.25-linux-glibc2.5-x86_64/bin/mysqld: Error while setting value 'no' to 'server_id'
2016-03-22 08:55:05 0 [ERROR] Aborting
2016-03-22 08:55:05 0 [Note] Binlog end
160322 08:55:05 mysqld_safe mysqld from pid file /home/mysql/data/dummy/rpi-nfs.pid ended

How to repeat:
1) Set the "server-id" with an invalid value in the my.cnf
2) Start the server

Suggested fix:
- override the invalid value
[29 Mar 2016 12:44] MySQL Verification Team
Isn't it preferable to not startup so that DBA is alerted to a problem with the configuration?  I guess it's a matter of personal choice.
[29 Mar 2016 13:19] MySQL Verification Team
Hi Cédric,

Thank you for the report.
I'm fully agree with my colleague Shane, and this is an expected behavior to avoid any potential consequences hence aborting for the invalid value. Adjusting to the default value is not recommended in this case as if it is a slave and more than one slave have same server_id, it can cause a havoc. For example as noted in Bug #72581.

Also, this issue can be even observed with some of the "essential" parameters where server is aborted :

-- port with invalid value

[umshastr@hod03]/export/umesh/server/binaries/mysql-5.6.29: gdb --args bin/mysqld --port=no  --basedir=/export/umesh/server/binaries/mysql-5.6.29 --datadir=/export/umesh/server/binaries/mysql-5.6.29/80829 --core-file --socket=/tmp/mysql_ushastry.sock   --log-error=/export/umesh/server/binaries/mysql-5.6.29/80829/log.err
GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-64.el7
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /export/umesh/server/binaries/mysql-5.6.29/bin/mysqld...done.
(gdb) run
Starting program: /export/umesh/server/binaries/mysql-5.6.29/bin/mysqld --port=no --basedir=/export/umesh/server/binaries/mysql-5.6.29 --datadir=/export/umesh/server/binaries/mysql-5.6.29/80829 --core-file --socket=/tmp/mysql_ushastry.sock --log-error=/export/umesh/server/binaries/mysql-5.6.29/80829/log.err
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Unknown suffix 'n' used for variable 'port' (value 'no')
2016-03-29 15:17:14 0 [ERROR] /export/umesh/server/binaries/mysql-5.6.29/bin/mysqld: Error while setting value 'no' to 'port'
2016-03-29 15:17:14 0 [ERROR] Aborting

2016-03-29 15:17:14 0 [Note] Binlog end
[Inferior 1 (process 16883) exited with code 01]
Missing separate debuginfos, use: debuginfo-install glibc-2.17-78.0.1.el7.x86_64 libaio-0.3.109-12.el7.x86_64 libgcc-4.8.3-9.el7.x86_64 libstdc++-4.8.3-9.el7.x86_64 nss-softokn-freebl-3.16.2.3-13.el7_1.x86_64
(gdb)

Thanks,
Umesh