Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#7748 closed Bug/Something is broken (fixed)

scheduled backup failing to save file

Reported by: Carolyn Wilcox Owned by: Ross
Priority: Medium Component: Tech
Keywords: backup_migrate Cc:
Sensitive: no

Description

Hello,

Twice in a row the ExperienceOlympic.com weekly scheduled backup (using Drupal backup_migrate module) failed:

The site backup has failed with the following messages:
Site was taken offline.
Site was taken online.
Could not run backup because the file could not be saved to the destination.

This backup had been working fine for over a year. The destination is set as "private://backup_migrate/scheduled". That directory (at experienceolympic.com/web/sites/default/files/private/backup_migrate/scheduled) contains the prior backup files (the newest one is from August 17, 2013).

I can't figure out what changed to cause the backup failure.

Thank you for helping with this.

Thanks, Lindsey

Change History (4)

comment:1 Changed 6 years ago by Dana

Owner: set to Ross
Status: newassigned

Ross, do you know why this is?

comment:2 Changed 6 years ago by Ross

Resolution: fixed
Status: assignedfeedback

Hi Linsey,

It looks like there is some kind of bug in the backup_migrate module. I believe I have solved the immediate problem by modifying the module. Here was the error I received when running drush bam-backup

0 experienceolympic@marx:~/experienceolympic.com/web/sites/all/modules/backup_migrate/includes$ drush bb
home/members/experienceolympic/sites/experienceolympic.com/web/sites/default/files/private/backup_migrate/manualfile_put_contents(home/members/experienceolympic/sites/experienceolympic.com/web/sites/default/files/private/backup_migrate/manual/.htaccess):  [warning]
failed to open stream: No such file or directory file.inc:498
WD security: Security warning: Couldn't write .htaccess file. Please create a .htaccess file in your                            [error]
home/members/experienceolympic/sites/experienceolympic.com/web/sites/default/files/private/backup_migrate/manual directory
which contains the following lines: SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
Deny from all
Options None
Options +FollowSymLinks
fopen(home/members/experienceolympic/sites/experienceolympic.com/web/sites/default/files/private/backup_migrate/manual/test.txt):  [warning]
failed to open stream: No such file or directory destinations.file.inc:211
home/members/experienceolympic/sites/experienceolympic.com/web/sites/default/files/private/backup_migrate/manualfile_put_contents(home/members/experienceolympic/sites/experienceolympic.com/web/sites/default/files/private/backup_migrate/manual/.htaccess):  [warning]
failed to open stream: No such file or directory file.inc:498
WD security: Security warning: Couldn't write .htaccess file. Please create a .htaccess file in your                            [error]
home/members/experienceolympic/sites/experienceolympic.com/web/sites/default/files/private/backup_migrate/manual directory
which contains the following lines: SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
Deny from all
Options None
Options +FollowSymLinks
fopen(home/members/experienceolympic/sites/experienceolympic.com/web/sites/default/files/private/backup_migrate/manual/test.txt):  [warning]
failed to open stream: No such file or directory destinations.file.inc:211
Could not run backup because the file could not be saved to the destination.                                                    [error]
WD backup_migrate: Could not run backup because the file could not be saved to the destination.                                 [error]

The apparent problem was the backup directory was being created without a preceding slash, so I added this line to the module on line 198:

$directory = '/' .$directory;

Afterward, I was able to run drush bb, which is the commandline version of the backup and migrate module. Here's the successful run:

0 experienceolympic@marx:~/experienceolympic.com/web/sites/all/modules/backup_migrate/includes$ drush bb
Default Database backed up successfully to ltnonegt-2013-09-04T07-52-23 in destination Manual Backups Directory in 1296.63    [success]
ms.
0 experienceolympic@marx:~/experienceolympic.com/web/sites/all/modules/backup_migrate/includes$ 

It's not a perfect solution, but I think it will work. You can follow this bug here https://drupal.org/node/1997354 .

If I were to guess why this started happening, I would guess that you updated the backup_migrate module recently and that update introduced this bug. It looks like all the backup_migrate files were updated on Aug. 23rd.

Let me know if this does not fix your problem,

~/ross

comment:3 Changed 6 years ago by Carolyn Wilcox

Status: feedbackclosed

Ross,

I did recently update most of the contributed modules, so your hypothesis is probably correct. I assume I should update the backup_migrate module when a new recommended version is released.

Thank you for fixing this!

cheers, Lindsey

comment:4 Changed 6 years ago by Carolyn Wilcox

Just adding a note to confirm that the scheduled backup succeeded following Ross' fix:

The site backup has completed successfully with the following messages:
Site was taken offline.
Site was taken online.
Default Database backed up successfully to ExperienceOlympic-2013-09-07T10-36-03 in destination Scheduled Backups Directory in 5147.53 ms.

Please login to add comments to this ticket.

Note: See TracTickets for help on using tickets.