Closed VThang closed 1 year ago
Hi @VThang ,
Thanks for the effort you put into describing your issue!
I've never tested setting up PiAlert through a proxy(?) such as traefik, so that might cause the issue.
To help debug the issue I'd suggest the following:
arp-scan
in the container directly and post the redacted result here. Probably these 2 commands (as you have 2 subnets) are:
sudo arp-scan --ignoredups --retry=6 192.168.1.0/24 --interface=ens18
sudo arp-scan --ignoredups --retry=6 192.168.0.0/24 --interface=ens18
ENABLE_ARPSCAN
to False
) and use PiHole as the discovery method for your devices by following the settings description/documentation on setting up PiHole. (workaround, not fixing the issue)Not sure if you are using vlans, but if yes, please read this as well.
Hope this helps.
Thanks, j
EDIT: After submitting I've noticed you've disabled traefik, can you still try to remove any unnecessary config values from the docker-compose file? Also, does the container have access to the internet?
Thank you for help.
EDIT: After submitting I've noticed you've disabled traefik, can you still try to remove any unnecessary config values from the docker-compose file? Also, does the container have access to the internet?
First time I'm trying to setup Pi-Alert, I'm using the same template of my docker and add it to Traefik reverse proxy, then add Traefik proxy label. Then i realize it not a good idea because Pi-Alert can't watch the normal network but docker network. I disable everything Traefik related to Pi-Alert, wipe all config, db, log and change to network_mode: host and expose port 20211, then use Traefik loadBalancer to http://ip:20211. So i think traefik didnt do anything with Pi-Alert. And because Pi-Alert use host network so it have internet.
arp-scan --ignoredups --retry=6 192.168.1.0/24 --interface=ens18
arp-scan --ignoredups --retry=6 192.168.0.0/24 --interface=ens18
Something wrong about my config or my firewall so Pi-Alert only see Proxmox host (everything is in proxmox), maybe my firewall or something because Pi Alert can ping anything in subnet 192.168.0.0/24 but cant scan. But i will trying fix it another time.
Try removing the traefik configuration from the container if possible (workaround, not fixing the issue)
Done
If you are using PiHole try disabling arp-scan (set ENABLE_ARPSCAN to False) and use PiHole as the discovery method for your devices by following the settings description/documentation on setting up PiHole. (workaround, not fixing the issue)
I have 2 pihole but they not in this docker machine so i can't map the pihole-FTL.db for Pi-Alert.
Not sure if you are using vlans
I'm not using VLAN
What I think is happening: arp-scan is returning a response not expected by the app and thus it is parsing it incorrectly
I think so too. When i'm trying to fix Pi-Alert cant scan subnet 192.168.0.0/24 with routing table on firewall and Debian host. Some think went wrong, and Debian host trying to get ipv6 (I disable ipv6 in my network) -> Debian host lost all connection, including my ssh session -> access Debian console, disable ipv6 -> network is fixed but the issue appear in Pi-Alert.
Thanks for the update!
I want to double-check:
1) is your issue resolved now or are you still experiencing issues after the re-deployment of the container?
If you are still facing issues, let's try to debug it further:
NMAP_ACTIVE=False
and PHOLUS_ACTIVE=False
)?LOG_LEVEL='debug'
to check if something weird doesn't show up in the logs?dig +short -x 192.168.1.50
(use a real device IP on your network) in your container?Thanks in advance! j
I think i found something interesting in log
pialert_nmap.log
...
Starting Nmap 7.80 ( https://nmap.org ) at 2023-03-23 09:27 GMT
Failed to resolve "RTNETLINK answers: Network is unreachable".
WARNING: No targets were specified, so 0 hosts scanned.
Nmap done: 0 IP addresses (0 hosts up) scanned in 0.04 seconds
Starting Nmap 7.80 ( https://nmap.org ) at 2023-03-23 11:59 GMT
Failed to resolve "RTNETLINK answers: Network is unreachable".
WARNING: No targets were specified, so 0 hosts scanned.
Nmap done: 0 IP addresses (0 hosts up) scanned in 0.04 seconds
...
pialert.log
...
[2023-03-23 09:27:25] Scan: Nmap for max 150s (2.5min) per device
Estimated max delay: 150s (2.5min)
[2023-03-23 09:27:25] Scan: Nmap SUCCESS for RTNETLINK answers: Network is unreachable (1/1)
[2023-03-23 09:27:25] Scan: Ports found by NMAP: 0
Check if something to report
Couldn't check for new release.
[API] Updating files in /front/api
Changes detected, sending reports
Skip email
Skip Apprise
Skip webhook
Skip NTFY
Skip PUSHSAFER
Skip MQTT
[2023-03-23 09:27:25] Notifications: 0
[2023-03-23 09:27:25] Last action: network_scan
[2023-03-23 09:27:25] Process: Wait
[API] Updating files in /front/api
...
[2023-03-23 11:59:22] Scan: Nmap for max 150s (2.5min) per device
Estimated max delay: 150s (2.5min)
[2023-03-23 11:59:22] Scan: Nmap SUCCESS for RTNETLINK answers: Network is unreachable (1/1)
[2023-03-23 11:59:22] Scan: Ports found by NMAP: 0
Check if something to report
Couldn't check for new release.
[API] Updating files in /front/api
Changes detected, sending reports
Skip email
Skip Apprise
Skip webhook
Skip NTFY
Skip PUSHSAFER
Skip MQTT
[2023-03-23 11:59:22] Notifications: 0
[2023-03-23 11:59:22] Last action: network_scan
[2023-03-23 11:59:22] Process: Wait
[API] Updating files in /front/api
...
Maybe NMAP scan Failed to resolve "RTNETLINK answers: Network is unreachable".
, but somehow Pi-Alert still accept that answer as success Scan: Nmap SUCCESS for RTNETLINK answers: Network is unreachable (1/1)
and write that answer to database (below is full screenshot where RTNETLINK error have Row ID, i presume Row ID is database row ID). If that so then only way to fix this issue is delete the row on database?
Thanks for that,
Can you try to execute these two commands in the container?
ip -o route get 1 | sed 's/^.*src \\([^ ]*\\).*$/\\1/;q'
/sbin/ifconfig `ip -o route get 1 | sed 's/^.*dev \\([^ ]*\\).*$/\\1/;q'` | grep ether | awk '{print $2}'
i presume Row ID is database row ID). If that so then only way to fix this issue is delete the row on database?
I think it's easier to redeploy the container with an empty DB to make sure nothing else is corrupted
ip -o route get 1 | sed 's/^.*src \\([^ ]*\\).*$/\\1/;q'
1.0.0.0 via 192.168.1.1 dev ens18 src 192.168.1.60 uid 0 \ cache
/sbin/ifconfig `ip -o route get 1 | sed 's/^.*dev \\([^ ]*\\).*$/\\1/;q'` | grep ether | awk '{print $2}'
06:07:48:5e:03:e1
I think it's easier to redeploy the container with an empty DB to make sure nothing else is corrupted
Ok. I will do that when i have time. Thank you for your support.
Thanks for the update -> closing for now
@roger- Thanks for the info!
I've implemented some safeguards for this that I hope will prevent this from happening - it's possible that the entries in your DB were stored before those safeguards were in place.
Can you report back if that happens again after you fixed your DB?
I have the same issue, after a power outage I have these kind of undeleteable entries in my device overview. Is there a way to directly delete them with in the db?
Hey @MartinKuhl ,
Try this workaround:
https://github.com/jokob-sk/Pi.Alert/issues/228#issuecomment-1546803064
Can you post the values that were incorrectly inserted? I'll try to fix the insert statement if I know what to look for.
Thanks! j
In the CSV file the wrong entries are easy to identify. The is simply RTNETLINK answers: Network is unreachable
and than a linebreak followed by several MAC addresses.
Humm, thanks, I thought I fixed this already by implementing a Mac check - will have to reopen 😓
https://github.com/jokob-sk/Pi.Alert/commit/298b5ac03e998282bad180278638076adde98d36
I hope the fix is in the release > Closing for now, will reopen if needed
Thanks! Does this fix existing bad entries or do those need to be manually removed?
Just updated and I still see some corrupt entries from before.
Hey, this will not fix existing entries. You need to clean up the DB as per https://github.com/jokob-sk/Pi.Alert/issues/228#issuecomment-1546803064
Describe the issue After some issue with network of Docker host machine. Pi alert show a device with a lot of mac address and no way to delete.
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.