(fixed by reinstall) mailreports sending duplicate reports after power fail
-
Update Jan 6, 2016:
- updating to 2.2.6 did not fix the problem
- Re-install of 2.2.6 and restoring from saved config file fixed the problem
–------------------------------------------------------------------------------------
After a power failure mailreports has been sending duplicate reports. I have it configured to send one report at 7am and another at 7pm. Each time I receive 2 separate email reports: one of the reports looks normal, the other has corrupted data: old logs, graphs have wrong data (snippets attached at the end).
I compared the pfsense backup configuration files from before and after the power fail and they are identical.
I have tried:
- deleting the mailreports entries from the web gui and re-creating them with different names. I still get duplicate reports: the new one with correct data and the old one with corrupted data.
- re-installed mailreports package, no change
- removed and then installed the mailreports package, no change
I could probably fix this with a reinstall of pfsense since I have good configuration backups. The system is remote so I can’t re-install pfsense until I am onsite again in about a month.
I’d like a way to straighten this out remotely without a reinstall.
Update
If I manually run:
/usr/local/bin/mail_reports_generate.php 0
I only get 1 email report and it is good.Supporting info:
pfsense version: 2.2.5-RELEASE (i386)
mailreports version: 2.3_1/etc/crontab entry for mailreports:
0 7 * * * root /usr/local/bin/mail_reports_generate.php 0 &
0 19 * * * root /usr/local/bin/mail_reports_generate.php 1 &mailreports section of config-pfsense.xml
<mailreports><schedule><frequency>daily</frequency>
<timeofday>7</timeofday>
<submit>Save</submit>
<id>0</id>
<cmd><log><row><logfile>dhcpd.log</logfile>
<lines><detail><submit>Save</submit>
<reportid>0</reportid></detail></lines></row>
<row><logfile>openvpn.log</logfile>
<lines><detail><submit>Save</submit>
<reportid>0</reportid></detail></lines></row>
<row><logfile>portalauth.log</logfile>
<lines><detail><submit>Save</submit>
<reportid>0</reportid></detail></lines></row>
<row><logfile>system.log</logfile>
<lines><detail><submit>Save</submit>
<reportid>0</reportid></detail></lines></row></log>
<row><graph>wan-traffic.rrd</graph><timespan>eighthour</timespan>
<period>absolute</period>
<submit>Save</submit>
<reportid>0</reportid></row>
<row><graph>wan-traffic.rrd</graph><timespan>day</timespan>
<period>absolute</period>
<submit>Save</submit>
<reportid>0</reportid></row>
<row><graph>WAN_DHCP-quality.rrd</graph><timespan>eighthour</timespan>
<period>absolute</period>
<submit>Save</submit>
<reportid>0</reportid></row>
<row><graph>WAN_DHCP-quality.rrd</graph><timespan>day</timespan>
<period>absolute</period>
<submit>Save</submit>
<reportid>0</reportid></row>
<row><graph>opt2-traffic.rrd</graph><timespan>eighthour</timespan>
<period>absolute</period>
<submit>Save</submit>
<reportid>0</reportid></row>
<row><graph>opt2-traffic.rrd</graph><timespan>day</timespan>
<period>absolute</period>
<submit>Save</submit>
<reportid>0</reportid></row>
<schedule_friendly>Daily at 07:00</schedule_friendly></cmd></schedule>
<schedule><frequency>daily</frequency>
<timeofday>19</timeofday>
<submit>Save</submit>
<id>1</id><log><row><logfile>dhcpd.log</logfile>
<lines><detail><submit>Save</submit>
<reportid>1</reportid></detail></lines></row>
<row><logfile>openvpn.log</logfile>
<lines><detail><submit>Save</submit>
<reportid>1</reportid></detail></lines></row>
<row><logfile>portalauth.log</logfile>
<lines><detail><submit>Save</submit>
<reportid>1</reportid></detail></lines></row>
<row><logfile>system.log</logfile>
<lines><detail><submit>Save</submit>
<reportid>1</reportid></detail></lines></row></log>
<row><graph>wan-traffic.rrd</graph><timespan>eighthour</timespan>
<period>absolute</period>
<submit>Save</submit>
<reportid>1</reportid></row>
<row><graph>WAN_DHCP-quality.rrd</graph><timespan>eighthour</timespan>
<period>absolute</period>
<submit>Save</submit>
<reportid>1</reportid></row>
<row><graph>opt2-traffic.rrd</graph><timespan>eighthour</timespan>
<period>absolute</period>
<submit>Save</submit>
<reportid>1</reportid></row>
<row><graph>wan-traffic.rrd</graph><timespan>day</timespan>
<period>absolute</period>
<submit>Save</submit>
<reportid>1</reportid></row>
<row><graph>WAN_DHCP-quality.rrd</graph><timespan>day</timespan>
<period>absolute</period>
<submit>Save</submit>
<reportid>1</reportid></row>
<row><graph>opt2-traffic.rrd</graph><timespan>day</timespan>
<period>absolute</period>
<submit>Save</submit>
<reportid>1</reportid></row>
<schedule_friendly>Daily at 19:00</schedule_friendly></schedule></mailreports>Part of good report: note that the name of the report is “morning report 120315”.
Current report: morning report 120315Log output: DHCP (dhcpd.log)
Dec 5 05:28:50 pfSense dhcpd: DHCPACK on 192.168.1.132 to 78:ac:c0:97:90:40 via bge1_vlan3
Dec 5 05:30:13 pfSense dhcpd: DHCPINFORM from 192.168.2.202 via bge1_vlan10
Dec 5 05:30:13 pfSense dhcpd: DHCPACK to 192.168.2.202 (00:21:9b:17:45:80) via bge1_vlan10
Dec 5 05:31:49 pfSense dhcpd: DHCPINFORM from 192.168.9.201 via bge1_vlan9
Dec 5 05:31:49 pfSense dhcpd: DHCPACK to 192.168.9.201 (00:1a:4b:45:62:67) via bge1_vlan9
Dec 5 05:34:52 pfSense dhcpd: Wrote 0 deleted host decls to leases file.
Dec 5 05:34:52 pfSense dhcpd: Wrote 0 new dynamic host decls to leases file.
Dec 5 05:34:52 pfSense dhcpd: Wrote 15 leases to leases file.Part of bad report:
Current report: morning reportLog output: DHCP (dhcpd.log)
Dec 4 06:14:28 pfSense dhclient: RENEW
Dec 4 06:14:28 pfSense dhclient: Creating resolv.conf
Dec 4 07:14:28 pfSense dhclient: RENEW
Dec 4 07:14:28 pfSense dhclient: Creating resolv.conf
Dec 4 08:14:29 pfSense dhclient: RENEW
Dec 4 08:14:29 pfSense dhclient: Creating resolv.conf
Dec 4 09:14:29 pfSense dhclient: RENEW
Dec 4 09:14:29 pfSense dhclient: Creating resolv.conf
Dec 4 10:14:29 pfSense dhclient: RENEW
Dec 4 10:14:29 pfSense dhclient: Creating resolv.conf
Dec 4 11:14:29 pfSense dhclient: RENEW
Dec 4 11:14:29 pfSense dhclient: Creating resolv.conf
Dec 4 12:14:29 pfSense dhclient: RENEW