You seem to have changed your user's primary group and hadn't logged out and back in yet.
The change to your user's primary group will not take effect under your user's current logged in session, but will take effect the next time you login with this user.
The current kernel's user credentials are not changed on-the-fly ... They are updated on new logins only(temporarily changing identity with su
or sudo
is considered a new login).
The main reason for that is that a user session is in fact made possible by and actually is a group of running processes that were(and must be) created when the user logged in and like everything else(security-wise) these processes need credentials to run and do their jobs so they inherit them from the user ... You can see how they look with for example:
ps x -o user,group,pid,command
Therefor, after changing the credentials for a logged in user, you need to end the current user session by logging out then logging in again so that the user processes under the new session will run with the new credentials.
groups deployment
, do you see thewww-data
group listed first? ... Have you just changed the primary group for that user and haven't logged out/rebooted yet since then?