I have directory  /home/git/repositories with rights 770 and uid=git,gid=gituser1@gitserver:~$ ls -la /home/git/ | grep repodrwxrws--- 42 git  git  4096 Jun 30 17:02 repositoriesI have user 'www-data', which added into 'git' groupuser1@gitserver:~$ id www-datauid=33(www-data) gid=33(www-data) groups=33(www-data),1001(git)user1@gitserver:~$ id -G www-data33 1001From 'www-data' user running python-script which calling    os.listdir('/home/git/repositories')   and failing with messageOSError: [Errno 13] Permission denied: '/home/git/repositories/'def functn()    repo_dir = '/home/git/repositories'    logg('CURRENT USER: getresuid && getresgid')    logg(os.getresuid())    logg(os.getresgid())    logg('CURRENT USER: getgroups')    logg(os.getgroups())    logg(os.listdir(repo_dir))  <-- here is faultHere is output:'CURRENT USER: getresuid && getresgid'(33, 33, 33)(33, 33, 33)'CURRENT USER: getgroups'[33]                            <-- 'git' group not showing =(User 'www-data' added to git group. Why he cant list that directory?!upd here is namei -mo /home/git/repositories:user1@gitserver:~$ namei -mo /home/git/repositoriesf: /home/git/repositories drwxr-xr-x root root / drwxr-xr-x root root home drwxr-xr-x git  git  git drwxrws--- git  git  repositories
python && unix permissions (gitlab)
permissions;python
This comment was right; the web server was started before I added www-data to the git group. The web server was restarted when I rebooted for other reasons and the problem went away.