Closed YoSafeguard closed 1 year ago
Hi there,
Could you please make sure you are using the correct interface as described in the docs?
https://github.com/jokob-sk/Pi.Alert/blob/main/docs/SUBNETS.md
Please make sure the interface corresponds to the output of iwconfig run in the container.
According to the log, the interface didn't seem to be found:
pcap_activate: eth1: No such device exists (SIOCGIFHWADDR: No such device)
Thanks, J
Hi there!!!
I brought the network interface in accordance with the recommendations in the settings. Now this error is gone:
pcap_activate: eth1: No such device exists
But restarts continue stably every 2 hours exactly. The last one was at 9.30, before that at 7.30. After 5 restarts, the container stops. Sending the latest log:
`09:28:03 [Process Scan] Print Stats 09:28:03 [Scan Stats] Devices Detected.......: 0 09:28:03 [Scan Stats] arp-scan detected..: 0 09:28:03 [Scan Stats] Pi-hole detected...: +0 09:28:03 [Scan Stats] New Devices........: 0 09:28:03 [Scan Stats] Devices in this cycle..: 0 09:28:03 [Scan Stats] Down Alerts........: 0 09:28:03 [Scan Stats] New Down Alerts....: 0 09:28:03 [Scan Stats] New Connections....: 0 09:28:03 [Scan Stats] Disconnections.....: 0 09:28:03 [Scan Stats] IP Changes.........: 0 09:28:03 [Process Scan] Stats end 09:28:03 [Process Scan] Updating DB Info 09:28:03 [Process Scan] Sessions Events (connect / discconnect) 09:28:03 [Process Scan] Creating new devices 09:28:03 [Process Scan] Updating Devices Info 09:28:03 [Process Scan] Resolve devices names 09:28:03 [Process Scan] Voiding false (ghost) disconnections 09:28:03 [Process Scan] Pairing session events (connection / disconnection) 09:28:03 [Process Scan] Creating sessions snapshot 09:28:03 [Process Scan] Inserting scan results into Online_History 09:28:03 [Process Scan] Skipping repeated notifications 09:28:03 [Skip Repeated Notifications] Skip Repeated start 09:28:03 [Skip Repeated Notifications] Skip Repeated end 09:28:03 [MAIN] Process: Wait 09:28:08 [API] Update API starting 09:28:09 [MAIN] waiting to start next loop 09:28:14 [API] Update API starting 09:28:14 [MAIN] waiting to start next loop 09:28:19 [API] Update API starting 09:28:19 [MAIN] waiting to start next loop 09:28:24 [API] Update API starting 09:28:24 [MAIN] waiting to start next loop 09:28:29 [API] Update API starting 09:28:30 [MAIN] waiting to start next loop 09:28:35 [API] Update API starting 09:28:35 [MAIN] waiting to start next loop 09:28:40 [API] Update API starting 09:28:40 [MAIN] waiting to start next loop 09:28:45 [API] Update API starting 09:28:45 [MAIN] waiting to start next loop 09:28:50 [API] Update API starting 09:28:50 [MAIN] waiting to start next loop 09:28:56 [API] Update API starting 09:28:56 [MAIN] waiting to start next loop 09:29:01 [API] Update API starting 09:29:01 [MAIN] waiting to start next loop 09:29:06 [API] Update API starting 09:29:06 [Internet IP] Check Internet IP started 09:29:06 [Internet IP] - Retrieving Internet IP 09:29:06 [Internet IP] IP: 0.0.0.0 09:29:06 [Internet IP] Retrieving previous IP: 09:29:06 [Internet IP] 0.0.0.0 09:29:06 [Internet IP] No changes to perform 09:29:06 [DDNS] Skipping Dynamic DNS update 09:29:06 [Process Scan] Processing scan results 09:29:07 [Process Scan] Print Stats 09:29:07 [Scan Stats] Devices Detected.......: 0 09:29:07 [Scan Stats] arp-scan detected..: 0 09:29:07 [Scan Stats] Pi-hole detected...: +0 09:29:07 [Scan Stats] New Devices........: 0 09:29:07 [Scan Stats] Devices in this cycle..: 0 09:29:07 [Scan Stats] Down Alerts........: 0 09:29:07 [Scan Stats] New Down Alerts....: 0 09:29:07 [Scan Stats] New Connections....: 0 09:29:07 [Scan Stats] Disconnections.....: 0 09:29:07 [Scan Stats] IP Changes.........: 0 09:29:07 [Process Scan] Stats end 09:29:07 [Process Scan] Updating DB Info 09:29:07 [Process Scan] Sessions Events (connect / discconnect) 09:29:07 [Process Scan] Creating new devices 09:29:07 [Process Scan] Updating Devices Info 09:29:07 [Process Scan] Resolve devices names 09:29:07 [Process Scan] Voiding false (ghost) disconnections 09:29:07 [Process Scan] Pairing session events (connection / disconnection) 09:29:07 [Process Scan] Creating sessions snapshot 09:29:07 [Process Scan] Inserting scan results into Online_History 09:29:07 [Process Scan] Skipping repeated notifications 09:29:07 [Skip Repeated Notifications] Skip Repeated start 09:29:07 [Skip Repeated Notifications] Skip Repeated end 09:29:07 [Notification] Check if something to report 09:29:07 [Notification] Open text Template 09:29:07 [Notification] Open html Template 09:29:07 [Notification] included sections: ['internet', 'new_devices', 'down_devices', 'events'] 09:29:07 [Notification] Internet sections done. 09:29:07 [Notification] New Devices sections done. 09:29:07 [Notification] Down Devices sections done. 09:29:07 [Notification] Events sections done. 09:29:07 [Notification] No changes to report 09:29:07 [Notification] Notifications changes: 0 09:29:07 [MAIN] Last action: internet_IP 09:29:07 [MAIN] cycle: 09:29:07 [MAIN] Process: Wait 09:29:12 [API] Update API starting 09:29:12 [MAIN] waiting to start next loop 09:29:17 [API] Update API starting 09:29:17 [MAIN] waiting to start next loop 09:29:23 [API] Update API starting 09:29:23 [MAIN] waiting to start next loop 09:29:28 [API] Update API starting 09:29:28 [MAIN] waiting to start next loop 09:29:33 [API] Update API starting 09:29:33 [MAIN] waiting to start next loop 09:29:38 [API] Update API starting 09:29:38 [MAIN] waiting to start next loop 09:29:44 [API] Update API starting 09:29:44 [MAIN] waiting to start next loop 09:29:49 [API] Update API starting 09:29:49 [MAIN] waiting to start next loop 09:29:54 [API] Update API starting 09:29:54 [MAIN] waiting to start next loop 09:29:59 [API] Update API starting 09:29:59 [MAIN] waiting to start next loop 09:30:05 [API] Update API starting 09:30:05 [MAIN] waiting to start next loop 09:30:10 [API] Update API starting 09:30:11
09:30:11 Permissions check (All should be True) 09:30:11 ------------------------------------------------ 09:30:11 /config/pialert.conf | READ | True 09:30:11 /config/pialert.conf | WRITE | True 09:30:11 /db/pialert.db | READ | True 09:30:11 /db/pialert.db | WRITE | True 09:30:11 ------------------------------------------------ 09:30:11 [Setup] Attempting to fix permissions. 09:30:11 [Setup] Attempting to fix permissions. 09:30:11 [Database] Opening DB 09:30:11 [upgradeDB] Re-creating Settings table 09:30:11 [upgradeDB] Re-creating Parameters table 09:30:11 [Config] reading config file 09:30:11 [Config] Plugins: Number of dynamically loaded plugins: 7 09:30:11 [Plugins] --------------------------------------------- 09:30:11 [Plugins] display_name: DHCP Leases 09:30:11 [Plugins] description: This plugin is to import devices from dhcp.leases files. 09:30:12 [Plugins] --------------------------------------------- 09:30:12 [Plugins] display_name: Rogue DHCP 09:30:12 [Plugins] description: This plugin is to use NMAP to monitor for rogue DHCP servers. 09:30:12 [Plugins] --------------------------------------------- 09:30:12 [Plugins] display_name: Services (NMAP) 09:30:12 [Plugins] description: This plugin shows all services discovered by NMAP scans. 09:30:12 [Plugins] --------------------------------------------- 09:30:12 [Plugins] display_name: SNMP discovery 09:30:12 [Plugins] description: This plugin is used to discover devices via the arp table(s) of a RFC1213 compliant router or switch. 09:30:12 [Plugins] --------------------------------------------- 09:30:12 [Plugins] display_name: Un-Discoverable Devices 09:30:12 [Plugins] description: This plugin is to import undiscoverable devices from a file. 09:30:12 [Plugins] --------------------------------------------- 09:30:12 [Plugins] display_name: UniFi import 09:30:12 [Plugins] description: This plugin is used to import devices from an UNIFI controller. 09:30:13 [Plugins] --------------------------------------------- 09:30:13 [Plugins] display_name: Website monitor 09:30:13 [Plugins] description: This plugin is to monitor status changes of services or websites. 09:30:14 [API] Update API starting 09:30:14 [API] Updating table_settings.json file in /front/api 09:30:14 [Config] Imported new config 09:30:14 [API] Update API starting 09:30:14 [API] Updating table_devices.json file in /front/api 09:30:14 [API] Updating table_nmap_scan.json file in /front/api 09:30:14 [API] Updating table_pholus_scan.json file in /front/api 09:30:14 [API] Updating table_events_pending_alert.json file in /front/api 09:30:14 [API] Updating table_plugins_events.json file in /front/api 09:30:14 [API] Updating table_plugins_history.json file in /front/api 09:30:14 [API] Updating table_plugins_objects.json file in /front/api 09:30:14 [API] Updating table_language_strings.json file in /front/api 09:30:14 [API] Updating table_custom_endpoint.json file in /front/api 09:30:14 [Internet IP] Check Internet IP started 09:30:14 [Internet IP] - Retrieving Internet IP 09:30:15 [Internet IP] IP: 0.0.0.0 09:30:15 [Internet IP] Retrieving previous IP: 09:30:15 [Internet IP] 0.0.0.0 09:30:15 [Internet IP] No changes to perform 09:30:15 [DDNS] Skipping Dynamic DNS update 09:30:15 [PholusScan] Scan: Pholus for 600s (10.0min) 09:30:15 [PholusScan] Pholus scan on [interface] eth0 [mask] 192.168.1.0/24 09:30:53 [PholusScan] Scan: Pholus SUCCESS 09:31:08 [MAIN] cycle:1 09:31:08 [Network Scan] Scan Devices: 09:31:08 [Network Scan] arp-scan start 09:31:19 [Network Scan] arp-scan ends 09:31:19 [Process Scan] Processing scan results 09:31:20 [Process Scan] Print Stats 09:31:20 [Scan Stats] Devices Detected.......: 23 09:31:20 [Scan Stats] arp-scan detected..: 21 09:31:20 [Scan Stats] Pi-hole detected...: +0 09:31:20 [Scan Stats] New Devices........: 0 09:31:20 [Scan Stats] Devices in this cycle..: 23 09:31:20 [Scan Stats] Down Alerts........: 13 09:31:20 [Scan Stats] New Down Alerts....: 1 09:31:20 [Scan Stats] New Connections....: 0 09:31:20 [Scan Stats] Disconnections.....: 2 09:31:20 [Scan Stats] IP Changes.........: 0 09:31:20 [Process Scan] Stats end 09:31:20 [Process Scan] Updating DB Info 09:31:20 [Process Scan] Sessions Events (connect / discconnect) 09:31:20 [Process Scan] Creating new devices 09:31:20 [Process Scan] Updating Devices Info 09:31:20 [Process Scan] Resolve devices names 09:31:20 [Process Scan] Voiding false (ghost) disconnections 09:31:20 [Process Scan] Pairing session events (connection / disconnection) 09:31:20 [Process Scan] Creating sessions snapshot 09:31:20 [Process Scan] Inserting scan results into Online_History 09:31:20 [Process Scan] Skipping repeated notifications 09:31:20 [Skip Repeated Notifications] Skip Repeated start 09:31:20 [Skip Repeated Notifications] Skip Repeated end 09:31:20 [Notification] Check if something to report 09:31:20 [Notification] Open text Template 09:31:20 [Notification] Open html Template 09:31:20 [Notification] included sections: ['internet', 'new_devices', 'downdevices', 'events'] 09:31:20 [Notification] Internet sections done. 09:31:20 [Notification] New Devices sections done. 09:31:20 [Notification] Down Devices sections done. 09:31:20 [Notification] Events sections done. 09:31:20 [Notification] Changes detected, sending reports 09:31:20 [Notification] Udateing API files 09:31:20 [Send API] Updating notification* files in /home/pi/pialert/front/api/ 09:31:20 [Notification] Skip email 09:31:20 [Notification] Skip Apprise 09:31:20 [Notification] Skip webhook 09:31:20 [Notification] Sending report by NTFY 09:31:21 [Notification] Skip PUSHSAFER 09:31:21 [Notification] Establishing MQTT thread 09:31:21 Connected to broker 09:31:33 Estimated delay: 450s (7.5min) 09:39:03 [Notification] Notifications changes: 0 09:39:03 [MAIN] cycle:cleanup 09:39:03 [DB Cleanup] Upkeep Database: 09:39:03 [DB Cleanup] Online_History: Delete all but keep latest 150 entries 09:39:03 [DB Cleanup] Optimize Database 09:39:03 [DB Cleanup] Events: Delete all older than 90 days 09:39:03 [DB Cleanup] Plugin Events History: Delete all older than 90 days 09:39:03 [DB Cleanup] Pholus_Scan: Delete all older than 7 days 09:39:03 [DB Cleanup] Pholus_Scan: Delete all duplicates 09:39:03 Nmap_Scan: Delete all duplicates 09:39:03 Shrink Database 09:39:04 [MAIN] Last action: cleanup 09:39:04 [MAIN] cycle: 09:39:04 [MAIN] Process: Wait 09:39:09 [API] Update API starting 09:39:09 [API] Updating table_devices.json file in /front/api 09:39:09 [API] Updating table_pholus_scan.json file in /front/api 09:39:09 [API] Updating table_custom_endpoint.json file in /front/api 09:39:09 [Internet IP] Check Internet IP started 09:39:09 [Internet IP] - Retrieving Internet IP 09:39:09 [Internet IP] IP: 0.0.0.0 09:39:09 [Internet IP] Retrieving previous IP: 09:39:09 [Internet IP] 0.0.0.0 09:39:09 [Internet IP] No changes to perform 09:39:09 [DDNS] Skipping Dynamic DNS update 09:39:09 [MAIN] cycle:1 09:39:09 [Network Scan] Scan Devices: 09:39:09 [Network Scan] arp-scan start 09:39:20 [Network Scan] arp-scan ends 09:39:20 [Process Scan] Processing scan results 09:39:21 [Process Scan] Print Stats 09:39:21 [Scan Stats] Devices Detected.......: 23 09:39:21 [Scan Stats] arp-scan detected..: 21 09:39:21 [Scan Stats] Pi-hole detected...: +0 09:39:21 [Scan Stats] New Devices........: 0 09:39:21 [Scan Stats] Devices in this cycle..: 23 09:39:21 [Scan Stats] Down Alerts........: 13 09:39:21 [Scan Stats] New Down Alerts....: 0 09:39:21 [Scan Stats] New Connections....: 0 09:39:21 [Scan Stats] Disconnections.....: 0 09:39:21 [Scan Stats] IP Changes.........: 0 09:39:21 [Process Scan] Stats end`
might be related to this error:
10:28:28 [Process Scan] Resolve devices names
Traceback (most recent call last):
File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/pi/pialert/pialert/__main__.py", line 314, in <module>
sys.exit(main())
File "/home/pi/pialert/pialert/__main__.py", line 163, in main
run_plugin_scripts(db,'schedule')
File "/home/pi/pialert/pialert/plugin.py", line 38, in run_plugin_scripts
shouldRun = schd.runScheduleCheck()
File "/home/pi/pialert/pialert/scheduler.py", line 30, in runScheduleCheck
if nowTime > self.last_next_schedule and self.last_run < self.last_next_schedule:
TypeError: can't compare offset-naive and offset-aware datetimes
Hello! This is the only error I find in the first log file. It is missing in the second log. And I can't understand her
Found the reason for restarts. This is Website Monitor. Disabled it and restarts every 2 hours stopped. Thank you!
Do you have any other plugins scheduled? I would expect all schedules to result in the same error.
Hey,
Thanks for the ongoing reporting and testing!
The schedule error is odd, because your schedule is set to be executed once an hour not once every 2 hours. Maybe the error is a fluke (it never is though, is it haha). Here is your schedule for webmon according to your config:
# WEBMON
#---------------------------
WEBMON_RUN='schedule'
WEBMON_CMD='python3 /home/pi/pialert/front/plugins/website_monitor/script.py urls={urls}'
WEBMON_RUN_SCHD='30 * * * *'
So the error/restart should appear every hour on the 30th minute.
Another odd thing - it seems like it's happening during API update - that could point to a permissions issue, e.g. another process changing permissions every ~2h on the folder that is used to output the APIs.
Oh...another thing - what about the health check in your docker compose, could you please try to disable it:
restart: on-failure:5
because you've set to restart the container if unresponsive (maybe I misunderstand - I don't use health check myself):
version: "3.9"
services:
pi.alert:
container_name: Pi.Alert
healthcheck:
test: curl -f http://localhost:17811/ || exit 1
mem_limit: 2g
cpu_shares: 768
security_opt:
- no-new-privileges:true
volumes:
- /volume1/docker/pialert/config:/home/pi/pialert/config:rw
- /volume1/docker/pialert/db:/home/pi/pialert/db:rw
- /volume1/docker/pialert/logs:/home/pi/pialert/front/log:rw
environment:
TZ: Europe/Moscow
PORT: 17811
HOST_USER_ID: 1026
HOST_USER_GID: 100
network_mode: host
restart: on-failure:5
image: jokobsk/pi.alert:latest
no reply for a week > closing for now
Describe the issue
After the last update, PiAlert constantly reboots (about once an hour). Installed on Docker NAS Synology according to MariusHosting instructions
Paste last few lines from
pialert.log
Paste your
pialert.conf
(remove personal info)Paste your
docker-compose.yml
and.env
(remove personal info)docker-compose.yml
.env
Screenshots If applicable, add screenshots to help explain your problem.