Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] Devices stopped showing in "all devices" or "connected" due to IPv6 validation failing #523

Closed
jsmith432 opened this issue Jan 1, 2024 · 14 comments
Labels
bug 🐛 Something isn't working next release/in dev image🚀 This is coming in the next release or was already released if the issue is Closed.

Comments

@jsmith432
Copy link

Devices stopped showing in "all devices" or "connected"

I am past the 100 devices, not sure if that triggered something but I cannot see the devices anymore on the devices tab.

Screenshot 2024-01-01 122628

@jokob-sk
Copy link
Owner

jokob-sk commented Jan 1, 2024

Hi @jsmith432!

Can you try to check if there are any javascript errors in the browser dev tools? General steps are described here: https://github.com/jokob-sk/Pi.Alert/blob/main/docs/DEBUG_INVALID_JSON.md

Could you please also check that accessing the API endpoint <pialert URL>/api/table_devices.json?nocache=123 shows a JSON of your devices?

Thanks,
j

@jokob-sk jokob-sk added the Waiting for reply⏳ Waiting for the original poster to respond, or discussion in progress. label Jan 1, 2024
@jsmith432
Copy link
Author

hello there again :)

Looks like IPv6 address is causing an error.
Screenshot 2024-01-01 145151

The API is returning IPV4 addresses. I tried to look for this address in the API, and it is not listed. I don't have IPv6 enabled on my router, DHCP is through pihole and IPv6 is disabled there.

Thanks

@jokob-sk
Copy link
Owner

jokob-sk commented Jan 1, 2024

Thanks for that!

I think one of the plugins is passing incorrect data to the main app (where the app expects an IP). Can you please check the plugin data returned by the plugins you enabled in the UI under Plugins?

For example for PIHOLE:

https://github.com/jokob-sk/Pi.Alert/blob/main/docs/img/DEBUG_PLUGINS/plugin_objects_pihole.png

@jsmith432
Copy link
Author

It's coming from PIHOLE. Some are IPv4, and some are IPv6 in the link to the device.

Screenshot 2024-01-01 154625

I also saw on Pihole->Tools->Network some devices have ipv4 and ipv6.

jokob-sk added a commit that referenced this issue Jan 2, 2024
@jokob-sk
Copy link
Owner

jokob-sk commented Jan 2, 2024

Thanks for that! There might be more work required to get full v6 support, but I fixed that one function. The fix can be tested in the pi.alert_dev container once this build finishes: https://github.com/jokob-sk/Pi.Alert/actions/runs/7390255497

@jsmith432
Copy link
Author

Seems that it is still erroring out.

Screenshot 2024-01-02 203839

@jokob-sk
Copy link
Owner

jokob-sk commented Jan 3, 2024

Thanks for checking @jsmith432 !

I made the ip/ipv6 check more forgiving and only logged an error in the console instead of throwing an exception. I also account for different length ipv6 addresses (the previous code didn't handle ipv4 mapped to ipv6 formats (I don't use IPv6 and this is all new to me 😅).

If you could test the pi.alert_dev image after the build finishes that would be very helpful: https://github.com/jokob-sk/Pi.Alert/actions/runs/7402871088

Thanks in advance,
j

@jokob-sk jokob-sk changed the title Devices stopped showing in "all devices" or "connected" [bug] Devices stopped showing in "all devices" or "connected" due to IP validation failing Jan 3, 2024
@jsmith432
Copy link
Author

Thank you. I can see the list of devices now. Here is the thing, though. I don't "use" ipv6. I have it disabled on my router and pi-hole. But somehow, Pi-hole is reading from the devices when they connect. I didn't research how that all works.

@jokob-sk
Copy link
Owner

jokob-sk commented Jan 4, 2024

Ah glad to hear things work again. I could probably filter out ipv6 import from PiHole but not sure if that's a desired behavior for other users. Anyway, let's see what people say after the next release and I'll adjust accordingly. Thanks for the help, I think this issue should then be solved, yes?

@jokob-sk jokob-sk added the next release/in dev image🚀 This is coming in the next release or was already released if the issue is Closed. label Jan 4, 2024
@jokob-sk jokob-sk changed the title [bug] Devices stopped showing in "all devices" or "connected" due to IP validation failing [bug] Devices stopped showing in "all devices" or "connected" due to IPv6 validation failing Jan 4, 2024
@jokob-sk jokob-sk added bug 🐛 Something isn't working and removed Waiting for reply⏳ Waiting for the original poster to respond, or discussion in progress. labels Jan 5, 2024
@eitch
Copy link

eitch commented Jan 5, 2024

I have the same issue, that the list is not showing. I just switched to the dev version and it is still not working. I have a different error in the console:

image

@jokob-sk
Copy link
Owner

jokob-sk commented Jan 5, 2024

@eitch Could you please try a different browser? The file might be cached.

@eitch
Copy link

eitch commented Jan 5, 2024

You are right! Thanks!

@Absoblogginlutely
Copy link

I can confirm I have several ipv6 devices on my network and the console was showing invalid ip address format -
Uncaught Error: Invalid IP address format
at formatIPlong (pialert_common.js:524:13)
at devices.php:755:17
at Array.map ()
at Object.success (devices.php:740:28)
at c (jquery.min.js:2:27742)
at Object.fireWith [as resolveWith] (jquery.min.js:2:28487)
at l (jquery.min.js:2:78789)
at XMLHttpRequest. (jquery.min.js:2:81117)

I was running 2023-12-21
Upgraded to 2024-01-05 and after launching in an incognito window the devices are showing up (standard browser window was caching the file (so maybe thats an additional setting to expire the page?

It is working for me now though, so thanks!

@jokob-sk
Copy link
Owner

Released -> Closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working next release/in dev image🚀 This is coming in the next release or was already released if the issue is Closed.
Projects
None yet
Development

No branches or pull requests

4 participants