namei -l: find permissions along a path
When a process cannot open a file, the problem is often a parent directory.
namei -l /srv/app/shared/file.txt
sudo -u www-data test -r /srv/app/shared/file.txt && echo ok
Verify the result
Check execute bit on every directory in the path.