Managed snapshot backup fails

Hi,

trying to get managed backups working on my site, but running the backup gives this message:

Aw shucks, something went wrong :( Instead of the beautiful response we expected, we got this:

<empty response>

i have enbled logging in my wp-config, and the log shows this error:

[20-Jan-2017 09:10:31 UTC] PHP Fatal error:  Allowed memory size of 805306368 bytes exhausted (tried to allocate 16777224 bytes) in /wp-content/plugins/snapshot/lib/Snapshot/Helper/Utility.php on line 528

here are some server infos:
PHP:

Version	7.0.14
max_execution_time	120
memory_limit	768M
upload_max_filesize	128M
post_max_size	128M

i have tried adding this to the wp-config file:
if (!defined('SNAPSHOT_FILESET_CHUNK_SIZE')) define('SNAPSHOT_FILESET_CHUNK_SIZE', 100);

without any success.

Any suggestions on how to resolve this ?
Due to hosting limits, im not able to change the execution time.

i have granted support access :slight_smile:

  • Sajid
    • DEV MAN’s Sidekick

    Hello Creatura,
    Hope you are doing good today :slight_smile:

    It seems you/your server have allocated very low memory for a script to run on your site. Please try increasing the memory limit and maximum execution time by one of method mentioned in this blog post and then try again.

    If the issue still there, then please enable support staff access so I could take a closer look. To grant access go to WPMU DEV -> Support -> Support Access -> Grant Support Access or see this manual for more details regarding how to enable support staff access.

    Take care and have a nice day :slight_smile:

    Best Regards,
    Sajid - WPMU DEV Support

  • Creatura
    • Site Builder, Child of Zeus

    Hi Sajid,

    Thanks for your reply,
    I cant change execution time, due to server / hosting restrictions, im on a shared hosting with siteground. and adding the mem limit to wp-config did not help....

    support access have been granted.

  • Nastia
    • Support Rock Star

    Hello Creatura , I hope you are doing well!

    The Siteground host does limit the maximum execution time to 120. The Snapshot requires a minimum 160 seconds, though I'm also on Siteground hosting and didn't have any issues with Managed Backups.

    Would you please try reducing the file chunk size to half:

    define('SNAPSHOT_FILESET_CHUNK_SIZE', 50);

    If this will not work try to reduce it to 20. Of course, this will require more time to upload a backup

    If again, you will have same issue, enable WordPress debug, it might give us more information.

    Add the following to the wp-config.php file:

    define( 'WP_DEBUG', true );
    define( 'WP_DEBUG_LOG', true );
    define( 'WP_DEBUG_DISPLAY', false );

    This way all errors will be saved in the debug.log file inside the /wp-content/ directory. Run the Managed backups again and check the debug.log file for errors.

    Let us know how it went!

    Cheers,
    Nastia

  • Creatura
    • Site Builder, Child of Zeus

    Hi Nastia,

    thanks for your reply, and i have tried with the suggestion made, even tried lovering to 20, but i still get the same error, and my debug log shows this:

    [23-Jan-2017 12:23:56 UTC] PHP Fatal error: Allowed memory size of 805306368 bytes exhausted (tried to allocate 16777224 bytes) in /wp-content/plugins/snapshot/lib/Snapshot/Helper/Utility.php on line 528

  • Sajid
    • DEV MAN’s Sidekick

    Hello Creatura,
    Hope you are doing good today :slight_smile:

    I could create a manual full snapshot backup archive successfully. However, see that the maximum memory usage is 14Mb only beside the limit is set to 768 Mb in PHP and WP memory limit is set to 300 Mb.

    That is directly related to this issue. There is something on your site or server that is restricting the memory usage beyond 14MB that is extremely low.

    Please contact your hosting provider and ask whether they have some kind of restriction on their end.

    Also, in case you hosted multiple sites on same account. Then you have to make sure, those sites do not get included in this site managed backup archive. Managed Snapshot backup actually index all folders, files in the directory where you have installed WordPress. You can easily exclude those by just adding those sites folder name in Network Dashboard -> Snapshot -> Settings -> Global File Exclusions -> Global Exclusions.

    Take care and have a nice day :slight_smile:

    Best Regards,
    Sajid - WPMU DEV Support

  • Creatura
    • Site Builder, Child of Zeus

    Hi Sajid,

    thanks for your reply.

    I have contacted the host provider (Siteground) and they have investigated.
    This is the reply i got from them:

    I checked the backup tool in the backend of the website and now the process generates the following error:
    Code:
    
    Gateway Timeout
    
    The gateway did not receive a timely response
    from the upstream server or application.
    
    It seems the plugin tries to generate the backup in one go and this is why the process fails to complete. Unfortunately on our shared servers the timeout values can not be increased as you will need to find an alternative plugin via which to create a backup of your website.

    So theres that.

    Anyways, thanks for your help.

    Best,
    Joran Sorbo

  • Sajid
    • DEV MAN’s Sidekick

    Hello Creatura,
    Hope you are doing good today :slight_smile:

    First of all, let me please clear that, the plugin does not tries to create a backup archive in one go. It briefly split the process into different steps specially gathering the information, database and files and it also further split these into steps by backing up rows of database and file by file.

    Also, my colleague Nastia above is on siteground, I will ask her to give the feedback on this issue too. I am sure snapshot plugin is working on her site.

    Take care and have a nice day :slight_smile:

    Best Regards,
    Sajid - WPMU DEV Support

  • Sajid
    • DEV MAN’s Sidekick

    Hello Creatura :slight_smile:

    I heard back from my colleague and she says, due to the limitation of host. She split the snapshot into two parts. One snapshot of database and second one for files.

    Take care and have a nice day :slight_smile:

    Best Regards,
    Sajid - WPMU DEV Support

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.