Skip to content

Failed to open stream: Permission denied on only one module

One of our extensions give the following error message on the front page:

Warning: require_once(/var/www/html/magento2/app/code/xxxVendor/xxxModule/registration.php): failed to open stream: Permission denied in /var/www/html/magento2/app/etc/NonComposerComponentRegistration.php on line 29

Fatal error: require_once(): Failed opening required ‘/var/www/html/magento2/app/code/xxxVendor/xxxModule/registration.php’ (include_path=’/var/www/html/magento2/vendor/magento/zendframework1/library:.:/usr/share/pear:/usr/share/php’) in /var/www/html/magento2/app/etc/NonComposerComponentRegistration.php on line 29

This also happens if the module is disabled. If I rename the registration.php and have the module disabled, the error is gone.
One would think this has something to do with file permissions, but I’ve tried the recommended permissions several times, done composer update, setup update, di compile, deploy static content, cleared cache etc.

Any hints?