S3 Backup Error - Not enough space?

We never encounter this on PBXact and these newer FreePBX systems we have been installing. We are getting this error when running our backups:

Saving Backup 1…done!
Initializing Backup 1
Backup Lock acquired!
Running pre-backup hooks…
Adding items…
Building manifest…
Creating backup…
Storing backup…
PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 139265 bytes) in /var/www/html/admin/modules/backup/functions.inc/s3.php on line 2310
Whoops\Exception\ErrorException: Allowed memory size of 536870912 bytes exhausted (tried to allocate 139265 bytes) in file /var/www/html/admin/modules/backup/functions.inc/s3.php on line 2310
Stack trace:

  1. Whoops\Exception\ErrorException->() /var/www/html/admin/modules/backup/functions.inc/s3.php:2310

your backup is probably huge. Maybe separate out the CEL, Recordings etc.

They are large. About 350-500MB. Is there a way to allow a larger size in the .php scripts.

set the memory_limit in php.ini you could add

echo "memory_limit = 512M" > /etc/php.d/s3backups.ini 

The reason we do the above rather than editing the php.ini is this will update the value and remind you why in the future

okay i modified the php.ini and just commented out the original setting. and placed the below in there.

echo “memory_limit = 512M” > /etc/php.d/s3backups.ini

I then went to: /etc/php.d/ in order to look for the s3backups.ini file however nothing is there. Am i supposed to create this file and put in it:

memory_limit = 512M


Your memory size is already set to 536.870912 mb. You’ve effectively lowered the limit.

How much ram is on this machine?

4GB of RAM. This is with FreePBXHosting.com

Even after just modifying the php.ini to be 512MB its the same thing. Its like you said Andrew, I dont think its the php.ini file that needs modified. We never had this problem until recently. Is this on the FreePBX side or is it an Amazon limitation (which I dont think it is since its cloud based slow storage. 512MB limit might cause concern. haha)

is 512*1024*1024. You’re going to have to take it higher.

A better solution might be to figure out what you’re backing up that’s taking up that much space.

Its a full system backup. Do i not need to be doing that?

That still seems like a LOT of data to be backing up. A more judicious selection criteria might help. For example, you don’t need to back up everything, only the data that isn’t part of the normal distribution.

So i just checked online and it looks like I am uploading 426.3 MB of data when it cuts out. I have a bunch of (most likely) corrupted backups up there.

I also checked many other backups while I was there and many of them are larger. However those are all PBXact units. All different “firmware” versions. What could be causing the difference? I am only seeing this on my FreePBXHosting.com systems.


I just set ONLY “Config Server” backup and it only uploads 1.1MB and then i get the same error. Whats weird is it sits there backing up JUST as long.

Doing a local only backup is instant.

This is a bug with the s3 library an external contributor gave us, specifically at this line: https://github.com/FreePBX/backup/blob/release/13.0/functions.inc/s3.php#L2310

Whatever data is there it’s huge and this machine can’t support that.

We are currently rewriting backup in 15 and we don’t support the s3 driver in 13 due to it’s complexity.

Okay. So this machine is 14. Is the bug going to main broken then? I am not sure what your reply was intending. Do i need to find a new solution for backups. We send all of our clients to Amazon S3 for backups of the phone system and since my discoveries last night it doesn’t seem to matter if its 1MB or 500MB. Its the same outcome.

Thanks again for the help. :slight_smile:

The bug will remain broken unless someone wants to patch it externally. In 15 it will be fixed.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.