leiweibau / Pi.Alert

Scan the devices connected to your WIFI / LAN and alert you the connection of unknown devices. It also warns if a "always connected" device disconnects. In addition, it is possible to check web services for availability. For this purpose HTTP status codes and the response time of the service are evaluated.
https://leiweibau.net
GNU General Public License v3.0
342 stars 25 forks source link

Error on update #263

Closed hspindel closed 5 months ago

hspindel commented 5 months ago

When I updated today (2/24/24), I got the following error message:

Start ICMP Monitoring... Get Host/Domain List... List contains 16 entries Flush previous ping results... Ping Hosts... Online Host(s) : 13 Offline Host(s) : 3 Save scan results... Traceback (most recent call last): File "/root/pialert/back/pialert.py", line 2953, in sys.exit(main()) ^^^^^^ File "/root/pialert/back/pialert.py", line 92, in main res = scan_network() ^^^^^^^^^^^^^^ File "/root/pialert/back/pialert.py", line 638, in scan_network icmp_monitoring() File "/root/pialert/back/pialert.py", line 2202, in icmp_monitoring icmp_save_scandata(icmp_scan_results) File "/root/pialert/back/pialert.py", line 2218, in icmp_save_scandata set_icmphost_current_scan(host_ip, scan_data['scantime'], scan_data['icmp_status'], scan_data[' cmp_rtt']) File "/root/pialert/back/pialert.py", line 2281, in set_icmphost_current_scan sql.execute(sqlite_insert, table_data) sqlite3.IntegrityError: UNIQUE constraint failed: ICMP_Mon_CurrentScan.cur_ip


Update process finished

Thanks as always to leiweibau for an excellent tool and great support.

leiweibau commented 5 months ago

Does the error also occur in normal operation? The way I interpret the error, it could be that 2 scans were active at that moment (the update scan and the cron-based scan). In the table ICMP_Mon_CurrentScan.cur_ip each IP may only occur once. The error indicates that an attempt was made to re-enter an existing IP in the table.

hspindel commented 5 months ago

That's probably it, then. It takes quite a while for pialert to update so a cronjob scan could easily start while the update is in progress.

I've not noticed any issues with pialert, so let's close thiis and I'll reopen if I see a problem later.