Updraft UpdraftPlus – popen resource temporarily unavailable

Home Forums BulletProof Security Pro Updraft UpdraftPlus – popen resource temporarily unavailable

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #24614
    DVDR
    Participant

    Hi

    I just discovered an error, that a.) does not allow my backup-plugin “Updraftplus” to complete backups and b.) seems to produce a PHP error, that I can see in BPSPro error log. The error reads like this

    [BPS Pro htaccess Protected Secure PHP Error Log]
    [26-Aug-2015 06:50:57 UTC] PHP Warning: popen(cd '/home/xxxxxxxxxxx/public_html/blog/wp-content/updraft'; /usr/bin/zip -n .jpg:.JPG:.jpeg:.JPEG:.png:.PNG:.gif:.GIF:.zip:.ZIP:.gz:.bz2:.xz.:.rar:.RAR:.mp3:.MP3:.mp4:.MP4:.mpeg:.MPEG:.avi:.AVI:.mov:.MOV -v -u -r binziptest/test.zip binziptest/subdir1,r): Resource temporarily unavailable in /home/xxxxxxxx/public_html/blog/wp-content/plugins/updraftplus/class-updraftplus.php on line 937

    Updraftplus has been working flawlessly since I installed it a year ago, the error seem to have slipped in since about 1 – 2 months or so, without me noticing it.

    As I can see via ftp, updraftplus creates the first set of zip-files properly, but once it starts zipping up the largest set (the directory “uploads”) it stops adding chunks to that very zip file at about 120 MB (final zip-file should have about 230MB). It’s not a matter of disc-space, and the plugin is said to be supporting WordPress up to version 4.3 – I did get that PHP error with 4.2 and with 4.3 as well. I even ran BPSPro setup again, but no changes. Disabling core protection did not help, either. Would you mind me helping  to sort out, what measures to take and how to correct the problem?

    Thank you!!!

    #24615
    DVDR
    Participant

    Thanks

    I did check all logs, emptied them all and manually restarted a backup routine of updraftplus. the ONLY error, that repeatedly is created, is the abovementioned php error in the php error log. no security or quaranite-log error has been recorded.

    When trying to browse to the log-pages of BPRPro during that backup process, I get a “500 server error” and can’t access neither the admin area nor the normale website, but am presented the white 500 error page. This “500 server misconfiguration error” stays for a short time (trying to reload the page), then the admin page (after 30″ to 1′) is accessable again, only that the backup still is not completed, but quite a few of the abovementioned PHP errors populate the php error log.

    Right now, I have no clue on how to proceed…

    #24618
    AITpro Admin
    Keymaster

    I believe the problem is caused by this code at Code Line:  927:  @mkdir($updraft_dir.'/binziptest/subdir1/subdir2', 0777, true);. The reason I believe that could be the problem is that some hosts do not allow 777 permissions at any time and if you try to use 777 permissions for a folder’s permission then the host server will automatically block/deny access to that folder. That could also be the reason for the 500 Internal server error occurring or your server could be crashing. You could test that theory by editing/modifying this code at Code Line 927:  @mkdir($updraft_dir.'/binziptest/subdir1/subdir2', 0777, true); and changing it to this code:  @mkdir($updraft_dir.'/binziptest/subdir1/subdir2', 0755, true); Or of course the php error is secondary and your server is crashing with a 500 error during the UpdraftPlus backup process for whatever reason and automatically reboots itself and the php error that you are seeing is after the fact of that server crash. The issue/problem would be an issue/problem between UpdraftPlus and your server and not related to BPS, WordPress or any of your other plugins.

    I assume UpdraftPlus allows you to choose options that would allow you to NOT use popen or any of this code and use an alternative method. You would need to ask the UpdraftPlus folks which option setting that would be in UpdraftPlus.
    Code lines: 925-951 in File:  /updraftplus/class-updraftplus.php.

    # Test it, see if it is compatible with Info-ZIP
    # If you have another kind of zip, then feel free to tell me about it
    @mkdir($updraft_dir.'/binziptest/subdir1/subdir2', 0777, true);
    file_put_contents($updraft_dir.'/binziptest/subdir1/subdir2/test.html', '<html></body><a href="https://updraftplus.com">UpdraftPlus is a great backup and restoration plugin for WordPress.</body></html>');
    @unlink($updraft_dir.'/binziptest/test.zip');
    if (is_file($updraft_dir.'/binziptest/subdir1/subdir2/test.html')) {
    
    $exec = "cd ".escapeshellarg($updraft_dir)."; $potzip";
    if (defined('UPDRAFTPLUS_BINZIP_OPTS') && UPDRAFTPLUS_BINZIP_OPTS) $exec .= ' '.UPDRAFTPLUS_BINZIP_OPTS;
    $exec .= " -v -u -r binziptest/test.zip binziptest/subdir1";
    
    $all_ok=true;
    $handle = popen($exec, "r");
    if ($handle) {
    while (!feof($handle)) {
    $w = fgets($handle);
    if ($w && $logit) $this->log("Output: ".trim($w));
    }
    $ret = pclose($handle);
    if ($ret !=0) {
    if ($logit) $this->log("Binary zip: error (code: $ret)");
    $all_ok = false;
    }
    } else {
    if ($logit) $this->log("Error: popen failed");
    $all_ok = false;
    }
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.