Occasional "permission denied" error when accessing files in a volume

I have a toy application built on top of ASP .NET Core, using a volume to store static files and application state. About once or twice a day, a request will fail because the application is unable to load the necessary state from the volume. The concrete error message is always something like Access to the path '/data/keys/d6587cf1-6391-4605-a26d-89194d10edcd.tmp' is denied

This is not a big deal, but I’d like to understand what is going on. I assume I have configured the filesystem properly, because otherwise all requests would fail. Is this just the flakiness that comes from using a cloud service? Or is there more to it?

These errors are sometimes deceptive. It could actually mean a file doesn’t exist. You may be getting a system code in the exception with more details.

Otherwise, it might mean some process is creating the file as root, and your app is running as a reduced privilege user. Check your Dockerfile for a line that starts with USER.

This is probably not specific to our environment, we’re not doing anything magical with disks (they’re just disks your process has access to, as if it’s running on your local machine).

Yesterday I finally found the time to look into it, and that there was indeed something wrong with file permissions. Thanks for helping me out :slight_smile: