FreePBX 17: Apply Config fails → fwconsole reload --verbose stops on cron (“bad minute”), asterisk crontab shows JSON

TLDR VERSION:
Hi all,

I’m running FreePBX 17.0.25. After changing the External IP in the GUI and clicking Apply Config, I get:

Unknown Error. Please Run: fwconsole reload --verbose

On SSH:

/usr/sbin/fwconsole reload --verbose

It fails with:

  • Cron line added didn't remain in crontab on final check. Check /var/spool/asterisk/tmp/cron.error

  • Stack trace points into modules/timeconditionsupdateCron()

/var/spool/asterisk/tmp/cron.error contains repeated:

"-":0: bad minute
errors in crontab file, can't install.

cron.service is running, but logs include:

  • (asterisk) ERROR (Missing newline before EOF, this crontab file will be ignored)

Most suspicious:

crontab -u asterisk -l

returns JSON output instead of cron lines (so the asterisk user’s crontab seems corrupted).

Questions:

  1. Is it expected that FreePBX reload/apply config will fail as long as the asterisk crontab is invalid?

  2. What’s the cleanest/official way to recover—reset the asterisk crontab and let FreePBX re-create its jobs, or is there a FreePBX-specific rebuild step?

Thanks!

DETAILED VERSION:
Hi FreePBX community,

I’m stuck with a reload/apply config failure on:

  • FreePBX 17.0.25

  • Debian-based system, cron installed and running

What happened
I changed the External IP in the FreePBX GUI and clicked Apply Config. Immediately got:

Unknown Error. Please Run: fwconsole reload --verbose

SSH output

/usr/sbin/fwconsole reload --verbose

It fails early with:

  • Cron line added didn't remain in crontab on final check. Check /var/spool/asterisk/tmp/cron.error

  • Trace goes through:

    • BMO/Cron.class.php

    • BMO/Job.class.php

    • modules/timeconditions/Timeconditions.class.php: updateCron()

cron.error

"-":0: bad minute
errors in crontab file, can't install.
(repeated)

cron status
cron.service is active, but it also reports:

  • (asterisk) ERROR (Missing newline before EOF, this crontab file will be ignored)

Key detail

crontab -u asterisk -l

returns JSON instead of cron syntax, so the asterisk user’s crontab appears corrupted/invalid.

Permissions look normal (crontab binary and /var/spool/cron/crontabs exist with expected ownership/permissions).

Questions

  1. Is it expected that FreePBX will fail fwconsole reload (and therefore Apply Config) when the asterisk crontab is invalid?

  2. What is the recommended recovery method: remove/reset the asterisk crontab and let FreePBX recreate its job entries, or is there a specific FreePBX “rebuild cron/jobs” procedure?

  3. Any known causes for JSON ending up in the asterisk crontab (module, script, firewall tool, etc.)?

Happy to provide more outputs if needed (e.g. fwconsole ma list, /var/spool/cron/crontabs/asterisk content, etc.).

Thanks in advance!

Please anyone, i can’t make any configurations now. everything i do corrupts te system…

i tried to restore a backup :tired_face:

There were errors during the restore process
Cron line added didn’t remain in crontab on final check. Check /var/spool/asterisk/tmp/cron.error for reason. on line 130 of file /var/www/html/admin/libraries/BMO/Cron.class.php
Cron line added didn’t remain in crontab on final check. Check /var/spool/asterisk/tmp/cron.error for reason. on line 130 of file /var/www/html/admin/libraries/BMO/Cron.class.php
Cron line added didn’t remain in crontab on final check. Check /var/spool/asterisk/tmp/cron.error for reason. on line 130 of file /var/www/html/admin/libraries/BMO/Cron.class.php
Cron line added didn’t remain in crontab on final check. Check /var/spool/asterisk/tmp/cron.error for reason. on line 130 of file /var/www/html/admin/libraries/BMO/Cron.class.php
Cron line added didn’t remain in crontab on final check. Check /var/spool/asterisk/tmp/cron.error for reason. on line 130 of file /var/www/html/admin/libraries/BMO/Cron.class.php
Cron line added didn’t remain in crontab on final check. Check /var/spool/asterisk/tmp/cron.error for reason. on line 130 of file /var/www/html/admin/libraries/BMO/Cron.class.php
Cron line added didn’t remain in crontab on final check. Check /var/spool/asterisk/tmp/cron.error for reason. on line 130 of file /var/www/html/admin/libraries/BMO/Cron.class.php
Trying to access array offset on value of type bool on line 1366 of file /var/www/html/admin/modules/missedcall/Missedcall.class.php
Cron line added didn’t remain in crontab on final check. Check /var/spool/asterisk/tmp/cron.error for reason. on line 130 of file /var/www/html/admin/libraries/BMO/Cron.class.php
Cron line added didn’t remain in crontab on final check. Check /var/spool/asterisk/tmp/cron.error for reason. on line 130 of file /var/www/html/admin/libraries/BMO/Cron.class.php
Cron line added didn’t remain in crontab on final check. Check /var/spool/asterisk/tmp/cron.error for reason. on line 130 of file /var/www/html/admin/libraries/BMO/Cron.class.php
Cron line added didn’t remain in crontab on final check. Check /var/spool/asterisk/tmp/cron.error for reason. on line 130 of file /var/www/html/admin/libraries/BMO/Cron.class.php
Cron line added didn’t remain in crontab on final check. Check /var/spool/asterisk/tmp/cron.error for reason. on line 130 of file /var/www/html/admin/libraries/BMO/Cron.class.php
Cron line added didn’t remain in crontab on final check. Check /var/spool/asterisk/tmp/cron.error for reason. on line 130 of file /var/www/html/admin/libraries/BMO/Cron.class.php
Cron line added didn’t remain in crontab on final check. Check /var/spool/asterisk/tmp/cron.error for reason. on line 130 of file /var/www/html/admin/libraries/BMO/Cron.class.php
Cron line added didn’t remain in crontab on final check. Check /var/spool/asterisk/tmp/cron.error for reason. on line 130 of file /var/www/html/admin/libraries/BMO/Cron.class.php
Cron line added didn’t remain in crontab on final check. Check /var/spool/asterisk/tmp/cron.error for reason. on line 130 of file /var/www/html/admin/libraries/BMO/Cron.class.php
Cron line added didn’t remain in crontab on final check. Check /var/spool/asterisk/tmp/cron.error for reason. on line 130 of file /var/www/html/admin/libraries/BMO/Cron.class.php
There were warnings during the restore process
Can’t find the module data for ttsengines
Can’t find the module data for callback
Can’t find the module data for callerid
Can’t find the module data for calllimit
Can’t find the module data for conferencespro
Can’t find the module data for miscdests
Can’t find the module data for setcid

Goodbye weekend :sleepy_face: there goes my Sunday… :face_with_bags_under_eyes:

Everything was fine after reinstalling, restoring the backup, enabling voicemail for a few extensions, and rebooting. Still, it’s kind of brutal how easily it can break…

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