Permission Denied App Service on Linux

Eli White 0 Reputation points
2023-12-03T02:07:56.1766667+00:00

I'm using App Service on Linux, running a PHP app, deployed with a built-in image. Recently I've started to get permission denied errors on a cache file, despite the app having correct permissions on the file. I can see (via SSH) that permissions are correct and am able to read other files with the same permissions, but still get permission denied even from SSH. This is fixed once I restart the app, but happens again when my app writes to the file. I'm assuming that something about the way my app is accessing the file that causes some sort of "corruption", but still seems like it shouldn't be possible and may be some bug in the filesystem (which I think is backed by Azure storage in this case).

From below, you can see same permissions for 5f190375efaf356aea1d2f87f7e68480.json.php and ffbf9574943e1e338bd0f46e0faf6178.yaml.php, but reading 5f190375efaf356aea1d2f87f7e68480.json.php fails.

root@...:/home/site/wwwroot/cache/compiled/files# ls -la 5f190375efaf356aea1d2f87f7e68480.json.php
-rwxrwxrwx 1 root root 7113 Dec  2 02:43 5f190375efaf356aea1d2f87f7e68480.json.php

root@...:/home/site/wwwroot/cache/compiled/files# ls -la ffbf9574943e1e338bd0f46e0faf6178.yaml.php
-rwxrwxrwx 1 root root 301 Dec  2 02:38 ffbf9574943e1e338bd0f46e0faf6178.yaml.php

root@...:/home/site/wwwroot/cache/compiled/files# cat /home/site/wwwroot/cache/compiled/files/5f190375efaf356aea1d2f87f7e68480.json.php
cat: /home/site/wwwroot/cache/compiled/files/5f190375efaf356aea1d2f87f7e68480.json.php: Permission denied

root@...:/home/site/wwwroot/cache/compiled/files# cat /home/site/wwwroot/cache/compiled/files/ffbf9574943e1e338bd0f46e0faf6178.yaml.php
 'Grav\\Common\\File\\CompiledYamlFile',
    'filename' => '/home/site/wwwroot/user/plugins/error/error.yaml',
    'modified' => 1676947551,
    'size' => 38,
    'data' => [
        'enabled' => true,
        'routes' => [
            404 => '/error'
        ]
    ]
];
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,940 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.