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
Comment #2
webservant316 commentedAlso 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?
Comment #3
webservant316 commentedI 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.
Comment #4
mikeytown2 commented<!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.
Comment #5
webservant316 commentedokay, now getting this error after installing the patch above.
The htaccess file is recreated as follows...
any help?
Comment #6
mikeytown2 commentedThis 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.
Comment #8
webservant316 commentedInstalled the additional patch and still getting the same error...
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.
Comment #9
mikeytown2 commentedTry again with this and the other patch
Comment #11
webservant316 commentedstill error...
My browser reports this for the missing js file...
I had made the changes to expose the Apache version.
Comment #12
mikeytown2 commentedOk 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.
Comment #13
webservant316 commentedI'll create a ticket with my host and report back.
Comment #14
mikeytown2 commentedComment #15
webservant316 commentedWHM / 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.
Comment #16
mikeytown2 commentedSounds like a hosting issue. Not a lot AdvAgg can do other then let you know. Thanks for the update.
Comment #17
umeshjainb commentedI 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',
))
Comment #18
dmaclachlan commentedI'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!
Comment #19
mattwmc commentedJust happened to be me, too, out of the blue.
Comment #20
RickZ commentedSame 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!
Comment #21
numerabilis commentedI already did that patch and I getting this error.
Drupal 7.70 and PHP 7.1.
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: