I woke up to this error this morning. Running Drupal 7.56 and AdvAgg 7.x-2.25 and also using Cloudflare.

What are my steps to debug and fix this? This issue has been discussed before at

https://www.drupal.org/node/1997870 and https://www.drupal.org/node/1951180

Adv CSS/JS Agg - HTTP Request	HTTP requests to advagg for js files are not getting through.
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 is missing as something else is handling the 404 before AdvAgg has a chance to do it. If you are reading this, it means that something else is handling the 404 before AdvAgg can. In some cases this can sometimes be a false report; go here: /files/advagg_js/js__1499944956.js and check if the source (press ctrl+u on your keyboard) has an html comment that says "advagg_missing_fast404"; if it does, this is a false report, add this $conf['advagg_skip_404_check'] = TRUE; to your settings.php file. Raw request info:

stdClass::__set_state(array(
   'request' => 'GET /sites/..../files/advagg_js/js__1499944956.js HTTP/1.0
Connection: close
Referer: http://...../admin/reports/status
User-Agent: Drupal (+http://..../)
Host: www.dgjc.org

',
   '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/..../files/advagg_js/js__1499944956.js was not found on this server.</p>
</body></html>
',
   'protocol' => 'HTTP/1.1',
   'status_message' => 'Not Found',
   'headers' => 
  array (
    'date' => 'Thu, 13 Jul 2017 11:22:37 GMT',
    'content-type' => 'text/html; charset=iso-8859-1',
    'connection' => 'close',
    'set-cookie' => '__cfduid=dec9192603e61aa360f9e88766dec3a041499944957; expires=Fri, 13-Jul-18 11:22:37 GMT; path=/; domain=.....; HttpOnly',
    'x-frame-options' => 'SAMEORIGIN',
    'x-content-type-options' => 'nosniff',
    'cf-cache-status' => 'MISS',
    'server' => 'cloudflare-nginx',
    'cf-ray' => '37dbdd924567215c-EWR',
  ),
   'code' => '404',
   'error' => 'Not Found',
))

Comments

webservant316 created an issue. See original summary.

webservant316’s picture

Also I did this

In some cases this can sometimes be a false report; go here: ..../files/advagg_css/css__1499945620.css and check if the source (press ctrl+u on your keyboard) has an html comment that says "advagg_missing_fast404"; if it does, this is a false report, add this $conf['advagg_skip_404_check'] = TRUE; to your settings.php file.

I did this and the string "advagg_missing_fast404" is NOT present.

Also my current configuration had been running successfully for weeks, so perhaps something changed at Cloudflare?

webservant316’s picture

I logged into Cloudflare and told it to bypass caching for my domain, but the advagg error on my status page has not gone away. Perhaps the error is related to automatic updates on my server.

Yes just checked and httpd and php both updated automatically on my server last night. I am using a standard WHM / cPanel server.

Wonder what changed with the upgrade that would start to cause this problem. Updated to PHP version 5.6.31 and Apache version 2.4.25.

mikeytown2’s picture

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> makes me think its the standard Apache 404 page, but there's no way to tell if it is apache; http://ask.xmodulo.com/turn-off-server-signature-apache-web-server.html explains the configuration for exposing the info (turn on instead of off).

If this is an incorrect ErrorDocument then this issue should fix it #2886423-34: Adv CSS/JS Agg - HTTP Request in status report page

Try the patch first and if that doesn't work then you can expose the server signature to see if cloudfront is actually hitting your server.

webservant316’s picture

okay, now getting this error after installing the patch above.

Warning
	Adv CSS/JS Agg - HTTP Request	HTTP requests to advagg for js files are not getting through. The .htaccess needs to be rebuilt.
The .htaccess file generated by AdvAgg has the incorrect errordoc location. This can happen if Drush is used incorrectly or if the site has been moved to a different directory structure. If you are currently using drush this is how to access it correctly:

drush --root=/home/admin/public_html/domain.prwa.com.d7stage/ --uri=d7stage.prwa.com
Odds are you will need to fix the errordoc location. Go to the AdvAgg: Operations page and under Regenerate .htaccess files press the Recreate htaccess files button. If you wish to manually edit the file go to the sites/default/files/advagg_js/.htaccess file and make sure the following line is in there near the top and any other ErrorDocument 404 statements have been removed.

ErrorDocument 404 /index.php

The htaccess file is recreated as follows...

Options +FollowSymLinks

<IfModule mod_rewrite.c>
  RewriteEngine on
  <IfModule mod_headers.c>
    # Serve brotli compressed JS files if they exist and the client accepts br.
    RewriteCond %{HTTP:Accept-encoding} br
    RewriteCond %{REQUEST_FILENAME}\.br -s
    RewriteRule ^(.*)\.js $1\.js\.br [QSA]
    RewriteRule \.js\.br$ - [T=application/javascript,E=no-gzip:1]

    <FilesMatch "\.js\.br$">
      # Serve correct encoding type.
      Header set Content-Encoding br
      # Force proxies to cache gzipped & non-gzipped css/js files separately.
      Header append Vary Accept-Encoding
    </FilesMatch>

    # Serve gzip compressed JS files if they exist and the client accepts gzip.
    RewriteCond %{HTTP:Accept-encoding} gzip
    RewriteCond %{REQUEST_FILENAME}\.gz -s
    RewriteRule ^(.*)\.js $1\.js\.gz [QSA]
    RewriteRule \.js\.gz$ - [T=application/javascript,E=no-gzip:1]

    <FilesMatch "\.js\.gz$">
      # Serve correct encoding type.
      Header set Content-Encoding gzip
      # Force proxies to cache gzipped & non-gzipped css/js files separately.
      Header append Vary Accept-Encoding
    </FilesMatch>
  </IfModule>
</IfModule>

<FilesMatch "^js__[A-Za-z0-9-_]{43}__[A-Za-z0-9-_]{43}__[A-Za-z0-9-_]{43}.js(\.gz|\.br)?">
  # No mod_headers. Apache module headers is not enabled.
  <IfModule !mod_headers.c>
    # No mod_expires. Apache module expires is not enabled.
    <IfModule !mod_expires.c>
      # Use ETags.
      FileETag MTime Size
    </IfModule>
  </IfModule>

  # Use Expires Directive if apache module expires is enabled.
  <IfModule mod_expires.c>
    # Do not use ETags.
    FileETag None
    # Enable expirations.
    ExpiresActive On
    # Cache all aggregated js files for 52 weeks after access (A).
    ExpiresDefault A31449600
  </IfModule>

  # Use Headers Directive if apache module headers is enabled.
  <IfModule mod_headers.c>
    # Do not use etags for cache validation.
    Header unset ETag
    # Serve correct content type.
    Header set Content-Type application/javascript
    <IfModule !mod_expires.c>
      # Set a far future Cache-Control header to 52 weeks.
      Header set Cache-Control "max-age=31449600, no-transform, public, immutable"
    </IfModule>
    <IfModule mod_expires.c>
      Header append Cache-Control "no-transform, public, immutable"
    </IfModule>
  </IfModule>
  ForceType application/javascript
</FilesMatch>

any help?

mikeytown2’s picture

Status: Active » Needs review
StatusFileSize
new393 bytes

This should fix the logic for throwing that error message on the status report page. Which means with the patch you should get the raw request info next time you hit the status report.

  • mikeytown2 committed f1cb01c on 7.x-2.x
    Issue #2894536 by mikeytown2: Fix status report logic for errordoc...
webservant316’s picture

Installed the additional patch and still getting the same error...

Adv CSS/JS Agg - HTTP Request	HTTP requests to advagg for js files are not getting through. The .htaccess needs to be rebuilt.
The .htaccess file generated by AdvAgg has the incorrect errordoc location....

Adv CSS/JS Agg - HTTP Request	HTTP requests to advagg for css files are not getting through. The .htaccess needs to be rebuilt.
The .htaccess file generated by AdvAgg has the incorrect errordoc location....

I again recreated the htaccess files on the Operations page and again there is no mention of ErrorDoc in the htaccess file. Okay how can we debug this better? What info can I provide?

Again this error started out of the blue with no changes to my codebase. The only changes was a WHM automatic update to my Apache and PHP after which this error started.

mikeytown2’s picture

Try again with this and the other patch

  • mikeytown2 committed 153a795 on 7.x-2.x
    Issue #2894536 by mikeytown2: Adv CSS/JS Agg - HTTP Request, HTTP...
webservant316’s picture

still error...

Adv CSS/JS Agg - HTTP Request	HTTP requests to advagg for js files are not getting through.
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 is missing as something else is handling the 404 before AdvAgg has a chance to do it. If you are reading this, it means that something else is handling the 404 before AdvAgg can. In some cases this can sometimes be a false report; go here: http://.../sites/default/files/advagg_js/js__1500348247.js and check if the source (press ctrl+u on your keyboard) has an html comment that says "advagg_missing_fast404"; if it does, this is a false report, add this $conf['advagg_skip_404_check'] = TRUE; to your settings.php file. Raw request info:

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

',
   '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__1500348247.js was not found on this server.</p>
</body></html>
',
   'protocol' => 'HTTP/1.1',
   'status_message' => 'Not Found',
   'headers' => 
  array (
    'date' => 'Tue, 18 Jul 2017 03:24:07 GMT',
    'server' => 'Apache',
    'x-frame-options' => 'SAMEORIGIN',
    'x-content-type-options' => 'nosniff',
    'content-length' => '245',
    'connection' => 'close',
    'content-type' => 'text/html; charset=iso-8859-1',
  ),
   'code' => '404',
   'error' => 'Not Found',
))

My browser reports this for the missing js file...

<!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__1500348544.js was not found on this server.</p>
</body></html>

I had made the changes to expose the Apache version.

mikeytown2’s picture

Ok so apache should be visible in that error message if it's the one intercepting the 404. This means that the 404 isn't hitting apache and is hitting something else in front. There's cloudfront but that should do origin pull. I'm out of ideas; something is not letting these requests hit Drupal which means that a missing file will 404 instead of being generated on demand.

webservant316’s picture

I'll create a ticket with my host and report back.

mikeytown2’s picture

Status: Needs review » Active
webservant316’s picture

WHM / cPanel updated Apache and PHP again yesterday and the errors reported above on my status page went away. That is an unsatisfying solution because we have no idea what happened and why it went away on my Drupal websites at Liquidweb and InMotion.

So to recap the above error appeared on the status page on all my Drupal sites at all my two webhosts after an automatic update to Apache and PHP. Then a second automatic update to Apache and PHP made the error on the status page go away.

Sorry about that. That is all I have for now.

mikeytown2’s picture

Status: Active » Closed (works as designed)

Sounds like a hosting issue. Not a lot AdvAgg can do other then let you know. Thanks for the update.

umeshjainb’s picture

I am facing same issue and site is broken for not being able to find agg css or js. However, if I refresh cache the issue is temporarily resolved and reappears after possibly cache expiry, This is what I have from status report

Note that I have 'Use S3 for Publuic://' checked, and 'Do not rewrite CSS or JSS path' checked. If i remove either of them, the site breaks completely.

We had this working fin but doubt if this started happening after I recently set up https redirection on the apache. Any idea how we can identify whats causing this and what can be the way out.

At present disabling Adv Agg is the only option I have

stdClass::__set_state(array(
'request' => 'GET /s3fs-public/advagg_js/js__1508377611.js HTTP/1.0
Connection: close
Referer: https://schoolconnects.in/admin/reports/status
User-Agent: Drupal (+http://drupal.org/)
Host: schoolconnects.s3.amazonaws.com

',
'data' => '<?xml version="1.0" encoding="UTF-8"?>
NoSuchKeyThe specified key does not exist.s3fs-public/advagg_js/js__1508377611.jsB6A51A00DFA815A0g/vRX9mrEhr9NurjvKQnA8+y4wJ1quF4qg7FL04vSXtOqlMD8ysBgF2aoiFdfa+PEG5xhFVfc48=',
'protocol' => 'HTTP/1.1',
'status_message' => 'Not Found',
'headers' =>
array (
'x-amz-request-id' => 'B6A51A00DFA815A0',
'x-amz-id-2' => 'g/vRX9mrEhr9NurjvKQnA8+y4wJ1quF4qg7FL04vSXtOqlMD8ysBgF2aoiFdfa+PEG5xhFVfc48=',
'content-type' => 'application/xml',
'date' => 'Thu, 19 Oct 2017 01:46:46 GMT',
'connection' => 'close',
'server' => 'AmazonS3',
),
'code' => '404',
'error' => 'Not Found',
))
Warning
Adv CSS/JS Agg - HTTP Request HTTP requests to advagg for css files are not getting through.
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 is missing as something else is handling the 404 before AdvAgg has a chance to do it. If you are reading this, it means that something else is handling the 404 before AdvAgg can. In this case the s3fs Advanced Configuration Option "Don't render proxied CSS/JS file paths" should be disabled. Raw request info:
stdClass::__set_state(array(
'request' => 'GET /s3fs-public/advagg_css/css__1508377611.css HTTP/1.0
Connection: close
Referer: https://schoolconnects.in/admin/reports/status
User-Agent: Drupal (+http://drupal.org/)
Host: schoolconnects.s3.amazonaws.com

',
'data' => '<?xml version="1.0" encoding="UTF-8"?>
NoSuchKeyThe specified key does not exist.s3fs-public/advagg_css/css__1508377611.cssA23D7629F9A681D7vjxjmDvuX7UGK0ArZixta2U1WF2mM3rrQHX47F7tPqfgweF4lKrpXXqw0SoRQv25PTgSI+Wlko0=',
'protocol' => 'HTTP/1.1',
'status_message' => 'Not Found',
'headers' =>
array (
'x-amz-request-id' => 'A23D7629F9A681D7',
'x-amz-id-2' => 'vjxjmDvuX7UGK0ArZixta2U1WF2mM3rrQHX47F7tPqfgweF4lKrpXXqw0SoRQv25PTgSI+Wlko0=',
'content-type' => 'application/xml',
'date' => 'Thu, 19 Oct 2017 01:46:45 GMT',
'connection' => 'close',
'server' => 'AmazonS3',
),
'code' => '404',
'error' => 'Not Found',
))

dmaclachlan’s picture

I'm getting this, even though I've regenerated the .htaccess files:

Odds are you will need to fix the errordoc location. Go to the AdvAgg: Operations page and under Regenerate .htaccess files press the Recreate htaccess files button. If you wish to manually edit the file go to the sites/default/files/advagg_js/.htaccess file and make sure the following line is in there near the top and any other ErrorDocument 404 statements have been removed.
ErrorDocument 404 /index.php

Any thoughts? Thanks!

mattwmc’s picture

Just happened to be me, too, out of the blue.

RickZ’s picture

Same error here! Not completely out of the blue. My HOST upgrade PHP version (without notice), used an old version 5.3 and was upgraded to 5.6.
Tried also version 7.2, same error message keeps existing!
The website itself seems ok, it's something at the back-end of the site, and is only mentioned in the statusreport, like above.
Drupal vs 7.64
Advanced CSS/JS Aggregation vs: 7.x-2.33+25-dev

I'm not that familiar with coding, if anyone can help me out, thank you!

numerabilis’s picture

I already did that patch and I getting this error.
Drupal 7.70 and PHP 7.1.

Adv CSS/JS Agg - HTTP Request HTTP requests to advagg for js files are not getting through. The .htaccess needs to be rebuilt.
The .htaccess file generated by AdvAgg has the incorrect errordoc location. This can happen if Drush is used incorrectly or if the site has been moved to a different directory structure. If you are currently using drush this is how to access it correctly:

drush --root=/home/customer/www/*******/public_html/ --uri=***********

Odds are you will need to fix the errordoc location. Go to the AdvAgg: Operations page and under Regenerate .htaccess files press the Recreate htaccess files button. If you wish to manually edit the file go to the sites/default/files/advagg_js/.htaccess file and make sure the following line is in there near the top and any other ErrorDocument 404 statements have been removed.

ErrorDocument 404 /index.php

I already did that drush thing and already regenerated .htaccess but didn´t work.
I checked inside .htaccess and "ErrorDocument 404 /index.php" wansn´t there so I inserted it but didn´t work (remained the same error) and then gave another error:

Adv CSS/JS Agg - gzip gzip is failing for css files.
The web server is not returning a 200, instead a 0 is being returned. gzip can not be tested. Raw request info:
stdClass Object
(
[url] => https://*******/sites/default/files/advagg_css/css__10ZgGCMiFqONC4n6uzU3konLymJ9Yxlk0Y2R9jzaiR4__tWt3L3BxThoyuTIqQwC6IQhMlat-O8blm1FrVpk__Lo__Ee4L-sZRgOZ35Xc3rEzl_LiiWX4kbsYwsXfvxEKzUDA.css
[status] => Done.
[code] => 0
[chunk_size] => 1024
[data] =>
[request] => GET /sites/default/files/advagg_css/css__10ZgGCMiFqONC4n6uzU3konLymJ9Yxlk0Y2R9jzaiR4__tWt3L3BxThoyuTIqQwC6IQhMlat-O8blm1FrVpk__Lo__Ee4L-sZRgOZ35Xc3rEzl_LiiWX4kbsYwsXfvxEKzUDA.css HTTP/1.1
Accept-Encoding: gzip, deflate
Connection: close
Referer: https://*******/admin/reports/status
User-Agent: Drupal (+http://drupal.org/)
Host: **********

[options] => Array
(
[headers] => Array
(
[Accept-Encoding] => gzip, deflate
[Connection] => close
[Referer] => https://***********/admin/reports/status
[User-Agent] => Drupal (+http://drupal.org/)
[Host] => licitacao.online
)

[version] => 1.1
[#advagg_path] => sites/default/files/advagg_css/css__10ZgGCMiFqONC4n6uzU3konLymJ9Yxlk0Y2R9jzaiR4__tWt3L3BxThoyuTIqQwC6IQhMlat-O8blm1FrVpk__Lo__Ee4L-sZRgOZ35Xc3rEzl_LiiWX4kbsYwsXfvxEKzUDA.css
[timeout] => 7.9843151569366
[dns_timeout] => 8
[connect_timeout] => 8
[ttfb_timeout] => 8
[method] => GET
[data] =>
[max_redirects] => 3
[context] =>
[secure_socket_transport] => ssl
[blocking] => 1
[referrer] =>
[domain_connections] => 2
[global_connections] => 128
[global_timeout] => 120
[chunk_size_read] => 32768
[chunk_size_write] => 1024
[async_connect] => 1
[ping_db] => 20
)

[socket] => ssl://*************:443
[flags] => 6
[uri] => Array
(
[scheme] => https
[host] => *************
[path] => /sites/default/files/advagg_css/css__10ZgGCMiFqONC4n6uzU3konLymJ9Yxlk0Y2R9jzaiR4__tWt3L3BxThoyuTIqQwC6IQhMlat-O8blm1FrVpk__Lo__Ee4L-sZRgOZ35Xc3rEzl_LiiWX4kbsYwsXfvxEKzUDA.css
)

[running_time] => 0.015684843063354
[fp] => Resource id #5524
[bytes_sent] => 364
)