module_admin reload file size limit exceeded

I have a system that has a few thousand extensions.

I have an external script that runs occasionally runs that adds extensions by calling the bulk extensions module and then at the end calls:

/var/lib/asterisk/bin/module_admin reload

That has been working fine for months now, but just recently if I run module_admin reload I’ve been getting the error:

sh: line 1: 27994 File size limit exceeded/var/lib/asterisk/bin/retrieve_conf 2>&1
Error(s) have occured, the following is the retrieve_conf output:
exit: 153

When I go to the FreePBX UI, I see the following under system status:

retrieve_conf failed, config not applied
Reload failed because retrieve_conf encountered an error: 153
Added 1 minute ago
(freepbx.RCONFFAIL)

Any thoughts on what the issue is?

Thanks in advance.

My /tmp/freepbx_debug.log had exceeded 2 gigabytes. When I deleted the log file the error went away.

What version of FreePBX was this because the logging should auto rotate before it hits 2GB for this reason.

Tony

I have 4 different sites running 2.9.0.7 distro and all have the same issue.

I do not see anywhere in any of the logrotate configs where /tmp/freepbx_debug.log is rotated.

Is it normal for FreePBX to write logs to /tmp?

To answer your question, I’m running the latest and greatest - FreePBX 2.9.0.7

There seems to be a “bug” in php or possibly some combination of php/CentOS that results in PHP crashing when trying to write a file bigger than 2G vs. returning with an error.

This is something that was addressed in 2.10 but I don’t think back ported to 2.9 which we need to have a look at. In addition, although you can turn off debug logging in either version, PHP errors/notices get logged to the debug file as well vs. to the configured PHP location since FreePBX replaces the error handler and these don’t get turned off.

The latter situation is something we need to have a look at and determine how we want to best deal with it.