cancel
Showing results for 
Search instead for 
Did you mean: 

Missing CSS after 2.0.2 upgrade

Missing CSS after 2.0.2 upgrade

I installed v2.0.1 yesterday successfully (via a Softaculous deployment on my shared hosting) and then have just gone through the process of upgrading to v2.0.2 today, which completed successfully too.

I am running on PHP7, so I applied the patch as well before the upgrade.

However, now my store doesn't seem to publish the CSS...any ideas?

screen1

UPDATE: After looking at the source code of the cache management page, and manually cut/pasting the URL's for Flush Static Files (I did all of them actually but I think it was the static files flush that fixed it) into the browser address bar, I have got the front of the site working again, however the backend is still as above.

screen2

UPDATE II - Ok, I thought I'd fixed the front end - but it just seems to have broken again, same issue. Nothing has changed, as I can't do anything in the Admin area anyway, unless I cut/paste hyperlinks to clear cache. Arggh!

 

8 REPLIES 8

Re: Missing CSS after 2.0.2 upgrade

How to fix the problem of loading css and javascript files: https://mage2.pro/t/259

Re: Missing CSS after 2.0.2 upgrade

thanks @Dmitry_Fedyuk

I have checked my directories and file system permissions and they look ok.
I checked the current mode
magento deploy:mode:show
and it came back with
Current application mode: default.

which I thought was odd.

so I issued a magento deploy:mode:set developer
however this didn't seem to make any difference.

So, I cleared down the following directories
var/cache
var/di
var/generation
var/view_preprocessed
pub/static
as listed here..http://devdocs.magento.com/guides/v2.0/config-guide/cli/config-cli-subcommands-mode.html

and did a magento deploy:mode:set production
However, because of my strange shared server setup where I have to use php-cli, instead of php, this failed

"Enabled maintenance mode
Static content deployment start
Command returned non-zero exit code:
`php -f /home/mywebsitedomain/public_html/bin/magento setup:static-content:deploy en_US 2>&1`"

which left the whole site unusable in maintenance mode!
If anyone else hits this issue - you have to delete the .maintenance.flag file in the /var/ directory
it's NOT in the root directory as was the case with Magento 1.x

 

I've got the site back out of maintenance mode but not sure what else to try Smiley Sad

Re: Missing CSS after 2.0.2 upgrade

Ok, something weird is going on, I have switched PC's and most of the issues seem to have resolved themselves, but I did numerous Chrome browser history clears and it didn't seem to make a difference.

Now it looks like I have a slightly different problem, when my Page Cache becomes invalidated I get a disjointed message at the top of the page, then get a "404" error message page at the bottom of the main page content!

cache message

404 message

Re: Missing CSS after 2.0.2 upgrade

This solves our problem

After navigating to the Magento root directory

 

1: rm -rf var/di/* var/generation/* var/cache/* var/page_cache/* var/view_preprocessed/* var/composer_home/cache/*

2: sudo chmod 777 var -R
3: sudo chmod 777 pub -R

4: sudo php bin/magento setup:static-content:deploy

5: sudo php bin/magetno setup:di:compile

6: sudo php bin/magento cache:clean

7: Repeat step 2 & 3

Re: Missing CSS after 2.0.2 upgrade

Additonal info for steps 4, 5 and 6. On my server i had to run "php-cli" instead of just "php" for the code to run correctly. Thanks for original post. Worked like a charm!

Re: Missing CSS after 2.0.2 upgrade

I needed to post this as it's still relative to the CSS issue and also affects the speed of Magento in a massive way. After using the fix included in this thread I found that although the admin screens worked and functioned correctly, the front end took over 45 seconds to load. Using developer tools in firefox i found that styles-m.css was missing from pub/static/frontend/Magento/luma/en_GB. Copying and pasting styles-m.css from pub/static/frontend/Magento/luma/en_US has fixed the issue. This is relative if you have selected the Luma theme.

Re: Missing CSS after 2.0.2 upgrade

This could be an issue with symlinks. I see that deploy.php worked for you, but you may also try deleting the resources from pub/static and seeing if the instructions fromhttp://magento.stackexchange.com/a/64808/594 work for you. If so, then it may save you some time during development as it should be faster than running deploy.php.

Re: Missing CSS after 2.0.2 upgrade

 

I ran into this issue on several Magento 2 installations in production.

Assuming you did this first from the command line.

php bin/magento setup:static-content:deploy from <magento_install_dir>

Then change file permissions to 755 on the following directories:

/pub/

/pub/static/

/pub/static/frontend/

/pub/static/adminhtml/

/pub/static/_requirejs/