WordPress.org

Support

Support » Plugins and Hacks » [Resolved] [Plugin: Backup] Never Uploads to Google Drive No Failure Notice

[Resolved] [Plugin: Backup] Never Uploads to Google Drive No Failure Notice

  • I am running Backup version 2.0, and when I attempted a manual backup it successfully dumped the database and created the archive, then the log shows that it attempted to upload to Google Drive, but there is no log entry after that indicating either success or failure, and the file is not showing up in my Google Drive.

    When I ran the manual backup in my browser it worked for quite a while and then displayed the “Internal Server Error” page.

    Any suggestions?

    Thanks so much,

    -David

    http://wordpress.org/extend/plugins/backup/

Viewing 15 replies - 1 through 15 (of 22 total)
  • Your PHP error log might reveal some more information, but my guess is PHP ran out of memory to use.

    Can you tell me about your setup (PHP and WP version, plugin configuration, how large the database and files are)?

    This WP install is on a Dreamhost shared hosting plan and it doesn’t look like php error logging is enabled. I’ll try to get that enabled and see what it shows.

    In the meantime, I’m running PHP 5.3 FastCGI and WordPress 3.4. Here are the backup settings:

    • Local folder path: wp-content/backup
    • Drive folder id: [the folder id]
    • Authorization: granted
    • When to backup: daily
    • Store a maximum of: 10 backups locally and 2 backups on Google Drive
    • What to back up: Database, Content, Uploads, Plugins
    • Chunk size: 0.5MB
    • Time limit: 120 seconds

    According to the backup log, the archive file size is 78MB. Yesterday there were no log entries after the NOTICE: Attempting to upload archive to Google Drive, but when I tried it again today I got the following:

    ERROR: name lookup timed out (http_request_failed)
    NOTICE: Backup process completed in 59.28 seconds. Initial PHP memory usage was 20 MB and the backup process used another 7 MB of RAM.

    And although php error logging is not enabled, I checked the http error log and the following entry was created each time I tried to manually run the backup:

    Premature end of script headers: index.php

    That’s all the info I have at this point, but I’ll try to enable php logging and let you know what I find out.

    Thanks,

    -David

    You could try disabling cURL in PHP, or following Carlton’s instructions here.

    If I disable cURL will that affect anything else on my wordpress site?

    Also would lengthening the “time limit” in advanced settings help?

    thank you

    If I disable cURL will that affect anything else on my wordpress site?

    Yes that would affect all http requests made from WordPress.

    Also would lengthening the “time limit” in advanced settings help?

    Assuming you have the same problem as the original poster, I would have to say that modifying the time limit does not have any effect.

    I lengthened the time and that seemed to make it work.
    I lengthened it to 240 seconds. Do you think this will pose any problems?

    thank you kindly.

    No, there should be no problems with that.

    I’m glad you got it to work.

    Update:

    I turned on php error logging and I was surprised and disappointed to see that even though the backup still failed to upload to my Google Drive, it did not show anything in the php error log (it would have been very helpful if something showed up). I verified that the php error logging is working by writing a quick php script with an error in it and running it from my browser and that error did show up in the log. Not sure if WordPress somehow redirects php errors to a different log, but if not, there is just no error showing up.

    I haven’t tried disabling cURL, but I don’t think that’s the issue. I read that thread you linked to, and I don’t think that has anything to do with my problem. I am running the latest version of WP, and I can update my plugins and themes without any problems. That “name lookup timed out” error has not appeared again. I think that was a red herring.

    I also increased the “time limit” setting to 240 like agentsully did and there was no change.

    Would you suggest changing the time limit and/or memory limit php settings? Any other suggestions?

    Thanks,

    -David

    What error are you getting now then?

    WordPress stores the error log in wp-content/debug.php, but please note that you have to have to enable logging in the wp-config file by adding something like this:

    define('WP_DEBUG', true);
    define('WP_DEBUG_LOG', true);
    define('WP_DEBUG_DISPLAY', false);
    @ini_set('display_errors',0);

    90% of the time I’m not getting any error in backup.log. Usually the last entry in the log is NOTICE Attempting to upload archive to Google Drive with no subsequent error line.

    Out of 12 attempts so far to run the backup there have been two errors noted in the log. The first error was that name lookup timed out, which has only happened once. The second which has also only happened once is Operation timed out after 5000 milliseconds with 0 bytes received (http_request_failed). That has also only occurred once in the log out of 12 attempts.

    I will try to turn on the WordPress debug logging and let you know if anything shows up there.

    Thanks,

    -David

    Cool, finally got some debugging info for you. There were two identical entries in the debug.log after attempting to run the manual backup again:

    PHP Notice: Undefined property: Backup::$gdocs in [...]/plugins/backup/backup.php on line 854

    -David

    Not getting any error messages in Backup’s log file leads me to believe one of the following is happening:

    1. PHP is running out of memory
    2. The script times out
    3. The upload takes a lot of time (especially if you have a large archive and a slow connection between your server and Google Drive)

    The first two should show up in the error log. In case the upload takes to much time you should try and let a normal scheduled backup run instead of doing it manually. That should work. What size is the archive anyway?

    Ok…

    My bad then. I have a typo in my code. I’ll fix it asap. If you want to fix it yourself just add a ‘g’ in front of docs on line 102 of backup.php.

    Sorry for that.

    No problem. Thanks for patiently working with me to get to the bottom of it! I went ahead and fixed the typo and tried to run it again manually and I think it probably timed out in the browser, so I changed the schedule to never, saved it, then changed it back to daily. I’m watching the log now as it’s running the scheduled backup. I’ll let you know if it successfully uploads the archive this time. The archive is currently 198MB so I assume it will take some time.

    Thanks again for your help!

    -David

    So, the archive still wasn’t getting uploaded, and I’m pretty sure (like you said) it’s either because it’s timing out or running out of memory. I looked in the http log on my host and it showed:

    Premature end of script headers: wp-cron.php

    So, I tried backing up just the database and that succeeded, almost certainly because the file is smaller. Given that reality, do you have any recommendations on how to increase whatever parameters are necessary to get it to upload a considerably larger file? Or do you think I’m possibly out of luck on a shared hosting plan?

Viewing 15 replies - 1 through 15 (of 22 total)
  • The topic ‘[Resolved] [Plugin: Backup] Never Uploads to Google Drive No Failure Notice’ is closed to new replies.