I tested this module dev version many times before any RC, and it worked better, while now it needs sometimes a few page reloads and about a minute to get the CSS or JS generated and delivered instead of Drupal error 404 send, as you can see here:

https://skitch.com/omega8cc/r4156/404-not-found

https://skitch.com/omega8cc/r41hw/fullscreen

I'm using Nginx compatible configuration: https://github.com/omega8cc/nginx-for-drupal/blob/master/aegir/conf/ngin...

What am I missing?

Comments

omega8cc’s picture

Not sure if this is related, but it affects mainly sites with enabled Admin 6.x-2.0 module - all running Pressflow.

mikeytown2’s picture

My initial guess is it has to do with the caching layer I've added ontop of advagg. Looks like I'll be reworking it this week.

djbobbydrake’s picture

Subscribing

djbobbydrake’s picture

I've noticed that missing css or js file usually happens when varnish is caching a version of the file whose counter is lower than the counter for that bundle in the advagg_bundles table. This doesn't seem to be accounted for. On line 107 of advagg.missing.inc, I see this:

  if ($counter > $counter_in_db || $counter < 0) {

So if varnish serves a cached page that's looking for js_###_0.js, but that file has already been deleted from the filesystem (which may be another issue), shouldn't we generate js_###_currentcounter.js, using the current db counter? Also, the advagg_file_exists function is checking the cache to see if that file exists before it checks the actual file system. I'm wondering if we should bypass the cache and just check the file system.

mikeytown2’s picture

StatusFileSize
new998 bytes

found a possible issue; this patch has been committed. let me know if it fixes it... there is still work to be done but this might fix it.

mikeytown2’s picture

StatusFileSize
new3.12 KB

One more issue I discovered with the pressflow flavor of Drupal. This patch has been committed.

djbobbydrake’s picture

mikeytown2, you are awesome. We tested these fixes on our staging server and looks like the missing css and js files are getting redirected and regenerated properly. We're going to deploy to our live environment and will let you know if we continue to have issues in our live environment. Thanks!!

djbobbydrake’s picture

I've confirmed that this fix is also working on our live environment, where we have 5 web/varnish servers. Thanks again!

mikeytown2’s picture

Version: 6.x-1.0-rc3 » 6.x-1.x-dev
Status: Active » Fixed
StatusFileSize
new488 bytes

hitting the disk instead of the cache for this code block does make sense

  // Only process if we got an older counter.
  // If we have an out of range counter see if a simlar file exists and serve
  // that up.
  if ($counter > $counter_in_db || $counter < 0) {
     ...
  }

committed this code. Let me know if I jumped the gun and this is still an issue.

mikeytown2’s picture

StatusFileSize
new654 bytes

thinking about this more... sending a 404 is the last resort; sending a 302 for a chance for another file to get generated is a better option. I already check that the bundle is valid above so in theory this file can be generated.

Committed this code.

djbobbydrake’s picture

Just ran into a 404 again on a js file. The js file was named js_###_0.js. Looks like the file couldn't be found or redirected/regenerated. Will try upgrading to the latest dev, which has the advagg-1129656-10.patch, which we haven't yet used.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.