chrome: cannot touch '/.local/share/applications/mimeapps.list': Permission denied after volume change

Our application is hosted on AWS, after expanding the storage volume used for the instance we receive the following error from the library

[2022-08-02 13:43:07] DEBUG process: initializing [2022-08-02 13:43:07] DEBUG process: using directory: /tmp/chromium-php-alFho7 
[2022-08-02 13:43:07] DEBUG process: starting process: '/usr/bin/google-chrome' '--remote-debugging-port=0' '--disable-background-networking' '--disable-background-timer-throttling' '--disable-client-side-phishing-detection' '--disable-default-apps' '--disable-extensions' '--disable-hang-monitor' '--disable-popup-blocking' '--disable-prompt-on-repost' '--disable-sync' '--disable-translate' '--metrics-recording-only' '--no-first-run' '--safebrowsing-disable-auto-update' '--enable-automation' '--password-store=basic' '--use-mock-keychain' '--headless' '--disable-gpu' '--font-render-hinting=none' '--hide-scrollbars' '--mute-audio' '--user-data-dir=/tmp/chromium-php-alFho7' 
[2022-08-02 13:43:07] DEBUG process: waiting for 30 seconds for startup 
[2022-08-02 13:43:07] DEBUG process: chrome output:touch: cannot touch '/.local/share/applications/mimeapps.list': Permission denied 
[2022-08-02 13:43:07] DEBUG process: ignoring output:touch: cannot touch '/.local/share/applications/mimeapps.list': Permission denied 
[2022-08-02 13:43:07] DEBUG process: chrome output:Failed to move to new namespace: PID namespaces supported, Network namespace supported, but failed: errno = Operation not permitted [2022-08-02 13:43:07] DEBUG process: ignoring output:Failed to move to new namespace: PID namespaces supported, Network namespace supported, but failed: errno = Operation not permitted 
[2022-08-02 13:43:07] DEBUG process: ✗ chrome process stopped

Fatal error: Uncaught RuntimeException: Chrome process stopped before startup completed. Additional info: touch: cannot touch '/.local/share/applications/mimeapps.list': Permission denied Failed to move to new namespace: PID namespaces supported, Network namespace supported, but failed: errno = Operation not permitted [0802/134307.281828:ERROR:scoped_ptrace_attach.cc(27)] ptrace: Permission denied (13) in /var/www/html/vendor/chrome-php/chrome/src/Browser/BrowserProcess.php:400 Stack trace: #0 /var/www/html/vendor/chrome-php/chrome/src/Utils.php(57): HeadlessChromium\Browser\BrowserProcess->HeadlessChromium\Browser\{closure}(Object(Symfony\Component\Process\Process)) #1 /var/www/html/vendor/chrome-php/chrome/src/Browser/BrowserProcess.php(437): HeadlessChromium\Utils::tryWithTimeout(30000000, Object(Generator)) #2 /var/www/html/vendor/chrome-php/chrome/src/Browser/BrowserProcess.php(139): HeadlessChromium\Browser\BrowserProcess->waitForStartup(Object(Symfony\Component\Process\Process), 30000000) #3 /var/www/html/vendor/ch in /var/www/html/vendor/chrome-php/chrome/src/Browser/BrowserProcess.php on line 400

[2022-08-02 13:43:07] DEBUG process: killing chrome [2022-08-02 13:43:07] DEBUG process: cleaning temporary resources:/tmp/chromium-php-alFho7

Code used

require_once('../vendor/autoload.php');
use HeadlessChromium\BrowserFactory;
use HeadlessChromium\Page;

ini_set('memory_limit', '1024M');
set_time_limit(1800); //seconds
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
$browserFactory = new BrowserFactory('/usr/bin/google-chrome');
// starts headless chrome
$browser = $browserFactory->createBrowser([
    'debugLogger'     => 'php://output',
    'headless' => true]);
die("test");
?>

Code worked before the move. ENV settings

printenv CHROME_PATH
/usr/bin/google-chrome

reinstalling google-chrome and chrome-php does not resolve the issue.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15 (7 by maintainers)

Most upvoted comments

In attempting to identify the udev problems I stumbled across the following https://stackoverflow.com/a/65666118

This gives me alot more detail on all the problems and how to address them

Issues seem to be caused by SELinux having lost alot of config during the volume expansion. Playing whack-a-mole with sudo sealert -a /var/log/audit/audit.log has resolved the above issues