Running gravity resets group management client assignments

Every gravity run resets the group management client assignments to default. Need to have the selection persist a gravity run.

**Pi-hole Version**  vDev (release/v5.0, v4.3.2-391-ge0b3405) 
**Web Interface Version**  vDev (release/v5.0, v4.3.2-360-g88da85f5)  
**FTL Version**  vDev (release/v5.0, vDev-9889501)

Seen that too now.

This is probably caused by this PR, the result of a three day test session
pihole -g now uses a temporary database, to build the new gravity table. The content of the existing database is than copied over, the temporary database than becomes the live one.
I assume @DL6ER did NOT copy over all the tables, or the copy process has a bug.

I also wonder what happens if users are using the web interface, while pihole -g is running. should the database not be locked (+ warning) during pihole -g?

We do copy the respective database:

I will try to reproduce this myself now.

Hmm, yes, but it seems better to just move copy process itself further down, immediately before the swapping. Hereby, users will be able to use the database all the time and no locking happens. If they would try to add something in the exact milliseconds the swapping happens, we already show an error as the database will indeed be locked during this short time interval.

edit Reproduced. Group assignments are correctly copied and kept.

However, one of the triggers fires and adds the default group for all added clients on top of their already configured groups. This is clearly a bug and needs to be addresses. The only way to do this is to delete the triggers before copying the stuff and re-add them later again.

This is already happening so no need to change anything here.

Bugfix is on its way:

Thanks @Ronnick for reporting this and helping us make Pi-hole a better software for all of us!


The bugfix has been reviewed and merged.

1 Like


It’s working as expected now. Thanks again.

Works for me too! :+1:

Thanks for your confirmations and for helping us make Pi-hole a better software for us all!