Mult emals - Cron <asterisk@24408486> [ -e /usr/sbin/fwconsole ] && sleep $((RANDOM

I think we have agreed on this a few times for a few things already…

Changing $((RANDOM%30)) to $((RANDOM %30)) dependently fixed my issue.

\# sh -c "echo $((RANDOM %30))"
27
\# sh -c "echo $((RANDOM\%30))"
-bash: RANDOM\%30: syntax error: invalid arithmetic operator (error token is "\%30")

But some process keep rewriting /var/spool/cron/asterisk. Does any one know which process?

Checking my emails now I see this message started appearing for me today straight after the 06:35 UT automatic module Update email. It appears every 15 minutes.

So whatever is causing this came via the update. I just did a manual module update but there is no change.

I have not read through this long thread - is there a fix for this?

I have the same issue from this morning.

Same issue here.

Current PBX Version:
15.0.17.64
Current System Version:
12.7.8-2107-3.sng7

Same problem as documented in this thread. Basically FreePBX pushed an untested and broken module to your PBX. You will need to either wait for a fix, presumably next Friday, or manually revert the module. It is not a real killer but an incredibly incompetent release

Same here

FreePBX 15.0.17.64

Started after this mornings automated module updates, now recieving an email every 15 minutes from our FreePBX server.

Please advise.

Did you read this thread ?

Could someone please advise how to go back to the previous version.

1 Like

It might be a little more complicated than that, because the previous module didn’t inject a crontab and the broken one might not remove it on being ‘replaced’.

Any takers here?

1 Like

Using WinSCP I can see the relevant entry (the last line) in file /var/spool/cron/asterisk so I can delete it.

Would not then a rollback be adequate?

That would take some regression testing, ask FreePBX but they are currently not exactly A+ on that right now. Why not suck it and see. let us know how it worked out.

I’m happy to try but don’t know how to roll it back.

Since it seems the entire Sangoma team doesn’t care about anything outside of M-F 8-5…

I upgraded one of my PBX systems last night. I was not having any issues prior to the upgrade.

'userman' from 16.0.25.18 to 16.0.25.28

Now I have the 15 minute cron error.

[jbusch@pbx ~]$ sudo -u asterisk crontab -l
[sudo] password for jbusch: 

*/15 * * * * [ -e /etc/asterisk/firewall.enabled ] && touch /var/spool/asterisk/incron/firewall.firewall
*/15 * * * * [ -e /usr/sbin/fwconsole ] && sleep $((RANDOM\%30)) && /usr/sbin/fwconsole userman --syncall -q
* 3 * * * /usr/sbin/fwconsole util cleanplaybackcache -q
9 19 * * * [ -e /usr/sbin/fwconsole ] && /usr/sbin/fwconsole ma listonline --sendemail -q > /dev/null 2>&1
9 20 * * * [ -e /usr/sbin/fwconsole ] && /usr/sbin/fwconsole sys listonline --sendemail -q > /dev/null 2>&1
* * * * * [ -e /usr/sbin/fwconsole ] && sleep $((RANDOM\%30)) && /usr/sbin/fwconsole job --run --quiet 2>&1 > /dev/null

I checked edge, and there was an update to .29

| userman             | 16.0.25.28 | Online upgrade available (16.0.25.29)     | AGPLv3+     |
sudo fwconsole ma upgrade userman --edge
sudo fwconsole reload

And still a screwed up crontab.

*/15 * * * * [ -e /etc/asterisk/firewall.enabled ] && touch /var/spool/asterisk/incron/firewall.firewall
*/15 * * * * [ -e /usr/sbin/fwconsole ] && sleep $((RANDOM\%30)) && /usr/sbin/fwconsole userman --syncall -q
* 4 * * * /usr/sbin/fwconsole util cleanplaybackcache -q
47 17 * * * [ -e /usr/sbin/fwconsole ] && /usr/sbin/fwconsole ma listonline --sendemail -q > /dev/null 2>&1
47 18 * * * [ -e /usr/sbin/fwconsole ] && /usr/sbin/fwconsole sys listonline --sendemail -q > /dev/null 2>&1
* * * * * [ -e /usr/sbin/fwconsole ] && sleep $((RANDOM\%30)) && /usr/sbin/fwconsole job --run --quiet 2>&1 > /dev/null

Here are the known rollback options for FreePBX 16. I’ll start with .18 as that is where I came from.
image

sudo fwconsole ma downloadinstall userman --tag=16.0.25.18
sudo fwconsole reload

It removed the userman cron line.

[jbusch@pbx ~]$ sudo -u asterisk crontab -l

*/15 * * * * [ -e /etc/asterisk/firewall.enabled ] && touch /var/spool/asterisk/incron/firewall.firewall
* * * * * [ -e /usr/sbin/fwconsole ] && sleep $((RANDOM\%30)) && /usr/sbin/fwconsole job --run --quiet 2>&1 > /dev/null
* 2 * * * /usr/sbin/fwconsole util cleanplaybackcache -q
36 19 * * * [ -e /usr/sbin/fwconsole ] && /usr/sbin/fwconsole ma listonline --sendemail -q > /dev/null 2>&1
36 20 * * * [ -e /usr/sbin/fwconsole ] && /usr/sbin/fwconsole sys listonline --sendemail -q > /dev/null 2>&1

My last failure was at 6:15PM. It is now 6:24PM. I’ll know in a few minutes.
image

I am on 15: Upgrading module ‘userman’ from 15.0.63 to 15.0.65

The FreePBX docs say ‘Starting in version 12 you can downgrade module versions from Modue Admin.’ but my V15 Module Admin does not show a ‘Previous’ option.

You have to click check online before that becomes visible.

Not really surprised, it still comes in.
image

On a FreePBX distro

ls -l $(cat /etc/shells) 

revealing that /bin/sh is an alias of /bin/bash , from a bash shell try

bash --version
echo $((RANDOM\%30))
echo $((RANDOM%30)) 
echo $((${RANDOM} % 30)) 

Now the second and the third should work fine , the third one would be what I would use for clarity, as the $(( )) does the math so ${RANDOM} is ‘modulo’ed’ 30. But is there any way that unnecessarily ‘escaping’ the modulus operator in the first on will ever get to performing the operation after && ?

Thank you - worked.

On CRON jobs list this time there were actually two similar jobs: one running every minute and the other every 15. I deleted both.

It is a couple of hours later and there have been no messages and the two Cron lines I deleted have not come back.

All seems to be OK.