File not found errors should provoke thoughts about ownership and permissions

This is part of the Semicolon&Sons Code Diary - consisting of lessons learned on the job. You're in the unix category.

Last Updated: 2022-05-26

I had a Docker nightmare debugging Project S on someone's machine. The main issue related to files not being found or noticed by Docker.

The PHP code, when copied over in the docker file, was given to the user www-data, as configured by the Dockerfile. Additionally the docker application was run as this user.

However, and here's the issue, the vendor folder (where composer packages are installed) was owned by root for some reason and did not give write permission to anyone else. Therefore the docker container was unable to install additional packages there, causing confusion.

Lesson

If you're getting "file not found" errors but you see the files, it's probably a permissions issue.