Qxactreports CRON job missing

Hello. I moved an old FreePBX v13 install to v15 via the backup and restore method a while back. Found out today that the Queue Reports module wasn’t properly working anymore. The Agents and Queues section was blank.

Checked the mysql database and found that the asterisk.qxact_calls table was empty.
However there were log files that existed with data /var/log/asterisk/queue_log*.

So looked into the CRON jobs under the asterisk user account as I believe that’s where the jobs run from. I don’t see anything for the qxactreports sync.

[[email protected]]# crontab -u asterisk -e
13 3 * * * /usr/sbin/fwconsole certificates --updateall -q 2>&1 >/dev/null
*/15 * * * * [ -e /etc/asterisk/firewall.enabled ] && touch /var/spool/asterisk/incron/firewall.firewall
0 1 * * * /var/www/html/admin/modules/iotserver/bin/check_license.php 2>&1 >/dev/null
0 2 * * * /var/www/html/admin/modules/iotserver/bin/check_certificates.php 2>&1 >/dev/null
0 4 * * * /var/www/html/admin/modules/iotserver/bin/refresh_tzoffsets.php 2>&1 >/dev/null
*/1 * * * * /var/www/html/admin/modules/iotserver/bin/check_system_settings.sh 2>&1 >/dev/null
@daily /usr/sbin/fwconsole pms mk_dirty > /dev/null 2>&1
@daily [ -x /var/lib/asterisk/bin/freepbx_sipstation_check ] && /var/lib/asterisk/bin/freepbx_sipstation_check 2>&1 > /dev/null
*/15 * * * * [ -e /usr/local/sbin/fwconsole ] && sleep $((RANDOM\%30)) && /usr/local/sbin/fwconsole userman --syncall -q
* * * * * [ -e /usr/sbin/fwconsole ] && sleep $((RANDOM\%30)) && /usr/sbin/fwconsole queuestats --syncall >> /tmp/reader.log 2>&1
59 23 * * 0 /var/lib/asterisk/bin/queue_reset_stats.php --id=2094
59 23 * * 0 /var/lib/asterisk/bin/queue_reset_stats.php --id=2097
59 23 * * 0 /var/lib/asterisk/bin/queue_reset_stats.php --id=2497
* 2 * * * /usr/sbin/fwconsole util cleanplaybackcache -q
42 3 * * 6 [ -e /usr/sbin/fwconsole ] && /usr/sbin/fwconsole ma listonline --sendemail -q > /dev/null 2>&1
42 5 * * 6 [ -e /usr/sbin/fwconsole ] && /usr/sbin/fwconsole ma upgradeall --sendemail -q > /dev/null 2>&1
* * * * * [ -e /usr/sbin/fwconsole ] && sleep $((RANDOM\%30)) && /usr/sbin/fwconsole job --run --quiet 2>&1 > /dev/null

So I then checked using fwconsole and I see the job, which I believe should update every 5 minutes.

[[email protected] ]# fwconsole job --list
+----+----------------------+------------------------+-------------+---------------------+----------------------------------------------------------------------------------------------------------------------------------------+---------+
| ID | Module               | Job                    | Cron        | Next Run            | Action                                                                                                                                 | Enabled |
+----+----------------------+------------------------+-------------+---------------------+----------------------------------------------------------------------------------------------------------------------------------------+---------+
| 39 | pagingpro            | scheduler              | * * * * *   | 2022-04-01 12:30:00 | Class: FreePBX\modules\Pagingpro\Job                                                                                                   | Yes     |
| 10 | vqplus_callback_logs | sync                   | 59 23 * * * | 2022-04-01 23:59:00 | Command: /usr/local/sbin/fwconsole vqplus daemonlog -q 2>&1 > /dev/null                                                                | Yes     |
| 12 | dashboard            | scheduler              | * * * * *   | 2022-04-01 12:30:00 | Class: FreePBX\modules\Dashboard\Job                                                                                                   | Yes     |
| 14 | digium_phones        | clearcdr               | 5 * * * *   | 2022-04-01 13:05:00 | Class: FreePBX\modules\Digium_phones\Job                                                                                               | Yes     |
| 23 | calendar             | sync                   | * * * * *   | 2022-04-01 12:30:00 | Class: FreePBX\modules\Calendar\Job                                                                                                    | Yes     |
| 24 | firewall             | syncIDetection         | */5 * * * * | 2022-04-01 12:30:00 | Command: [ -e /usr/sbin/fwconsole ] && /usr/sbin/fwconsole firewall sync                                                               | Yes     |
| 25 | pms                  | wu_alert               | * * * * *   | 2022-04-01 12:30:00 | Class: FreePBX\modules\Pms\Job                                                                                                         | Yes     |
| 26 | qxact_reports        | sync                   | */5 * * * * | 2022-04-01 12:30:00 | Command: /usr/local/sbin/fwconsole qxactreports --sync -q 2>&1 > /dev/null                                                             | Yes     |
| 27 | recording_report     | clean                  | 30 22 * * * | 2022-04-01 22:30:00 | Command: /usr/local/sbin/fwconsole recordingreports -s -c                                                                              | Yes     |
| 28 | recording_report     | backup                 | 0 0 1 * *   | 2022-05-01 00:00:00 | Command: php /var/lib/asterisk/agi-bin/backuprecordings.php                                                                            | Yes     |
| 29 | restapps             | deletesymlinks         | 0 1 * * *   | 2022-04-02 01:00:00 | Command: /usr/local/sbin/fwconsole phoneapps --deletesymlinks                                                                          | Yes     |
| 30 | sangomaconnect       | sync                   | */5 * * * * | 2022-04-01 12:30:00 | Command: /var/www/html/admin/modules/sangomaconnect/bin/keep_alive.php 2>&1 >/dev/null                                                 | Yes     |
| 31 | sangomaconnect       | checkSSL               | 0 2 * * *   | 2022-04-02 02:00:00 | Command: /var/www/html/admin/modules/sangomaconnect/bin/check_certificates_sc.php 2>&1 >/dev/null                                      | Yes     |
| 32 | sangomaconnect       | checkLicense           | 0 1 * * *   | 2022-04-02 01:00:00 | Command: /var/www/html/admin/modules/sangomaconnect/bin/check_license_sc.php                                                           | Yes     |
| 33 | sangomaconnect       | clean                  | @daily      | 2022-04-02 00:00:00 | Command: /usr/sbin/fwconsole sc cleanGarbageDeviceData 2>&1 > /dev/null                                                                | Yes     |
| 34 | restapps             | cleanReplicatedCDRData | @monthly    | 2022-05-01 00:00:00 | Command: /var/www/html/admin/modules/restapps/bin/cleanReplicatedCDRData.php &>/dev/null                                               | Yes     |
| 35 | sysadmin             | checkportal            | @daily      | 2022-04-02 00:00:00 | Command: [ -e /var/www/html/admin/modules/sysadmin/bin/check_portal.php ] && /var/www/html/admin/modules/sysadmin/bin/check_portal.php | Yes     |
| 36 | sysadmin             | ddnsupdate             | @daily      | 2022-04-02 00:00:00 | Class: FreePBX\modules\Sysadmin\Job\DdnsUpdate                                                                                         | Yes     |
| 37 | sysadmin             | checkstorage           | @hourly     | 2022-04-01 13:00:00 | Command: [ -x /var/lib/asterisk/bin/storage.php ] && /var/lib/asterisk/bin/storage.php                                                 | Yes     |
| 38 | timeconditions       | schedtc                | * * * * *   | 2022-04-01 12:30:00 | Class: FreePBX\modules\Timeconditions\Job                                                                                              | Yes     |
| 40 | sysadmin             | updatelicense          | @daily      | 2022-04-02 00:00:00 | Command: [ -x /var/lib/asterisk/agi-bin/update_license.php ] && /var/lib/asterisk/agi-bin/update_license.php --delay                   | Yes     |
+----+----------------------+------------------------+-------------+---------------------+----------------------------------------------------------------------------------------------------------------------------------------+---------+

However that doesn’t seem to be the case as I can see activity in the log files but the queue reports aren’t showing this activity (ie. not being synced to database) and haven’t updated in the past hour since I manually synced and imported the data by running the commands via fwconsole;

fwconsole qxactreports --sync
fwconsole qxactreports --reimport="FILE_LIST" --sync

So it would seem to me that if these commands can sync and import the data then there must be something wrong with the CRON scheduled task. Perhaps it “thinks” it is running but in actuality it isn’t and I could regenerate the CRON job or manually create it?

EDIT: monitoring /var/log/cron I see nothing for the qxactreport command being triggered at the “next run” time that fwconsole says it was supposed to run. So it sure seems to me that fwconsole is simply wrong and the CRON job doesn’t exist.

More digging. Appears that it’s “expected” that some of the jobs listed by fwconsole don’t appear in crontab (even under the asterisk user).

I noticed I could attempt to force trigger the job via fwconsole. So I did and found the error;

[[email protected]]# fwconsole job --run=26 --force
Running qxact_reports :: sync ...
sh: /usr/local/sbin/fwconsole: No such file or directory

Done with sync

/use/local/sbin/fwconsole doesn’t exist. Which is accurate, I checked and it indeed doesn’t exist.
I noticed some commands point to /usr/sbin/fwconsole which DOES exist.

These are the only 2 location fwconsole exists on the system.

[[email protected]]# find / -name fwconsole
/var/lib/asterisk/bin/fwconsole
/usr/sbin/fwconsole

So I’m guessing if I could update wherever these commands are being stored I could easily resolve the issue. But I’m not exactly sure where and how. I’m guessing it’s stored in the mysql database somewhere.

Actually, now that I think about it there is a better/correct solution…
/usr/sbin/fwconsole is just a symlink to /var/lib/asterisk/bin/fwconsole
My guess is that /usr/local/sbin/fwconsole is supposed to actually exist and be a smylink as well to /var/lib/asterisk/bin/fwconsole

So just run the following to create the symlink and it will work.
ln -s /var/lib/asterisk/bin/fwconsole /usr/local/sbin/fwconsole

[[email protected]]# fwconsole job --run=26 --force
Running qxact_reports :: sync ...
Done with sync

What do you see with this command. This is from my stock 15 system:

# fwconsole setting WHICH_fwconsole
Setting of "WHICH_fwconsole" is (text)[/sbin/fwconsole]

edit - ignore this, stock setting is /usr/sbin/fwconsole

[[email protected]]# fwconsole setting WHICH_fwconsole
Setting of "WHICH_fwconsole" is (text)[/usr/sbin/fwconsole]

This was a fresh v15 install from FreePBX ISO and then restored the backup of my old v13 system via the B&R module. I followed the recommendations in the guides on this process. Could the restore process have changed it? :thinking:

FYI, it thinks this SHOULD be the default as well…

+--------------------------------------+-------------------------------------+-----------------------------------------------+
| Name                                 | Value                               | Default Value                                 |
+--------------------------------------+-------------------------------------+-----------------------------------------------+
| WHICH_fwconsole                      | /usr/sbin/fwconsole                 | /usr/sbin/fwconsole                           |

I’ve checked a few other systems, and thinking my post above is wrong, your setting looks correct. If you’re qxact module is up to date (current stable is 15.0.4) , then the next step is a support ticket.
https://wiki.freepbx.org/display/FPAS/How+To+Open+A+Support+Ticket

[[email protected]]# fwconsole ma list | grep qxact_report
| qxact_reports        | 15.0.3.39  | Enabled                           | Commercial  |

Not seeing a 15.0.4 presented to the system.
Guessing it is because support has expired on the commercial modules.

FYI, the symlink did work to resolve the issue. So it’s not like the code doesn’t “work”, it’s just a rather stupid file path issue.

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