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

So according to Jira #23167 (can’t post links yet) this is fixed in edge. I had this cron entry causing the issue before updating userman to edge:

* * * * * [ -e /usr/sbin/fwconsole ] && sleep $((RANDOM\%30)) && /usr/sbin/fwconsole job --run --quiet 2>&1 > /dev/null

Strangely I was getting emails every 30 minutes, even though that is scheduled to run every minute. After updating userman to edge (v15.0.67) the crontab now has

*/15 * * * * [ -e /usr/sbin/fwconsole ] && sleep $((RANDOM\%30)) && /usr/sbin/fwconsole userman --syncall -q
* * * * * [ -e /usr/sbin/fwconsole ] && sleep $((RANDOM\%30)) && /usr/sbin/fwconsole job --run --quiet 2>&1 > /dev/null

So that just added another broken entry.

The fix should be in userman versions 15.0.67 and 16.0.25.27.

EDIT: 15.0.67 and 16.0.25.30

Manually updated to v15.0.67

and crontab still has this:

1 Like

Like me, you actually have two broken entries now. A bit further up there’s also sleep $((RANDOM\%30)) in the line for fwconsole userman --syncall .

This is not true. I was already on 16.0.25.29, see screenshot above.

Also after your post, I ran updates again and version 16.0.25.30 is there.
Nope, nope, nope.

image

Yeah, I think you’re right.

Let me look back through the commit list and see where I misread it.

Matthew Fredrickson

OK I’m quite confused now. I posted on the Jira about how I still have that entry with the backslash and the devs responded that the issue is caused by not having the backslash.

I had the entry with the backslash before updating to edge, and I was getting the errors. After updating, it is not sending error emails any more even though that cron entry didn’t change… So I went to check a PBX I have not logged into today and it had the entry with the backslashes, but is still sending failure emails. I checked a 3rd one and it is the first I’ve seen without the backslash in the corn job.

But apart from that weirdness updating to edge does seem to fix the issue, I’m just not sure how.

Ok, sorry was looking at the wrong fix/commit. Looked back and saw Philip got a fix pushed up that went out in 15.0.67 and 16.0.25.30 that looks like it should clear out of the old line and put the fixed line in.

Can you see if that successfully removes the old cron lines and replaces them with the fixed version?

I can also confirm that I have not received cron error emails in the past 45 minutes. Previously, I was getting those emails in every 15 min cycle.

Thanks guys!!

I already said not resovled.

image

I might suggest that pragmatically the whole $((RANDOM%30)) && is an unnecessary complication, 99% of those here don’t need it and the other 1% know how to fix it

1 Like

Rebooted system and no more emails since. So 16.0.25.30 does resolve it?

16.0.25.30 has the commit in that fixes the crontab (removes the old entry and puts in a corrected one). I’m hoping that resolves it for you and others.

I’ve updated to the new module, I believe that the emails have stopped, but the BOUNCES will go on for a couple of days, I believe.

I can’t for the life of me figure out where it decided to email to “[email protected]

I’m new to the whole system, and I’ve been through all the admin settings i can find. Where can I provide a correct email address which doesn’t assume that the pbx has it’s own email addresses?

Thanks

The best place to configure the routing of mail for local accounts is in postfix. This was discussed a month or two ago. You might well find it by searching the forum on “postfix” and “alias”. It is also possible to set a variable in the crontab file, but making the crontab file non-standard is probably the last thing you want to do at the moment.

It is normal for Unix/Linux systems to send mail relating to an account to that account on the machine itself, although it would typically end up in a local mailbox, whereas the way that FreePBX configures the mail system, all mail is sent remotely.

1 Like

Thanks for the response, David, it gives me good clues.

Ugg, I’ve looked into this, and I guess this Gmail - Delivery Status Notification (Delay/Failed) - #13 by JohnnyBeGood is the post you may be speaking of. I can see a bunch of similar problems having to do with smtp relaying as well. Problems Configuring FreePBX for using external SMTP Server and Confluence Mobile - Documentation have clues.

I’ve been confused about the whole administrator email address and notification, looking to put together the hostname with the let’s encrypt domain understand the to and from email addresses the system sends. and setting the default certificate in certman and/or https settings in sysadminpro have been confusing, the settings are scattered around, and sparsely documented.

I coming to understand that the local system mail to root@, asterisk@ vm@ is being routed via postfix externally, whereas there are settings for fail2ban, updates and other system messages where you place your preferred admin email and it’s sent directly.

It seems there’s probably enough in the SMTP UI to get what I need without hard-coding alias maps, in settings myhostname, mydomain and myorigin which are stored in /etc/postfix/main.cf. And there is also a place to append custom main.cf settings, reference alias or generic lists or add masquerade domains or bcc’s

I think in my case the myhostname, mydomain and myorigin settings will be different from my external dns address of the system, or I can alias the external dns address at my mail server, and I guess that outbound mail like forwarded voicemails, messages about accounts, and other email to users may be specified there or somehow in the notification settings. Either way I’ll need to add asterisk and root administrative email aliases to my external email server for inbound mail.

Haven’t worked with postfix aliases in many years, not really interested in manually configuring postfix aliases outside the UI nor I am in editing crontab on a system like this. I need to document this in case I get hit by a bus, hopefully someone else can figure it out.

It would be nice to have a UI method to rewrite local admin from mail from cron and whatnot directly to a specified email such as the fail2ban and updates settings, or have a front end that helped with aliases.

What a confusing mess this UI is. I appreciate the package, it’s really good, but man it’s a pain to wrestle under control. There must be 10000 settings in all the different modules.

Thank goodness for this forum, and thanks again for your response

I’ve updated userman to the newest version, but still having issues with emails:

| userman | 15.0.67 | Enabled | AGPLv3+ |

          • [ -e /usr/sbin/fwconsole ] && sleep $((RANDOM%30)) && /usr/sbin/fwconsole job --run --quiet 2>&1 > /dev/null

Try fwconsole reload

Already tried a few times, both fwconsole r and reboot of the server.

This line is generated by framework (notice how there is no userman reference in that line) not userman. So updating userman wouldnt do anything (because userman no longer triggers the job class to run which has the init() code to fix itself)

To fix this you should just remove the line from your crontab. If anything needs a job it’ll be added back correctly eventually (as the fix in framework was done two years ago). On install framework should probably init() itself against the jobs class but this was never done.