I'm doing some testing with the AdvAgg and CDN modules and applied this patch https://drupal.org/node/1942230#comment-7314446 to test the setup. Everything works ok when viewing the site (http://monosnap.com/image/rx0hMIWj1ziY5GiTFGCQG7O0M) but on the status report page I get these errors:
http://monosnap.com/image/uevxim2CEs6RUXNxZWBVB10Kh
http://monosnap.com/image/ULxK5JfyMYMZrta3FrIp8Edw7
I went and checked from filesystem and there is no such files present in sites/default/files/advagg_css and advagg_js that Drupal is trying to test. Any idea what could be causing this?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sprice’s picture

I've got basically the same problem.

On the status report, I get the 404 on a path reported as something like "/sites/default/files/advagg_css/css1376292519.css"

However, none of the files that I have in that directory look anything like that. Instead, they look like this:

css__Xnx_YvKoFE3EEVqlfR6AlvMT9XmE19mYSTLVptcBdXQ__8__R8A19zEb3SlSuSpmWG-1AO3J5mgTekAy4eK6T9Z4__tH52p8_sEdn0OdPShqrvEBc_cRmygTb7EuB4PshMsrA.css

css__Xnx_YvKoFE3EEVqlfR6AlvMT9XmE19mYSTLVptcBdXQ__8__R8A19zEb3SlSuSpmWG-1AO3J5mgTekAy4eK6T9Z4__tH52p8_sEdn0OdPShqrvEBc_cRmygTb7EuB4PshMsrA.css.gz

It does seem to work on the regular pages though. Is there just a different call being done on the status page vs the regular pages?

mikeytown2’s picture

Category: bug » support

I should explain the failure of the test better in that status message.

On the status report page, AdvAgg will issue a request for a file that does not exist inside of the AdvAgg directory. If AdvAgg sends a 404, everything is ok; if something else sends a 404 then that means that AdvAgg will not be able to generate an aggregate if it's missing as something else is handling the 404 before AdvAgg has a chance to do it.

@iler
In your case it looks like Nginx is sending the 404 before AdvAgg has a chance to do it.

mikeytown2’s picture

Following patch has been committed. Will explain the failure better.

sprice’s picture

Oh. That explanations makes the problem make perfect sense now. I'm also running nginx, so my 404 rules are probably a bit too strict considering that advagg will send the 404 for me. I'll just loosen those nginx rules and let adv agg do it's thing.

mikeytown2’s picture

Status: Active » Fixed

Going to mark this as fixed. Let me know if I'm mistaken :)

mikeytown2’s picture

Title: HTTP requests to advagg for css/js files are not getting through » Better Explain "HTTP requests to advagg for css/js files are not getting through"
sprice’s picture

I fixed this error with mine. In case anyone stumbles across this thread in the future, I'll explain.

My nginx setup pretty much comes straight from Perusio's complex configuration that he made available (https://github.com/perusio/drupal-with-nginx). There are two advagg blocks in the apps/drupal/drupal.conf file, one for advagg_css and one for advagg_js. You need to remove the line try_files $uri @drupal; from those blocks because it is a directive telling nginx to see if the file exists before letting anything through.

That was it for me. Hope this helps anyone who stumbles across the thread in the future.

Status: Fixed » Closed (fixed)

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

marcialsoto’s picture

Issue summary: View changes

I get these error message but i'm on CentOS 7... (Apache)

mikeytown2’s picture

marcialsoto
Open up a new issue as a support request with the whole error message.

Talkless’s picture

I also need better explanation about this issue.

Same problem on shared hosting and on my Ubuntu 12.04 virtual machine (both Apache), and I cannot find anything in advagg documentation about configuring .htaccess or drupal or whatever, to make this 404 handling work.

In my case, status page prints these messages:

stdClass::__set_state(array(
   'request' => 'GET /sites/default/files/advagg_js/js__1440693838.js HTTP/1.0
Connection: close
Referer: http://beta.MYSITE.com/admin/reports/status
User-Agent: Drupal (+http://drupal.org/)
Host: 192.168.0.200

',
   'data' => '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /sites/default/files/advagg_js/js__1440693838.js was not found on this server.</p>
<hr>
<address>Apache/2.2.22 (Ubuntu) Server at 192.168.0.200 Port 80</address>
</body></html>
',
   'protocol' => 'HTTP/1.1',
   'status_message' => 'Not Found',
   'headers' => 
  array (
    'date' => 'Thu, 27 Aug 2015 16:44:07 GMT',
    'server' => 'Apache/2.2.22 (Ubuntu)',
    'vary' => 'Accept-Encoding',
    'content-length' => '324',
    'connection' => 'close',
    'content-type' => 'text/html; charset=iso-8859-1',
  ),
   'code' => '404',
   'error' => 'Not Found',
))

And for CSS:

stdClass::__set_state(array(
   'request' => 'GET /sites/default/files/advagg_css/css__1440693838.css HTTP/1.0
Connection: close
Referer: http://beta.MYSITE.com/admin/reports/status
User-Agent: Drupal (+http://drupal.org/)
Host: 192.168.0.200

',
   'data' => '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /sites/default/files/advagg_css/css__1440693838.css was not found on this server.</p>
<hr>
<address>Apache/2.2.22 (Ubuntu) Server at 192.168.0.200 Port 80</address>
</body></html>
',
   'protocol' => 'HTTP/1.1',
   'status_message' => 'Not Found',
   'headers' => 
  array (
    'date' => 'Thu, 27 Aug 2015 16:44:06 GMT',
    'server' => 'Apache/2.2.22 (Ubuntu)',
    'vary' => 'Accept-Encoding',
    'content-length' => '327',
    'connection' => 'close',
    'content-type' => 'text/html; charset=iso-8859-1',
  ),
   'code' => '404',
   'error' => 'Not Found',
))

And yes, if I enter beta.MYSITE.com/sites/default/files/advagg_js/js__1440693838.js into browser, I do actually get Apache generated "not found" page.

How should I and other posters could fix it?

mikeytown2’s picture

@Talkless
It depends on the server configuration; thus there is no easy answer.