Ubuntu

MySQL daemon crashes daily on logrotate's flush-logs

Reported by gcc on 2009-02-24
4
Affects Status Importance Assigned to Milestone
MySQL Server
New
Undecided
Unassigned
mysql-dfsg-5.0 (Ubuntu)
Undecided
Unassigned
Dapper
Undecided
Unassigned

Bug Description

Binary package hint: mysql-server-5.0

The version of MySQL supplied with Dapper Drake crashes every day when logrotate tries to tell it to flush logs, if expire-log-days is enabled but log-bin is disabled in /etc/mysql/my.cnf. The logrotate cron job output looks like this:

/etc/cron.daily/logrotate:
^G/usr/bin/mysqladmin: refresh failed; error: 'Lost connection to MySQL
server during query'
error: error running shared postrotate script for /var/log/mysql.log
/var/log/mysql/mysql.log /var/log/mysql/mysql-slow.log
run-parts: /etc/cron.daily/logrotate exited with return code 1

This is a well-known upstream bug (http://bugs.mysql.com/17733) that was fixed in 5.0.33.

Workaround is to either disable expire-log-days or enable log-bin on the affected server.

Please update the Dapper package to latest MySQL 5.0, or at least 5.0.33.

mysql-server-5.0: 5.0.22-0ubuntu6.06.10

Description: Ubuntu 6.06.2 LTS
Release: 6.06

JanBrinkmann (jbrinkmann) wrote :

Thanks for reporting this bug and any supporting documentation. Since this bug has enough information provided for a developer to begin work, I'm going to mark it as confirmed and let them handle it from here. Thanks for taking the time to make Ubuntu better!

Changed in mysql-dfsg-5.0:
status: New → Confirmed
Chuck Short (zulcss) wrote :

Can you try the version in my ppa (http://launchpad.net/~zulcss/+archive) when it is built?

Thanks
chuck

gcc (chris+ubuntu-qwirx) wrote :

Sorry, afraid not.

chris@fen-fw:~$ sudo apt-get install mysql-server
Reading package lists... Done
Building dependency tree... Done
The following packages will be upgraded:
  mysql-server
1 upgraded, 0 newly installed, 0 to remove and 6 not upgraded.
Need to get 38.8kB of archives.
After unpacking 0B of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
  mysql-server
Install these packages without verification [y/N]? y
Get: 1 http://ppa.launchpad.net dapper/main mysql-server 5.0.22-0ubuntu6.06.12 [38.8kB]
Fetched 38.8kB in 0s (107kB/s)
(Reading database ... 26499 files and directories currently installed.)
Preparing to replace mysql-server 5.0.22-0ubuntu6.06.11 (using .../mysql-server_5.0.22-0ubuntu6.06.12_all.deb) ...
Unpacking replacement mysql-server ...
Setting up mysql-server (5.0.22-0ubuntu6.06.12) ...

chris@fen-fw:~$ sudo vi /etc/mysql/my.cnf
[re-enabled log-expire-days to recreate the bug]

chris@fen-fw:~$ sudo /etc/init.d/mysql restart
Stopping MySQL database server: mysqld.
Starting MySQL database server: mysqld.

chris@fen-fw:~$ mysqladmin flush-logs -u root -p
Enter password:
mysqladmin: refresh failed; error: 'Lost connection to MySQL server during query'

Mathias Gug (mathiaz) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. However, I am closing it because the bug has been fixed in the latest development version of Ubuntu - the Jaunty Jackalope.

This is a signficant bug in Ubuntu. If you need a fix for the bug in previous versions of Ubuntu, please do steps 1 and 2 of the SRU Procedure [1] to bring the need to a developer's attention.

[1]: https://wiki.ubuntu.com/StableReleaseUpdates#Procedure

Changed in mysql-dfsg-5.0:
status: Confirmed → Fix Released
gcc (chris+ubuntu-qwirx) wrote :

Step 1 has been done. The bug (this bug) is marked as "fix released".

Step 2:

The impact of the bug is that any user executing the "flush logs" command will experience a crash of the mysql server process that they send it to, if expire-log-days is enabled but log-bin is disabled in /etc/mysql/my.cnf. The logrotate process does this every day, and generates an error email as described above.

I believe that in the development branch, it was addressed by updating to a more recent version of mysqld. My Hardy system has 5.0.51a-3ubuntu5.4, the bug was fixed in 5.0.33.

The exact, minimal patch that fixes this problem is here: http://lists.mysql.com/commits/15790

TEST CASE: enable expire_log_days and disable log-bin in /etc/my.cnf, restart mysqld, run mysqladmin flush-logs.

The only regression potential that I can see in the patch is that a case where the SQL FLUSH LOGS statement might previously cause an error, when check_db_used(thd, all_tables) returns non-zero, no longer returns an error. I doubt that that is a significant regression.

serfdog (jwils01) on 2009-11-25
Changed in mysql-server:
importance: Unknown → Undecided
status: Unknown → New
JC Hulce (soaringsky) wrote :

Thank you for reporting this bug to Ubuntu. The version of Ubuntu referenced in this issue has reached end of life, and the issue is fixed in newer versions of Ubuntu.
Please see this document for currently supported Ubuntu releases:
https://wiki.ubuntu.com/Releases

Changed in mysql-dfsg-5.0 (Ubuntu Dapper):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.