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

All DHCP Static Leases are gone after update 106 #3027

Closed
Vercety87 opened this issue Apr 28, 2021 · 10 comments
Closed

All DHCP Static Leases are gone after update 106 #3027

Vercety87 opened this issue Apr 28, 2021 · 10 comments
Assignees
Milestone

Comments

@Vercety87
Copy link

Vercety87 commented Apr 28, 2021

Issue Details

After upgrading my ADGH docker container, I loose all my DHCP Static Leases

  • **Version of AdGuard Home server: v 0.106.0
  • **How did you install AdGuard Home: Docker-compose
  • **How did you setup DNS configuration: DHCP via AdGuard Home
  • **CPU architecture: x86_64
  • **Operating system and version: Ubuntu 20.04

Expected Behavior

Find all my previous DHCP Static Leases from previous version of ADGH

Actual Behavior

No DHCP Static Leases found

Additional Information

DHCP Static Leases seams to still be in ADGH Database, logs says :

adguardhome    | 2021/04/28 20:50:59 [info] dhcp: stored 32 leases in DB
@Tloram
Copy link

Tloram commented Apr 29, 2021

Same issue here, not all, but some of my static leases seem to have been removed since the update last night to v0.106.0

Please look into this asap as this will be causing some serious problems with my local network now!

EDIT - having looked into the problem, it seems the only entries removed were ones I had entered with duplicate hostnames (so technically my own fault). I have re-added them with unique hostnames and all seems well now. Thanks.

@DavidPasch
Copy link

Same issue here ... all static DHCP leases are gone.

@ainar-g
Copy link
Contributor

ainar-g commented Apr 29, 2021

@Vercety87, @DavidPasch, thank you for your reports. We're investigating that. Can you please look into the leases.db file in AGH's workdir and tell us if there is duplicated or invalid data in the "host" fields there?

This is probably caused by #2952, and we'll probably need to release a migration for that in v0.106.1.

@ainar-g ainar-g self-assigned this Apr 29, 2021
@ainar-g ainar-g added bug P2: High waiting for data Waiting for users to provide more data. labels Apr 29, 2021
@ainar-g ainar-g added this to the v0.106.1 milestone Apr 29, 2021
@ainar-g ainar-g mentioned this issue Apr 29, 2021
3 tasks
@DavidPasch
Copy link

No duplicates but (maybe) invalid HostNames using "blank space" character in their names.

@ainar-g ainar-g removed the waiting for data Waiting for users to provide more data. label Apr 29, 2021
adguard pushed a commit that referenced this issue Apr 29, 2021
Updates #3027.

Squashed commit of the following:

commit 171ebae
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Thu Apr 29 14:45:04 2021 +0300

    all: imp docs

commit 48b13ed
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Thu Apr 29 14:34:28 2021 +0300

    dhcpd: normalize hostnames of invalid static leases
@ainar-g
Copy link
Contributor

ainar-g commented Apr 29, 2021

The fix was pushed to the edge channel in snapshot c8092fe recently. It should apply a best-effort algorithm to make previously added invalid hostnames of the static DHCP leases valid, so most of them should reappear. Can you please check if that fix works for you?

@DavidPasch
Copy link

DavidPasch commented Apr 29, 2021

Had installed AdGuard manually, not via snap. So no access to that edge cannel source. Sorry.

Updated manually leases.db from " " to "-" and it works. Update was fine. So yes, it's a "valid naming" problem.

@Vercety87
Copy link
Author

The fix was pushed to the edge channel in snapshot c8092fe recently. It should apply a best-effort algorithm to make previously added invalid hostnames of the static DHCP leases valid, so most of them should reappear. Can you please check if that fix works for you?

Hi, thanks for your help. I just tried the latest edge v0.107.0-a.5+59f48d79 but still the same problem.

I got this in logs file :

adguardhome_edge | 2021/04/29 18:08:04 [info] dhcpv4: normalized hostname "" into "192-168-0-5" adguardhome_edge | 2021/04/29 18:08:04 [info] dhcp: stored 32 leases in DB adguardhome_edge | 2021/04/29 18:08:04 [info] dhcpv4: normalized hostname "" into "192-168-0-5" adguardhome_edge | 2021/04/29 18:08:04 [info] dhcp: stored 32 leases in DB adguardhome_edge | 2021/04/29 18:09:25 [info] dhcpv4: IP conflict: 192.168.0.11 is already used by another device adguardhome_edge | 2021/04/29 18:09:25 [info] dhcpv4: IP conflict: 192.168.0.12 is already used by another device adguardhome_edge | 2021/04/29 18:09:26 [info] dhcp: stored 35 leases in DB adguardhome_edge | 2021/04/29 18:09:26 [info] dhcp: stored 35 leases in DB

I will check device name in leases.db file.

@ainar-g
Copy link
Contributor

ainar-g commented Apr 29, 2021

Thanks for testing and providing the output. The hostname migration we've implemented works well, but apparently there are also several records with the same IP address in your leases. We will have to think if we can fix that automatically.

@Vercety87
Copy link
Author

My bad I was on a bad leases.db. I just push one of my backup, into edge version and all my DHCP leases are back.
Thanks for the fix.

@ainar-g
Copy link
Contributor

ainar-g commented Apr 29, 2021

Thanks for the good news! We will release the fix with v0.106.1 in the next couple of days. I'll close this issue for now.

@ainar-g ainar-g closed this as completed Apr 29, 2021
adguard pushed a commit that referenced this issue Apr 30, 2021
Updates #3027.

Squashed commit of the following:

commit 171ebae
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Thu Apr 29 14:45:04 2021 +0300

    all: imp docs

commit 48b13ed
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Thu Apr 29 14:34:28 2021 +0300

    dhcpd: normalize hostnames of invalid static leases
heyxkhoa pushed a commit to heyxkhoa/AdGuardHome that referenced this issue Mar 20, 2023
Updates AdguardTeam#3027.

Squashed commit of the following:

commit 171ebae
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Thu Apr 29 14:45:04 2021 +0300

    all: imp docs

commit 48b13ed
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Thu Apr 29 14:34:28 2021 +0300

    dhcpd: normalize hostnames of invalid static leases
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

4 participants