Please try:
usermod -aG pihole www-data
I recommend flashing a fresh Raspbian image as well, but just in case you want to try upgrading your existing image, try these steps: "Unable to complete update" [occured when running pihole -up] - #6 by MichaIng
Do a full SDcard backup/clone before, in case anything fails. The upgrade process will take some hour(s).