cancel
Showing results for 
Search instead for 
Did you mean: 

Error: Css file can´t be read

Error: Css file can´t be read

Hello,

 

after copy from the webserver to my local server, I have just some smaller issues:

when I try to deploy the static files, I get an error_

frontend/Magento/blank/de_AT            2444/2444           ============================ 100% %  2 mins
adminhtml/Magento/backend/de_AT         2495/2495           ============================ 100% %  2 mins
frontend/Magento/blank/de_DE            2444/2444           ============================ 100% %  1 min
frontend/Magento/blank/en_US            2444/2444           ============================ 100% %  2 mins
adminhtml/Magento/backend/de_DE         2495/2495           ============================ 100% %  2 mins
adminhtml/Magento/backend/en_US         2495/2495           ============================ 100% %  2 mins
frontend/Magento/luma/de_AT             2460/2460           ============================ 100% %  2 mins
frontend/bigone/bigone_default/de_AT    2513/2513           ============================ 100% %  3 mins
frontend/Smartwave/porto/de_AT          2361/2515           ==========================>- 93% %   2 mins
Compilation from source: /var/www/html/vendor/magento/theme-frontend-blank/web/css/styles-m.less
frontend/Magento/blank/de_AT            2444/2444           ============================ 100% %  2 mins
adminhtml/Magento/backend/de_AT         2495/2495           ============================ 100% %  2 mins
frontend/Magento/blank/de_DE            2444/2444           ============================ 100% %  1 min
frontend/Magento/blank/en_US            2444/2444           ============================ 100% %  2 mins
adminhtml/Magento/backend/de_DE         2495/2495           ============================ 100% %  2 mins
adminhtml/Magento/backend/en_US         2495/2495           ============================ 100% %  2 mins
frontend/Magento/luma/de_AT             2460/2460           ============================ 100% %  2 mins
frontend/bigone/bigone_default/de_AT    2513/2513           ============================ 100% %  3 mins
frontend/Smartwave/porto/de_AT          2365/2515           ==========================>- 94% %   2 mins
Compilation from source: /var/www/html/vendor/magento/theme-frontend-blank/web/css/styles-l.less
frontend/Magento/blank/de_AT            2444/2444           ============================ 100% %  2 mins
adminhtml/Magento/backend/de_AT         2495/2495           ============================ 100% %  2 mins
frontend/Magento/blank/de_DE            2444/2444           ============================ 100% %  1 min
frontend/Magento/blank/en_US            2444/2444           ============================ 100% %  2 mins
adminhtml/Magento/backend/de_DE         2495/2495           ============================ 100% %  2 mins
adminhtml/Magento/backend/en_US         2495/2495           ============================ 100% %  2 mins
frontend/Magento/luma/de_AT             2460/2460           ============================ 100% %  2 mins
frontend/bigone/bigone_default/de_AT    2513/2513           ============================ 100% %  3 mins
frontend/Smartwave/porto/de_AT          2509/2515           ===========================> 99% %   2 mins

In File.php line 151:

  The contents from the "/var/www/html/pub/static/frontend/Smartwave/porto/de_AT/css/styles-m.css" file can't be read. Warning!fi
  le_get_contents(/var/www/html/pub/static/frontend/Smartwave/porto/de_AT/css/styles-m.css): failed to open stream: No such file
  or directory

both css styles:

/var/www/html/vendor/magento/theme-frontend-blank/web/css/styles-m.less

/var/www/html/vendor/magento/theme-frontend-blank/web/css/styles-l.less

 

are exists ... but get this line in red.

 

And later the error in static ... but this file are generated dynamic, right?

The file "/var/www/html/pub/static/frontend/Smartwave/porto/de_AT/css/styles-m.css" will be created, right?

Or must I copy this file to this location?

 

Thank you!

 

Hannes

4 REPLIES 4

Re: Error: Css file can´t be read

Hello @hanhoe 

 Hope you are doing great!

 

You can try this Navigate to Stores -> Configuration -> Advanced -> Developer -> Template Settings and set “Allow Symlinks” to “No”.

Change Materialization Strategy in magento_root/app/etc/di.xml. Change this:

<virtualType name="developerMaterialization" type="Magento\Framework\App\View\Asset\MaterializationStrategy\Factory">
        <arguments>
            <argument name="strategiesList" xsi:type="array">
                <item name="view_preprocessed" xsi:type="object">Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink</item>
                <item name="default" xsi:type="object">Magento\Framework\App\View\Asset\MaterializationStrategy\Copy</item>
            </argument>
        </arguments>
    </virtualType>

To:

<virtualType name="developerMaterialization" type="Magento\Framework\App\View\Asset\MaterializationStrategy\Factory">
        <arguments>
            <argument name="strategiesList" xsi:type="array">
                <item name="view_preprocessed" xsi:type="object">Magento\Framework\App\View\Asset\MaterializationStrategy\Copy</item>
                <item name="default" xsi:type="object">Magento\Framework\App\View\Asset\MaterializationStrategy\Copy</item>
            </argument>
        </arguments>
    </virtualType>

Then remove the static files, flush cache and deploy static content:

From magento_root (Be careful not to remove the .htaccess files):

  1. rm -rf pub/static/adminhtml pub/static/frontend && php bin/magento cache:clean && php bin/magento cache:flush

  2. php bin/magento setup:static-content:deploy

 

If found my answer useful, Please give kudos ans Accept it as solution !

 

Thanks

Magento Developer
Ankita Biswas

Re: Error: Css file can´t be read

Hello @Ankita Biswas 

 

Thank you for your help!

 

Well, I´m not able to login in admin panel.

The log site is displaying, but when I try to login, I get this error:

1 exception(s):
Exception #0 (LogicException): Could not create an acl object: Invalid Document 
Element 'resource': The attribute 'title' is required but missing.
Line: 5

Element 'resource': The attribute 'title' is required but missing.
Line: 6

Element 'resource': The attribute 'title' is required but missing.
Line: 7

Element 'resource': The attribute 'title' is required but missing.
Line: 8


Exception #0 (LogicException): Could not create an acl object: Invalid Document 
Element 'resource': The attribute 'title' is required but missing.
Line: 5

Element 'resource': The attribute 'title' is required but missing.
Line: 6

Element 'resource': The attribute 'title' is required but missing.
Line: 7

Element 'resource': The attribute 'title' is required but missing.
Line: 8

<pre>#1 Magento\Framework\Acl\Builder\Proxy->getAcl() called at [vendor/magento/module-backend/Model/Auth/Session.php:229]
#2 Magento\Backend\Model\Auth\Session->processLogin() called at [vendor/magento/module-backend/Model/Auth.php:165]
#3 Magento\Backend\Model\Auth->login('hanhoe', '24') called at [vendor/magento/framework/Interception/Interceptor.php:58]
#4 Magento\Backend\Model\Auth\Interceptor->___callParent('login', array('hanhoe', '24')) called at [vendor/magento/framework/Interception/Interceptor.php:138]
#5 Magento\Backend\Model\Auth\Interceptor->Magento\Framework\Interception\{closure}('hanhoe', '12x12=24') called at [vendor/magento/framework/Interception/Interceptor.php:153]
#6 Magento\Backend\Model\Auth\Interceptor->___callPlugins('login', array('hanhoe', '24'), array(array('security_admin_s...'))) called at [generated/code/Magento/Backend/Model/Auth/Interceptor.php:26]
#7 Magento\Backend\Model\Auth\Interceptor->login('hanhoe', '24') called at [vendor/magento/module-backend/App/Action/Plugin/Authentication.php:205]
#8 Magento\Backend\App\Action\Plugin\Authentication->_performLogin(&Magento\Framework\App\Request\Http#000000006d860e66000000006be68c12#) called at [vendor/magento/module-backend/App/Action/Plugin/Authentication.php:157]
#9 Magento\Backend\App\Action\Plugin\Authentication->_processNotLoggedInUser(&Magento\Framework\App\Request\Http#000000006d860e66000000006be68c12#) called at [vendor/magento/module-backend/App/Action/Plugin/Authentication.php:125]
#10 Magento\Backend\App\Action\Plugin\Authentication->aroundDispatch(&Magento\Backend\Controller\Adminhtml\Index\Index\Interceptor#000000006d860c76000000006be68c12#, &Closure#000000006d860c70000000006be68c12#, &Magento\Framework\App\Request\Http#000000006d860e66000000006be68c12#) called at [vendor/magento/framework/Interception/Interceptor.php:135]
#11 Magento\Backend\Controller\Adminhtml\Index\Index\Interceptor->Magento\Framework\Interception\{closure}(&Magento\Framework\App\Request\Http#000000006d860e66000000006be68c12#) called at [vendor/magento/framework/Interception/Interceptor.php:153]
#12 Magento\Backend\Controller\Adminhtml\Index\Index\Interceptor->___callPlugins('dispatch', array(&Magento\Framework\App\Request\Http#000000006d860e66000000006be68c12#), NULL) called at [generated/code/Magento/Backend/Controller/Adminhtml/Index/Index/Interceptor.php:26]
#13 Magento\Backend\Controller\Adminhtml\Index\Index\Interceptor->dispatch(&Magento\Framework\App\Request\Http#000000006d860e66000000006be68c12#) called at [vendor/magento/framework/App/FrontController.php:159]
#14 Magento\Framework\App\FrontController->processRequest(&Magento\Framework\App\Request\Http#000000006d860e66000000006be68c12#, &Magento\Backend\Controller\Adminhtml\Index\Index\Interceptor#000000006d860c76000000006be68c12#) called at [vendor/magento/framework/App/FrontController.php:99]
#15 Magento\Framework\App\FrontController->dispatch(&Magento\Framework\App\Request\Http#000000006d860e66000000006be68c12#) called at [vendor/magento/framework/Interception/Interceptor.php:58]
#16 Magento\Framework\App\FrontController\Interceptor->___callParent('dispatch', array(&Magento\Framework\App\Request\Http#000000006d860e66000000006be68c12#)) called at [vendor/magento/framework/Interception/Interceptor.php:138]
#17 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(&Magento\Framework\App\Request\Http#000000006d860e66000000006be68c12#) called at [vendor/magento/framework/Interception/Interceptor.php:153]
#18 Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', array(&Magento\Framework\App\Request\Http#000000006d860e66000000006be68c12#), array(array('default_store_se...', 'page_cache_from_...', 'storeCookieValid...', 'install', 'configHash'))) called at [generated/code/Magento/Framework/App/FrontController/Interceptor.php:26]
#19 Magento\Framework\App\FrontController\Interceptor->dispatch(&Magento\Framework\App\Request\Http#000000006d860e66000000006be68c12#) called at [vendor/magento/framework/App/Http.php:137]
#20 Magento\Framework\App\Http->launch() called at [vendor/magento/framework/App/Bootstrap.php:261]
#21 Magento\Framework\App\Bootstrap->run(&Magento\Framework\App\Http\Interceptor#000000006d860e9a000000006be68c12#) called at [index.php:39]
</pre>

Re: Error: Css file can´t be read

Hello @hanhoe 

 

It seems like u have issue in your acl.xml file where resource acl permission issue occurs.

For now u can create new admin user using command line from SSH terminal 

 

php bin/magento admin:user:create --admin-user='new-admin' --admin-password='!admin123!' --admin-email='info@domain.com' --admin-firstname='Jon' --admin-lastname='Doe'

 

if issue solved,Click Kudos & Accept as Solution
Magento Developer
Ankita Biswas

Re: Error: Css file can´t be read

i fallowed your instruction but it did not work for me ......