1

Or system.log in var/log is full of the following lines:

[2023-11-03T09:18:36.813475+00:00] main.CRITICAL: Requested path '_cache/merged/8ce44e6dea119fd921c2d7d8a0a9db33.min.css' is wrong. [] []
[2023-11-03T09:20:32.352668+00:00] main.ERROR: Requested path '_cache/merged/8ce44e6dea119fd921c2d7d8a0a9db33.min.css' is wrong. [] []
[2023-11-03T09:20:32.353040+00:00] main.CRITICAL: Requested path '_cache/merged/8ce44e6dea119fd921c2d7d8a0a9db33.min.css' is wrong. [] []
[2023-11-03T09:39:37.422654+00:00] main.ERROR: Requested path '_cache/merged/ad696354e4172db8cf181b2bcb1cb38d.min.css' is wrong. [] []
[2023-11-03T09:39:37.423042+00:00] main.CRITICAL: Requested path '_cache/merged/ad696354e4172db8cf181b2bcb1cb38d.min.css' is wrong. [] []
[2023-11-03T09:46:29.034079+00:00] main.ERROR: Requested path '_cache/merged/9f9f2d92cedb88ac3a868b5ecc417115.min.css' is wrong. [] []
[2023-11-03T09:46:29.034510+00:00] main.CRITICAL: Requested path '_cache/merged/9f9f2d92cedb88ac3a868b5ecc417115.min.css' is wrong. [] []
[2023-11-03T09:58:04.473543+00:00] main.ERROR: Requested path '_cache/merged/536289d868968865e89c3d8337af7a61.min.css' is wrong. [] []
[2023-11-03T09:58:04.473959+00:00] main.CRITICAL: Requested path '_cache/merged/536289d868968865e89c3d8337af7a61.min.css' is wrong. [] []
[2023-11-03T10:06:16.277563+00:00] main.ERROR: Requested path '_cache/merged/01276e2251523b00b103377eeeec41a6.min.css' is wrong. [] []
[2023-11-03T10:06:16.277965+00:00] main.CRITICAL: Requested path '_cache/merged/01276e2251523b00b103377eeeec41a6.min.css' is wrong. [] []

All 8 store views that's using Smartwave Porto theme is working perfect. We are not sure why Magento is logging this error?!

If we do a "view source" in the browser, all paths to the sites CSS is working. Also, all the 8 the sites are working as the should.

  • We use Magento 2.4.6-P3.
  • php bin/magento cache:flush/clean doesn't do the trick
  • php bin/magento setup:static-content:deploy doesn't do the trick either.
  • No other errors found anywhere in logs.

How can we get rid of all these error messages in our system.log file, or find what's causing this error?

Thanks,

--- Update ---

We have these lines in our Apache access logs (404):

217.211.1.000 - - [03/Nov/2023:11:47:32 +0100] 176 656 "GET /static/version1698421387/_cache/merged/9f9f2d92cedb88ac3a868b5ecc417115.min.css HTTP/2.0" 404 617 "-" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Mobile Safari/537.36" www.website.com 443

Can it be a cache thing? If so, how to tell the browsers not to cache these CSS-files?

1

2 Answers 2

1
+50

The error messages you are seeing in the system.log file and the 404 errors in your Apache access logs indicate that Magento is attempting to access certain CSS files in the _cache/merged directory, but it is unable to locate them. This could be due to caching issues or misconfigured static file paths. Here are some steps you can take to resolve this issue:

Verify Static Content Deployment:
Run the following command to ensure that static content is correctly deployed for your theme:

php bin/magento setup:static-content:deploy

Make sure you specify your store's locale if necessary (e.g., php bin/magento setup:static-content:deploy en_US).

Check File Permissions:
Ensure that the files in the _cache/merged directory have the correct permissions. They should be readable by the web server user.

Cache Management:
Clear and flush the Magento cache:

php bin/magento cache:clean
php bin/magento cache:flush

You can also use these commands with specific cache types (e.g., config, layout, block_html, full_page) if needed.

Check .htaccess and Apache Configuration:
Make sure your Apache server is correctly configured to handle static files. Ensure that the .htaccess file in your Magento root directory is properly configured and that Apache's mod_rewrite module is enabled.

Browser Cache:
Browsers may cache CSS files. To prevent this, you can add cache control headers in your server configuration. For example, in your Apache configuration, you can add the following lines to set the caching headers for CSS files:

<FilesMatch "\.css$">
    Header set Cache-Control "max-age=604800, public"
</FilesMatch>

This tells browsers to cache CSS files for one week (604800 seconds).

CDN Cache:
If you are using a Content Delivery Network (CDN), ensure that it is configured correctly and that it is not causing issues with caching.

Theme and Extensions:
Check if there are any theme-specific or third-party extension-related issues that might be affecting the loading of CSS files.

Magento Version and Patch Updates:
Ensure that your Magento installation is up to date with the latest patches and updates. Sometimes, known issues are resolved in newer versions.

Debugging:
If the issue persists, you can enable Magento's developer mode to get more detailed error messages. You can do this by running:

php bin/magento deploy:mode:set developer

Then, check the browser's developer console for any additional errors.

By following these steps, you should be able to resolve the issue of the incorrect path for the CSS files in your system.log and the 404 errors in your Apache access logs. If the problem persists, you may need to investigate further, possibly with the help of Magento support or experienced developers familiar with your specific setup.

2

Please restart your Varnish cache and Redis cache if you are using them. Additionally, deploy your static content on the server. It seems that your HTML content is attempting to retrieve cached data that doesn't exist. To resolve this issue, you need to clear and flush the Magento cache, Varnish cache (if in use), Redis cache (if in use), and redeploy the static content.

varnish

sudo systemctl restart varnish
sudo systemctl status varnish

OR

sudo /etc/init.d/varnish restart

Radis

redis-cli -h host -p port -a password
flushall

OR

redis-cli flushall

Magento

php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f
php bin/magento cache:clean
php bin/magento cache:flush

Note: Please check your cache-related configuration.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.