Magento2: pub/static/versionxxxx Not found

Created on 19 Dec 2016  路  5Comments  路  Source: magento/magento2


Preconditions


  1. Magento 2.1.3
  2. PHP 7.0.13
  3. Apache 2.4.23

Steps to reproduce

  1. Upgrade from 2.1.2 to 2.1.3 -> composer require magento/product-community-edition 2.1.3 --no-update && composer update && rm -rf var/di var/generation && php bin/magento cache:clean && php bin/magento cache:flush && php bin/magento setup:upgrade && php bin/magento indexer:reindex

Expected result

  1. Normal upgrade

Actual result

  1. (404) pub/static/version1482183922/adminhtml/Magento/backend/es_ES/css/styles.css , pub/static/version1482183922/adminhtml/Magento/backend/es_ES/extjs/resources/css/ext-all.css Failed to load resource: the server responded with a status of 404 (Not Found) and multiples files
  2. pub/static/adminhtml/Magento/backend/es_ES/css/styles.css Found, the /version1482183922 no found

Most helpful comment

Solved: adding 'dev/static/sign' as 0 on the core_config_data table(#7820)

All 5 comments

Solved: adding 'dev/static/sign' as 0 on the core_config_data table(#7820)

I think 2.1.3 changed .htaccess/Nginx recommended config, you need this


RewriteEngine On

# Remove signature of the static files that is used to overcome the browser cache
RewriteRule ^version.+?/(.+)$ $1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l

RewriteRule .* ../static.php?resource=$0 [L]

If you are on Apache, this is from the htaccess file in pub/static and the nginx.conf.sample appears to be slightly different (not sure) but obviously Magento doesnt mention this and it isn't added on upgrade.

want to add some comments for anybody who has the same issue.

I fixed this via, i have ubuntu and apche2

ps aux | grep apache2

find the process owner of apache2

then go to base directory of magento

change the owner of this fold
chown -R magentofold
chgrp -R magentofold

then reinstall, everything works file.

Solved: adding 'dev/static/sign' as 0 on the core_config_data table(#7820)

What is this option doing?

This option disables Static Content signing. More is explained here: Magento Docs

It sure solves the problem, but the root cause is somewhere else (I have not figured out where, in my situation :/ )

This is not recommended for production environments, since it breaks caching mechanisms. When you update some JavaScript or CSS and do a static content deploy, the changes would not be visible to users unless they refresh the page without cache (Ctrl + Shift + R or Shift + F5).

Was this page helpful?
0 / 5 - 0 ratings