[error] [client] File does not exist:

During the regular maintenance rounds I complete for clients and their websites and servers I was completing my Regular Error Log Reviews and started seeing this error in the Apache error.log for one of the domains;

[error] [client] File does not exist:

After some investigating I found this being caused indirectly by the Apache module mod_pagespeed.  I started by doing the obvious and looking for the file it was claiming not to exist and fair enough it didn’t exist within the file system.  My next step was to see where this file was being called from.  After downloading a recent backup I ran a search for the file in question and found a reference to it in a CSS file as a background image.  So when the page was loaded a CSS style was trying to load a background image which didn’t exist but the client IP listed in the error message is and not a public IP address which seemed odd.

The fun didn’t stop there.  Now I found the cause it was time to start locating all these missing image references and removing them from the live site but soon after it stopped working…  It took me a little while to figure out that mod_pagespeed would cache files like CSS and could possibly be calling an out of date CSS file.  I simply run the command

sudo touch /var/cache/mod_pagespeed/cache.flush

and everything started working as expected.

What was actually happening was mod_pagespeed read the CSS file, pulled all the image references then started accessing the images to run its optimisation functions.  Once it came upon the missing image it added the error to the error.log file.  As part of its optimisation it also cached the CSS file which is why not all my changes were taking affect.

You can read my article An afternoon with mod_pagespeed for more first hand experience with the apache module.

So in conclusion this error was caused by some sloppy CSS coding and mod_pagespeed was just trying to do its job and reporting the problems.

No Comments