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

Client has not been added to Clients (runtime) but it is present in DHCP #1378

Closed
ameshkov opened this issue Jan 28, 2020 · 9 comments
Closed
Assignees
Milestone

Comments

@ameshkov
Copy link
Member

ameshkov commented Jan 28, 2020

Using our test openwrt device: I am connected to the network, but I don't see myself in the Clients (runtime) section.

Additionally, check what happens if the DHCP lease has been changed.

@WildByDesign
Copy link

@ameshkov I was using DHCP in AGH on OpenWrt platform several weeks ago but had to disable the DHCP in AGH because it was causing random crashes in AGH that was crashing the entire AdGuardHome binary, thus DNS filtering and all would also cease to function.

Could this issue be part of what was causing the crashes?

I am willing to try DHCP functionality again on AGH, possibly after the next AGH beta release, and do some verbose logging to see if I can capture anything worthwhile. Should I create a new issue report?

@ameshkov
Copy link
Member Author

I doubt it is. Do you have AGH logs from one of such crashes? It'd be extremely useful

@WildByDesign
Copy link

@ameshkov While my crashes were only happening when AGH DHCP was enabled, it does not seem to be related to this issue. However, I wanted to follow up just in case this is beneficial in any way.

I could run AGH with DNS filtering for days and have zero crashes. But with AGH DHCP enabled, on OpenWrt specifically, I had dozens of random crashes. I don't have crash logs though because I have been trying to reproduce the crashes with DHCP enabled again, but no success in reproducing.

However I have narrowed it down to two possibilities:

1. NTP failing to obtain correct system time

  • On OpenWrt with AGH only DNS filtering enabled, my OpenWrt router can successfully obtain correct time from NTP servers.

  • On OpenWrt with AGH DNS filtering and DHCP enabled, my OpenWrt router fails to obtain correct time from NTP servers. I assume that it is failing to do DNS lookup on the NTP servers because when AGH has DHCP enabled, possibly it is starting a bit later in the init process now and therefore DNS lookups are failing. This leaves OpenWrt router with a System Time in the year 2026. AGH would then pull from System Time and therefore everything in AGH from filter list updates, DHCP leases, etc. all had 2026 dates consistently.

  • I have since resolved this problem on the OpenWrt router itself so that NTP is received earlier and NTP time is bypassing AGH for DNS lookups.

2. Conflicting IP Addresses

  • When starting AGH for the first time, DHCP settings receive the defaults of: lease_duration: 86400 and icmp_timeout_msec: 1000. However, during my testing several weeks ago, I found that when I would delete the entire dhcp: section from the AdGuardHome.yaml file to start with fresh settings, the dhcp: section would be recreated with new defaults of lease_duration: 0 and icmp_timeout_msec: 0 instead of the original defaults of lease_duration: 86400 and icmp_timeout_msec: 1000. Therefore when deleting the dhcp: section, it seems to recreate the two settings with incorrect defaults when compared to original settings. I tried this several times.

  • I realized that multiple devices were receiving same IP addresses.

  • I resolved the conflicting IP address issue by changing icmp_timeout_msec: 0 back to the original default of icmp_timeout_msec: 1000.

Overall:

Therefore, I assume that my dozens of random AGH crashes when DHCP was enabled likely had to do with the System Time not reaching NTP servers therefore having a System Time in the year 2026 and the issue of Conflicting IP Addresses. So my AGH crashes was likely caused by one of those issues or both combined, potentially. Anyway, it is unrelated to this issue but I wanted to follow up with you. My issues with AGH DHCP crashing randomly has been resolved by fixing the two issues that I mentioned above. No crashes since. Thank you for your time. I think that you and your dev team is doing excellent work here with AdGuardHome and excellent work with and for the community in general. Cheers!

@szolin
Copy link
Contributor

szolin commented Jan 30, 2020

@WildByDesign If AGH crashes, it usually writes information to log files - can you try to find this info in your AGH logs? Or if maybe you have some time - try to reproduce just the issue#1 once again? This way we can at least narrow it down to 1 issue, instead of 2.

@ameshkov
Copy link
Member Author

It should write it to syslog if it's installed as a service

@WildByDesign
Copy link

WildByDesign commented Jan 30, 2020

@szolin @ameshkov Part of my problem here is that I have not been able to install AGH as a service. There had been an issue specific to installing AGH as a service on OpenWrt. I know that you have fixed this issue now on master, but a beta build containing these latest OpenWrt-related fixes has not been compiled yet.

Would you guys be willing to fire up a new Beta build for testing? There is some important fixes that I am anxious to test out, particularly the OpenWrt service related.

I have not been able to compile AGH on Windows yet. I have tried WSL1 on latest Windows 10, but my Linux skills are severely lacking. It would be great one day if someone can provide some instructions on compiling AGH on Windows 10, whether its directly in Windows or WSL1 or WSL2. Thank you.

I will try to reproduce my issue # 1 in the next day or so and I will report back to you guys. Since it was several weeks ago, I don't have syslogs anymore, so I will try to reproduce it soon.

@ameshkov
Copy link
Member Author

@szolin how stable is the version from the master branch? Can we roll it to beta?

@ameshkov
Copy link
Member Author

@WildByDesign the first beta is out

@WildByDesign
Copy link

@ameshkov @szolin You guys are the best! Thank you. I will test this beta out over the weekend and I will simply open a new issue if I can reproduce the crashes. So far, I have not been able to recreate the crashes which is good news.

Have a wonderful weekend! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants