WordPress.org

Ready to get started?Download WordPress

Forums

CYAN Backup
[resolved] Backup Failed (77 posts)

  1. clart
    Member
    Posted 5 months ago #

    The backup runs on schedule but fails.
    I tried it several times manually and it always fails when creating the zip file around 11Mb in size. Heres the screen message:

    Internal Server Error

    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator, and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

    Backup failed!

    Please advise.
    Thank you.

    https://wordpress.org/plugins/cyan-backup/

  2. Greg Ross
    Member
    Plugin Author

    Posted 5 months ago #

    Make sure your script execution time is set high enough in php.ini.

    Also make sure you have enough free disk space to create the zip file.

    You can also look at the PHP error log to see if any errors are recorded.

  3. clart
    Member
    Posted 5 months ago #

    I have plenty of free disk space available. I got to 9 failed backups, incomplete zip files of 11Mb and 9 directories full of site copy before I deleted the lot to try again.

    I am on shared hosting, I cannot see the PHP error log.

    What value should be script execution time?

  4. Greg Ross
    Member
    Plugin Author

    Posted 5 months ago #

    Depends on your host, size of your site, etc.

    Try increasing it (maybe double) and see if the backup get's farther along.

  5. clart
    Member
    Posted 5 months ago #

    I tried increasing it in php.ini and wp-config.php and made no difference : set_time_limit(120);

    I excluded plugins directory and it worked fine, zip file is 37 Mb.

    I exclude most everything else except plugins dir and it fails.
    Something in plugins dir is causing it to fail.

    Also, there is bug : when it fails, cannot do another backup because of status, go to options and tick box to clear active backup status and update options. Then click Backups to try again, but after a few secs, the button disable, animation spinning, percent indicator back to the point previously where it failed and shows message "Archiving SQL Dump...". This will not go away until go into the backup directory and manually delete the files left over by the failed backup attempt. When they are deleted and click Backup to try again, all is ok.

    Maybe there should be a button to delete the files when it fails ?

  6. Greg Ross
    Member
    Plugin Author

    Posted 5 months ago #

    Sounds like there is a plugin that has locked a file open and the backup code can't get to it.

    If you could exclude each plugin directory one at a time and find out which one it is I can probably figure out what's wrong.

    I'll look in to adding an option to flush the temporary files as well.

    Thanks.

  7. clart
    Member
    Posted 5 months ago #

    I will check by excluding each one in turn, will take a while..

    I put extra button to update near top of page because tedious having to scroll down page to press update after changing just an exclusion.

    I edited page-options.php like this;

    ('Add WP-Includes Dir', $this->textdomain);?>" onClick="excluded.value = jQuery.trim( excluded.value ) + '\n<?php echo addslashes($this->chg_directory_separator($abspath . "wp-includes/", FALSE) )?>';"> 
    					</td>
    				</tr>
    <!-- extra button start here -->
    <tr><td><p style="margin-top:1em;"><input type="submit" name="options_update" class="button-primary" value="<?php _e('Update Options', $this->textdomain);?>" class="button" /></p></td>
    </tr>
    <!-- extra button end here -->
    			</tbody>
    		</table>
    
    		<h3><?php _e('Log Options', $this->textdomain);?></h3>

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum's parser.]

  8. clart
    Member
    Posted 5 months ago #

    Is there a quick way to delete the backup directory structure from failed backup ?
    It takes ages in FileZilla.

  9. Greg Ross
    Member
    Plugin Author

    Posted 5 months ago #

    Depends on your hosting provider, if you have shell access or a web based file manager there may be. If you only have FTP/FTPS then no.

    Though you could exclude all the subdirs to begin with and then start removing them one at a time so you don't have a failed backup until you find the offending plugin.

  10. clart
    Member
    Posted 5 months ago #

    Have noticed a couple of things, maybe bugs ?

    The 'failed' message pops up very briefly a few times whilst backup is running and copying files. Its only for a split second and does not stop the process. This happens following a backup fail, clear status, update and try backup again.

    Also, after changing / updating options and click on Backups in the menu, sometimes the animation and message kicks in by itself so it looks like it started doing a backup, it quickly jumps to Archiving SQL Dump... with about 75% indicator and just sits there forever. 'Backup Now!' button is disabled so have to click options again and then update again but the same thing happens again until status.log is deleted.

    Something really weird happening with regard to plugins directory;
    Complete plugins dir excluded - backup completes ok
    All individual plugins subdirs excluded - backup completes ok
    Include any one of the plugins subdirs - backup fails

    I have tried it with different ones included, rest excluded and backup fails every time.

    I cannot think what else to try, any ideas ?

  11. Greg Ross
    Member
    Plugin Author

    Posted 5 months ago #

    Check the permissions on both the plugin top level directory and the plugin directories, are they different?

  12. Greg Ross
    Member
    Plugin Author

    Posted 5 months ago #

    Also check to see if there are any files in the root plugins directory that could be causing an issue.

  13. clart
    Member
    Posted 5 months ago #

    root plugins dir had .DS_Store in it, deleted that but made no diff.
    plugin top level directory is 755
    checked all the plugin dirs, they were 755 except for;
    s2member-files : 705
    s2member-logs : 705

    First I changed these to 755 recursive, tried again - backup failed
    Then I removed s2member completly as I dont use it, tried again - backup failed.
    Excluded plugins dir, tried again - backup completed ok
    Included plugins dir, tried again - backup failed

    It always seems to fail at same place, percent bar about 75% and message 'Archiving SQL Dump.."
    When it fails it had that message showing for a little while.
    Is it possible to get a debug output to see what its doing when that message is showing ?

  14. Greg Ross
    Member
    Plugin Author

    Posted 5 months ago #

    The backup log file pretty much records everything that is happening, what are the last few lines in it?

  15. clart
    Member
    Posted 5 months ago #

    Ok, I included plugins dir, ran backup - it failed.
    The temp zip file is about 11Mb in size (as usual).
    The log file is 2Mb size, it contains all the paths and files including all the plugins. It all looks correct.

    Here are the last few lines of the log file;

    [2014-03-06 18:21:07] Archiving /homepages/35/d30352212/htdocs/winton/images/stories...
    [2014-03-06 18:21:07] Archiving /homepages/35/d30352212/htdocs/winton/images/stories/general/bowling_01.jpg...
    [2014-03-06 18:21:07] Archiving /homepages/35/d30352212/htdocs/winton/images/stories/general/bowling_02.jpg...
    [2014-03-06 18:21:07] Archiving /homepages/35/d30352212/htdocs/winton/images/stories/general/games_room_01.jpg...
    [2014-03-06 18:21:07] Archiving /homepages/35/d30352212/htdocs/winton/images/stories/general/lounge_01.jpg...
    [2014-03-06 18:21:07] Archiving /homepages/35/d30352212/htdocs/winton/images/stories/general/lounge_02.jpg...
    [2014-03-06 18:21:07] Archiving /homepages/35/d30352212/htdocs/winton/default.html...
    [2014-03-06 18:21:07] Archiving /homepages/35/d30352212/htdocs/winton/new.php...
    [2014-03-06 18:21:07] Archiving /homepages/35/d30352212/htdocs/winton/index.php...
    [2014-03-06 18:21:07] Archiving /homepages/35/d30352212/htdocs/winton/backup...
    [2014-03-06 18:21:07] Archiving /homepages/35/d30352212/htdocs/winton/wp-phpinfo.php...
    [2014-03-06 18:21:07] Archiving /homepages/35/d30352212/htdocs/winton/makezip.php...

  16. Greg Ross
    Member
    Plugin Author

    Posted 5 months ago #

    Looks ok, I'm just about to push out V1.6.2 which includes some more logging for errors. Once that is up give it a try and see if there are any errors listed.

  17. clart
    Member
    Posted 5 months ago #

    Ok, I will look out for the new version.

    Meanwhile, I had a thought..
    It could be its running out of memory ?

    Maybe update the zip file in chunks, e.g. 1000 files a time ?

  18. Greg Ross
    Member
    Plugin Author

    Posted 5 months ago #

    It could be, but the zip routine deals with each file individually so it seems unlikely. Especially since it happens when you include any of the plugin directories.

    1.6.2 is up, you should see it any time.

  19. clart
    Member
    Posted 5 months ago #

    Ok, got 1.6.2 installed and activated.

    Tried backup with plugins dir included - failed.
    Now theres no "Backup Failed" message, backup button is enabled with red cross image next to it and these;

    Internal Server Error

    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator, and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

    Internal Server Error

    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator, and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

    Yes, it shows same error twice.

    I dont know if you left in by mistake, but this message at bottom of options page has got the word "winton" in it;

    WARNING: Only check this if no backup is running. This will delete any file in the archive path that starts with "winton" but is not a zip/log file.

    when failed the status.log contained this;
    69
    Archiving SQL dump...
    active
    /homepages/35/d30352212/htdocs/winton
    2014-03-06 23:32:480

  20. Greg Ross
    Member
    Plugin Author

    Posted 5 months ago #

    What were the last few lines in the backup log file?

    "winton" is the directory you have wordpress installed, it will change in that message for each install.

    Internal server error is almost always a missing library of some kind, but for the life of me I can't see how a directory in the install would cause it.

  21. clart
    Member
    Posted 5 months ago #

    I had cleaned up from before, so ran it again.
    This time I got the normal Backup failed! message and just one of the Internal Server Error.

    Here is the last few lines of the log file;

    [2014-03-07 03:02:37] Archiving /homepages/35/d30352212/htdocs/winton/default.html...
    [2014-03-07 03:02:37] Archiving /homepages/35/d30352212/htdocs/winton/new.php...
    [2014-03-07 03:02:37] Archiving /homepages/35/d30352212/htdocs/winton/index.php...
    [2014-03-07 03:02:37] Archiving /homepages/35/d30352212/htdocs/winton/backup...
    [2014-03-07 03:02:37] Archiving /homepages/35/d30352212/htdocs/winton/wp-phpinfo.php...
    [2014-03-07 03:02:37] Archiving /homepages/35/d30352212/htdocs/winton/makezip.php...
    [2014-03-07 03:02:37] Archiving SQL dump..

    and here is the status.log ;

    69
    Archiving SQL dump...
    active
    /homepages/35/d30352212/htdocs/winton
    2014-03-07 03:02:370

    Note: when select the option to clean up the temporary files after this fail, the backup directory structure does not get deleted and neither does the log file, although the message at the top of Options page says different;

    CYAN Backup Options

    winton.20140307.030147 deleted from the archive directory.

    winton.20140307.030147.zip.5V79J2 deleted from the archive directory.

    winton.20140307.030148.sql deleted from the archive directory.

    Configuration saved!

    Directory structure "winton.20140307.030147" is still there and so is the log file "winton.20140307.030147.log" 2Mb in size.

  22. Greg Ross
    Member
    Plugin Author

    Posted 5 months ago #

    I'll have to add some more debug info to the log file, I should have something for you to try later today.

  23. clart
    Member
    Posted 5 months ago #

    just out of interest, I excluded everything except wp-content/plugins, ran the backup and it was successful.

    Now I will remove the exclusions one by one and keep trying backup to see where it fails.

  24. clart
    Member
    Posted 5 months ago #

    Ok, I found the problem !

    The webspace for the wordpress site used to contain a joomla site.

    Joomla has been ditched in favour of wordpress and the joomla site has been converted to static html pages to display the old site whilst the new one is completed.
    Although most all the joomla files have gone, there are some remnants, necessary to make the html pages work.
    The one that appears to cauing the problem with the backup is a directory called plugins in the wordpress root.
    With this excluded, all of wordpress backs up fine.
    With it included, the backup fails.

    The root directory structure looks like this;
    winton/.metadata
    winton/backup
    winton/blogs
    winton/plugins <== this is the remnant from joomla
    winton/tmp
    winton/wp-admin
    winton/wp-content
    winton/wp-includes

    That plugins directory looks like this;
    winton/plugins
    winton/plugins/content
    winton/plugins/content/plugin_besps
    winton/plugins/content/plugin_besps/besps.css 2k
    winton/plugins/content/plugin_besps/besps.js 5k
    winton/plugins/content/plugin_besps/besps.png 161

    I cannot see anything in there that should cause the backup to fail, there are only 2 subdirs and 3 files, it must be something to do with the directory name.

    Just to make sure i've included and excluded it several times and run the backup, which fails every time its included.. weird !

    The backup is successful every time with that directory excluded, it backs up all of the wordpress site in about 15 secs and the zipfile is 50Mb.

  25. Greg Ross
    Member
    Plugin Author

    Posted 5 months ago #

    Check the directory permissions, otherwise I don't know why I would fail.

  26. Greg Ross
    Member
    Plugin Author

    Posted 5 months ago #

    Also, if there's nothing sensitive in the directory you could send it to me and I'll do some testing with it.

  27. clart
    Member
    Posted 5 months ago #

    The directory and subdirs are 755, the files are 604 (no group).
    Maybe thats the problem ?

    Theres nothing sensitive in there, I can send you if you want.

  28. Greg Ross
    Member
    Plugin Author

    Posted 5 months ago #

    Try changing the rights to 755 all the way down and see if that works, if it still fails I'll get you to send the files to me and take a look.

  29. clart
    Member
    Posted 5 months ago #

    I renamed the "problem" directory to "jplugins" (/winton/jplugins), excluded that, ran the backup and it failed.

    I renamed it back to "plugins" (/winton/plugins), excluded that, ran the backup and it succeeded.

    I noticed that when it fails, the main log file is 2.5Mb, but when it succeeds, the log file is 900k.

    So I did a diff on the two log files and what I found that is that the failed log file contains entries for winton/wp-content/plugins but the successful log file does not.

    Therefore, Im thinking now that the winton/plugins "problem" directory is a red herring and the backup failing is nothing to do with it.

    What is actually happening is that when I exclude winton/plugins, the backup process also exludes winton/wp-content/plugins and thats why the backup succeeds.

    That explains why the backup failed when I renamed winton/plugins to winton/jplugins and excluded it, the backup excluded winton/jplugins and then tried to process winton/wp-content/plugins, which caused it to fail.

    There appears to be a problem with the exclusion matching in that, excluding winton/plugins also excludes winton/wp-content/plugins, when it should not.

    Here are the last few lines of the successful backup log:
    [2014-03-08 06:00:33] Deleting /homepages/35/d30352212/htdocs/winton/backup/winton.20140308.060024/winton.20140308.060024.sql...
    [2014-03-08 06:00:33] Deleting /homepages/35/d30352212/htdocs/winton/backup/winton.20140308.060024...
    [2014-03-08 06:00:33] Elapsed Time: 9 seconds
    [2014-03-08 06:00:33] Backup complete!
    [2014-03-08 06:00:33] Backup size: 47MB

    Here are the last few lines of the failed backup log:
    [2014-03-10 15:34:27] Archiving /homepages/35/d30352212/htdocs/winton/backup...
    [2014-03-10 15:34:27] Archiving /homepages/35/d30352212/htdocs/winton/wp-phpinfo.php...
    [2014-03-10 15:34:27] Archiving /homepages/35/d30352212/htdocs/winton/jplugins...
    [2014-03-10 15:34:27] Archiving SQL dump...

  30. Greg Ross
    Member
    Plugin Author

    Posted 5 months ago #

    I found the bug in the exclusion code and I've added some more debug logging, there will be a new version up later tonight you can try.

    It won't fix the issue but it may give some more info in to the log file to try and track it down.

Reply »

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.