The following error message is being generated repeatedly within my drupal installation. It appears to be linked with a test.txt file connected to the scheduled database backup.

query: INSERT INTO watchdog (uid, type, message, severity, link, location, referer, hostname, timestamp) VALUES (0, 'php', '<em>MySQL server has gone away\nquery: DELETE FROM variable WHERE name = &amp;#039;poormanscron_lastrun&amp;#039;</em> in <em>/home/johnclem/public_html/includes/database.mysql.inc</em> on line <em>172</em>.', 2, '', 'http://johnclements.net/sites/files/johnclements.net//backup_migrate/sch..., '', '92.48.74.22', 1215026228) in /home/johnclem/public_html/includes/database.mysql.inc on line 172

Can you advise me on how I might eliminate this error?

Comments

ronan’s picture

Title: Error log message generated by backup and migrate module » Possible incompatibility with poorman's cron module
Category: support » bug

Judging from the error, it appears that the Backup and Migrate module is incompatible with the Poorman's Cron module. It seems that poorman's cron is attempting run during the test request (which checks that your backup directory is secure) and is failing, but when it tries to write to the database it's getting a "MySQL server has gone away" error. I don't know if this is an incompatibility between the modules or if it is specific to your setup, but I'll try and reproduce it when I get the chance and let you know what I find.

If anybody else is successfully or unsuccessfully using these two modules together please comment on this thread.

Thanks
Ronan

jbc’s picture

Thanks. I've set up a 'proper' cron job and removed poorman's cron. If that doesn't fix it for me, I'll let you know.

jbc’s picture

I've now had a cron job running and seemingly experienced the same problem, though I will continue to look at the error log to ensure that it's not something else.

Meanwhile, one aspect that might be significant is that in looking for the test.txt file during the backup&migrate run, it returning a 403 error:

http://johnclements.net/sites/files/johnclements.net//backup_migrate/scheduled/test.txt

I thought the double // might be the cause of the error, but a similar error is returned if I go to that page after removing one of the /.

Does this help at all...?

dmjossel’s picture

I'm getting something similar. All cron jobs are now failing whenever backup_migrate is enabled; after 30 seconds, the cron job times out.

jbc’s picture

I'm running multiple sites and that might be the cause of the continuing error...I'm now checking to ensure that poorman's cron is eliminated from all of them...will report back if that catches the error

ronan’s picture

I'm getting something similar. All cron jobs are now failing whenever backup_migrate is enabled; after 30 seconds, the cron job times out.

This can happen when you schedule backups but your database is too large to backup within the 30 second php timeout. Try increasing your timeout.

Meanwhile, one aspect that might be significant is that in looking for the test.txt file during the backup&migrate run, it returning a 403 error:

http://johnclements.net/sites/files/johnclements.net//backup_migrate/sch...

This is in fact desired behavior. The module is checking to make sure that items in that directory or not publicly accessible prior to saving potentially sensitive data into it. The access denied errors can make the logs a little noisy, but they are not a cause for alarm.

ronan’s picture

Status: Active » Fixed

I installed poormanscron on a local copy and discovered that the modules were in fact incompatible.

What happened for me was that poormanscron was triggering a scheduled backup which was performing a http request to the same drupal install to check the accessibility of test.txt. This request triggered poormanscron which triggered backup and migrate which triggered backup and migrate ad infinitum (or at least ad 'apachectl restart').

I'm not sure if this is what was causing your issue, but I have fixed this issue in the latest dev, so let me know if it clears up the problems you were seeing, and if not, reopen the issue.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.