Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
In Drupal status page, I got these messages:
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. Raw request info:
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. Raw request info:
There is no "Raw request info", I do not know how should I debug it...
Website is hosted on shared Apache hosting, PHP 5.5.
Comment | File | Size | Author |
---|---|---|---|
#19 | advagg-2547367-18-server-addr-install.patch | 1.27 KB | mikeytown2 |
#10 | advagg-2547367-10-root-dir-prefix-var.patch | 1.94 KB | mikeytown2 |
#2 | advagg-2547367-2-var_export.patch | 1.49 KB | mikeytown2 |
Comments
Comment #2
mikeytown2 CreditAttribution: mikeytown2 commentedComment #3
DamienMcKennaSo it's a difference between print_r() and var_export()?
Comment #4
mikeytown2 CreditAttribution: mikeytown2 commentedprint_r doesn't tell me if its FALSE, NULL or an empty string. I'm looking over the code and I can't figure out how drupal_http_request would return nothing; at a minimum an object should have been returned.
Comment #5
mikeytown2 CreditAttribution: mikeytown2 commentedPatch was committed. Something should be there now in the latest dev.
Comment #6
Talkless CreditAttribution: Talkless commentedI have just tried dev version, info is printed now, thank you!
Now, I have to figure out why apache handles "not found", and not advagg/drupal..? But that's another story.
Comment #7
mikeytown2 CreditAttribution: mikeytown2 commentedQuote from here: #2062547-11: Better Explain "HTTP requests to advagg for css/js files are not getting through"
Same for CSS
Do you use image styles?
Comment #8
Talkless CreditAttribution: Talkless commentedYes, I use Image Styles, Picture module with picture mappings. But, how does this relate?
Comment #9
mikeytown2 CreditAttribution: mikeytown2 commentedimage styles are located in the
sites/default/files/styles/
dir;advagg is located in the
sites/default/files/advagg_css/
andsites/default/files/advagg_js/
dir.So that means that your web server configuration allows for non existing files to be created in the styles dir.
Something else I just thought about would be the ability to put the advagg dirs inside the styles dir. A little bit of a hack but would be an alternative to the current way of asking to look that the htaccess file on a per case basis.
I would make the code below an option or better yet have a dir variable that can be set, default is blank.
What's your htaccess file look like?
Comment #10
mikeytown2 CreditAttribution: mikeytown2 commentedWith this patch add this to your settings.php file
Fixing your htaccess file would be ideal, so posting it here for analysis would be the better option.
Comment #11
Talkless CreditAttribution: Talkless commentedHere's htaccess. Only thing changed should be redirecting "www.something.com" to "something.com", and at the end I have appended advagg some sort of FileMatch rules from README.txt:
Comment #12
Talkless CreditAttribution: Talkless commentedI have applied patch and settings.php changes, but still got notfound handled by apache, though path has in fact changed:
Comment #13
mikeytown2 CreditAttribution: mikeytown2 commentedhmmm that makes me wonder how on demand image generation works on your server if the styles dir is blocked. How in control are you of your web server?
Comment #14
Talkless CreditAttribution: Talkless commentedCurrently I'm playing in my virtual machine of that I have full control, though originally site is published in shared php hosting server, where I can only upload files, create subdomain and change PHP version. No fiddling with Apache configuration and such, no shell.
Now, I did some experiments:
I deleted and recreated ...../files/styles directory. Cleared site cache, reloaded page, and all images, advagg_css and advagg_js files where generated!
Then I selected some specific css file, such as this:
/sites/default/files/styles/advagg_css/css__2w7im-0vtrklLpIAPbChuN5iE4Tnu-HLNh7-260GjP8__dqEsG3AI5OFGzLO0A4QyK21d56xaqawZV62STzG9cbc__mEt5Xw4eOZJ2SgZ9wyYfLh8ee26wLZtDWQwHM-E_k_c.css?redirect_counter=1
Deleted that CSS file in styles/advagg_css directory (actually, just deleted all CSS files there), and after entering that URL into browser, it got generated! (with .gz version also).
But, if I request for /sites/default/files/styles/advagg_css/css__1441212894.css file, it's not being generated, returning that "not found" Apache page.
Maybe it's something wrong with that test-css file generation?
Comment #15
Talkless CreditAttribution: Talkless commentedSome more info:
If I disable File Cache (filecache) module, or more precisely, if I comment-out these settings.php lines:
I get these 404 errors in status page only once after clearing cache. If I reload /admin/reports/status later, there are no ore errors.
Then again, if I make File Cache module fully working, 404 errors reappear on every /admin/reports/status reload.
Also, here's line during status page reload form Apache error log:
Path /var/www/sites is invalid, it should be at least /var/www/beta.MYSITE.com/sites
Comment #16
mikeytown2 CreditAttribution: mikeytown2 commentedWhat does
echo filecache_directory();
give you?The test file is there to make sure that drupal handles all requests to the
/sites/default/files/styles/advagg_css/
dir; I use the current time as part of the filename.Thanks for providing this info. I think the issue is the loopback request is not setting the host correctly.
What are your the server values? (feel free to scrub most of this; I'm looking for hostnames and ip's.
Comment #17
Talkless CreditAttribution: Talkless commentedfilecache_directory() gives /var/www/beta.MYSITE.com/sites/default/files/.ht.filecachearray
$_SERVDER:
Comment #19
mikeytown2 CreditAttribution: mikeytown2 commentedI think I figured this out. This patch has been committed. Let me know if this doesn't fix it.
Comment #20
mikeytown2 CreditAttribution: mikeytown2 commentedAlso committed the patch in #10
Comment #21
Talkless CreditAttribution: Talkless commentedNow, with patch #19 I get different error in status page:
No matter if Filecache is enabled or not. I do not see apache errors, only access line:
27.0.0.1 - - [12/Sep/2015:15:18:01 +0300] "GET /sites/default/files/styles/advagg_css/css__1442060272.css HTTP/1.0" 404 810 "http://beta.MYSITE.com/admin/reports/status" "Drupal (+http://drupal.org/)
I do, in fact, see "advagg_missing_fast404" inside "not found" page for css__1442060272.css.
BUT, after I deleted all advagg_css/* files, this error only occurs on first status page load after cache is cleared.
Could it be something related to the fact, that my site uses SQLite as it's database engine? Maybe it can't perform queries concurrently when performing these status page tests or something...?
EDIT: Looks like I get this error when I have installed "adminimal_admin_menu" and I can click "Flush caches" menu item while I'm in status page. Flush caches, status page reloads with "Adv CSS/JS Agg - Self Request Failure" error, but on next manual refresh status page do not show any previous errors.
Comment #22
mikeytown2 CreditAttribution: mikeytown2 commentedThanks for the feedback. Will look into this more.
Comment #23
mikeytown2 CreditAttribution: mikeytown2 commentedAccording to the documentation the error code you're getting is due to a local firewall rule.
Looked into the error of -1 which is actually 1 from stream_socket_client(); when a network error occurs, we use a negative number so it does not clash with the HTTP status codes, see drupal_http_request(). So stream_socket_client is returning a 1 which comes from the connect system call. By doing some looking around an error code of 1 usually means it can't run due to permission issues
http://www-numi.fnal.gov/offline_software/srt_public_context/WebDocs/Err...
In this case the error means "The user tried to connect to a broadcast address without having the socket broadcast flag enabled or the connection request failed because of a local firewall rule." Pretty sure your server is not a Broadcast IP address so the firewall error is whats left.
Comment #24
Talkless CreditAttribution: Talkless commentedMaybe it's sort of Virtual machine issue. I'll try your latest patch on production website, maybe it will not have this strange issue.
Generally, I thinks this bug is fixed, I just would like to try it on shared hosting site what does not belong to me.
Comment #25
mikeytown2 CreditAttribution: mikeytown2 commentedI'll mark this as fixed. Looking up the error code was something I needed to do to make sure there wasn't anything else that could be done in the advagg code.