AdguardTeam / AdGuardHome

Network-wide ads & trackers blocking DNS server
https://adguard.com/adguard-home/overview.html
GNU General Public License v3.0
25.54k stars 1.83k forks source link

IPv4 DHCP attribution issue with WiFi SmartPlug #2978

Closed Black8all closed 3 years ago

Black8all commented 3 years ago

Expected Behavior

IPv4 attribution to my WiFi Smartplugs

Actual Behavior

Since the last update (v0.106.0-b.2), my WiFi smartplugs can't obtain an IPv4 from the AdGuard DHCP.

Screenshots

2021/04/19 09:11:12 [error] dhcpv4: cannot normalize hostname for 48:3f:da:51:56:9c: validating non-normalized hostname: invalid domain name label at index 0: invalid char '_' at index 3 in "ESP51569C" 2021/04/19 09:11:12 [error] dhcpv4: cannot normalize hostname for 48:3f:da:52:63:55: validating non-normalized hostname: invalid domain name label at index 0: invalid char '' at index 3 in "ESP526355" 2021/04/19 09:11:12 [error] dhcpv4: cannot normalize hostname for 48:3f:da:52:64:21: validating non-normalized hostname: invalid domain name label at index 0: invalid char '' at index 3 in "ESP526421" 2021/04/19 09:11:12 [error] dhcpv4: cannot normalize hostname for 68:c6:3a:83:9f:ac: validating non-normalized hostname: invalid domain name label at index 0: invalid char '' at index 3 in "ESP839FAC" 2021/04/19 09:11:12 [error] dhcpv4: cannot normalize hostname for c8:2b:96:c5:76:d5: validating non-normalized hostname: invalid domain name label at index 0: invalid char '' at index 3 in "ESP_C576D5"

Here's a sample of the loop in the log file.

notepad_J9I9hzCwMG

Additional Information

I tried to rollback to the previous version, (v0.105.2-beta.1) and all works again.

ainar-g commented 3 years ago

Hi, and thank you for the report. Apparently, #2952 will need to be bumped into the current release cycle. We'll try to make this work in one of the nearest betas.

ainar-g commented 3 years ago

@Black8all, we've published beta 3 recently, and in it your devices' hostnames should get normalised into something like esp-123456. Could you please update and check if the bug is fixed in that new release? Thanks!

Black8all commented 3 years ago

I tried to update to the latest beta and I have this error in my log file

2021/04/21 15:00:28 [fatal] undexpected type of dns.autohost_tld: 2021/04/21 15:01:53 [info] AdGuard Home, version v0.106.0-b.3 2021/04/21 15:01:53 [info] Upgrade yaml: 7 to 8 2021/04/21 15:01:53 [info] Upgrade yaml: 8 to 9

And I can't start AdGuard again.

Le lun. 19 avr. 2021 à 17:31, Ainar Garipov @.***> a écrit :

@Black8all https://github.com/Black8all, we've published beta 3 recently, and in it your devices' hostnames should get normalised into something like esp-123456. Could you please update and check if the bug is fixed in that new release? Thanks!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/AdguardTeam/AdGuardHome/issues/2978#issuecomment-822561642, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQCRROV5MPODTN3XBNTPVLLTJREDTANCNFSM43FTKDWQ .

ainar-g commented 3 years ago

@Black8all, hi, we've released beta 4 recently that addresses the issue. It was reported previously in #2988. Can you check if that new releases fixes the issue?

Black8all commented 3 years ago

Still have the same error when I updated to the new version v0.106.0-b.4

2021/04/21 17:47:19 [info] Restarting: [./AdGuardHome] 2021/04/21 17:47:19 [info] AdGuard Home, version v0.106.0-b.4 2021/04/21 17:47:19 [info] Upgrade yaml: 7 to 8 2021/04/21 17:47:19 [info] Upgrade yaml: 8 to 9 2021/04/21 17:47:19 [info] Upgrade yaml: 9 to 10 2021/04/21 17:47:20 [error] dhcpv4: reset: re-adding a lease for 192.168.1.7 (48:3f:da:51:56:9c): validating lease: validating hostname: invalid domain name label at index 0: invalid char '_' at index 3 in "ESP51569C" 2021/04/21 17:47:20 [error] dhcpv4: reset: re-adding a lease for 192.168.1.11 (c8:2b:96:c5:76:d5): validating lease: validating hostname: invalid domain name label at index 0: invalid char '' at index 3 in "ESPC576D5" 2021/04/21 17:47:20 [error] dhcpv4: reset: re-adding a lease for 192.168.1.12 (48:3f:da:52:64:21): validating lease: validating hostname: invalid domain name label at index 0: invalid char '' at index 3 in "ESP526421" 2021/04/21 17:47:20 [error] dhcpv4: reset: re-adding a lease for 192.168.1.13 (68:c6:3a:83:9f:ac): validating lease: validating hostname: invalid domain name label at index 0: invalid char '' at index 3 in "ESP839FAC" 2021/04/21 17:47:20 [error] dhcpv4: reset: re-adding a lease for 192.168.1.20 (54:60:09:fd:ca:94): validating lease: validating hostname: hostname exists 2021/04/21 17:47:20 [error] dhcpv4: reset: re-adding a lease for 192.168.1.24 (44:07:0b:e6:dc:e5): validating lease: validating hostname: hostname exists 2021/04/21 17:47:20 [error] dhcpv4: reset: re-adding a lease for 192.168.1.28 (54:60:09:fd:b7:40): validating lease: validating hostname: hostname exists 2021/04/21 17:47:20 [error] dhcpv4: reset: re-adding a lease for 192.168.1.9 (48:3f:da:52:63:55): validating lease: validating hostname: invalid domain name label at index 0: invalid char '' at index 3 in "ESP526355" 2021/04/21 17:47:20 [error] dhcpv4: reset: re-adding a lease for 192.168.1.18 (48:3f:da:52:5e:d8): validating lease: validating hostname: invalid domain name label at index 0: invalid char '' at index 3 in "ESP_525ED8" 2021/04/21 17:47:20 [info] dhcp: loaded leases v4:22 v6:0 total-read:22 from DB

Le mer. 21 avr. 2021 à 16:38, Ainar Garipov @.***> a écrit :

@Black8all https://github.com/Black8all, hi, we've released beta 4 recently that addresses the issue. It was reported previously in #2988 https://github.com/AdguardTeam/AdGuardHome/issues/2988. Can you check if that new releases fixes the issue?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/AdguardTeam/AdGuardHome/issues/2978#issuecomment-824113370, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQCRROVPBRD26SYYRDZMRB3TJ3PM5ANCNFSM43FTKDWQ .

ainar-g commented 3 years ago

@Black8all, this looks like messages from the code that loads leases from the filesystem. When the clients come for leases again, you should see them getting a dynamic lease with a valid hostname with no issues.

Black8all commented 3 years ago

Ok, is there any way to delete the leases in the .db before they expire?

Le mer. 21 avr. 2021 à 17:55, Ainar Garipov @.***> a écrit :

@Black8all https://github.com/Black8all, this looks like messages from the code that loads leases from the filesystem. When the clients come for leases again, you should see them getting a dynamic lease with a valid hostname with no issues.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/AdguardTeam/AdGuardHome/issues/2978#issuecomment-824172400, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQCRROUZM6PEOKEPK63XD7LTJ3YO5ANCNFSM43FTKDWQ .

ainar-g commented 3 years ago

@Black8all, it's technically unnecessary, as the new data should eventually overwrite the old one. If you do want to delete them, they are stored in the file leases.db in AGH's working directory. It's a JSON file, and the format is not stable. The leases that have "exp":1 are static, so you probably don't want to delete those.

ainar-g commented 3 years ago

We're going to close this issue for now. Feel free to open new ones if you have any problems!

Black8all commented 3 years ago

Hi, after few test, I have some trouble again with the DHCP. Some of my devices can't obtain an IP and I need to set a static lease if I want it to work.

I also encounter some of disconnection with few other. In the end, my log file are flooded by message about normalisation error.

I run now the 1.0.6.1 b1 Tell me if I need to open a new issue 😉.

Best regards

AdGuard.log