I am using the version 7.x-2.4 and in the following page /admin/reports/status i have the below error:
The error suggest to checkthe following link:
http://:@www.testnetwork.cu.cc/sub-folder/sites/default/files/advagg_js/...
and
http://:@www.testnetwork.cu.cc/sub-folder/sites/default/files/advagg_css...
but when i go to those links i got the following:
The requested URL /sub-folder/sites/default/files/advagg_js/js__1497524159.js was not found on this server
and
The requested URL /sub-folder/sites/default/files/advagg_css/css__1497524159.css was not found on this server.
Even though i am not sure if this is a false report or no, I added the following line to my settings.php:
$conf['advagg_skip_404_check'] = TRUE;
$conf['advagg_skip_404_check'] = TRUE;
and the error gone for good,
can you please explain how to resolve this error ?
and is it safe to keep those lines in my settings.php since it seems to me that those line only prevent the error from being displayed and do not actually resolve the issue !
Thank you,
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://:@www.testnetwork.cu.cc/sub-folder/sites/default/files/advagg_js/js__1497524159.js and check if the source 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 /sub-folder/sites/default/files/advagg_js/js__1497524159.js HTTP/1.0
Connection: close
Referer: http://www.testnetwork.cu.cc/sub-folder/admin/reports/status
User-Agent: Drupal (+http://drupal.org/)
Host: www.testnetwork.cu.cc
Authorization: Basic Og==
',
'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 /sub-folder/sites/default/files/advagg_js/js__1497524159.js was not found on this server.</p>
<p>Additionally, a 404 Not Found
error was encountered while trying to use an ErrorDocument to handle the request.</p>
</body></html>
',
'protocol' => 'HTTP/1.1',
'status_message' => 'Not Found',
'headers' =>
array (
'date' => 'Thu, 15 Jun 2017 10:56:01 GMT',
'server' => 'Apache',
'strict-transport-security' => 'max-age=63072000; includeSubDomains',
'x-frame-options' => 'SAMEORIGIN',
'x-content-type-options' => 'nosniff',
'content-length' => '384',
'connection' => 'close',
'content-type' => 'text/html; charset=iso-8859-1',
),
'code' => '404',
'error' => 'Not Found',
))
Error
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 some cases this can sometimes be a false report; go here: http://:@www.testnetwork.cu.cc/sub-folder/sites/default/files/advagg_css/css__1497524159.css and check if the source 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 /sub-folder/sites/default/files/advagg_css/css__1497524159.css HTTP/1.0
Connection: close
Referer: http://www.testnetwork.cu.cc/sub-folder/admin/reports/status
User-Agent: Drupal (+http://drupal.org/)
Host: www.testnetwork.cu.cc
Authorization: Basic Og==
',
'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 /sub-folder/sites/default/files/advagg_css/css__1497524159.css was not found on this server.</p>
<p>Additionally, a 404 Not Found
error was encountered while trying to use an ErrorDocument to handle the request.</p>
</body></html>
',
'protocol' => 'HTTP/1.1',
'status_message' => 'Not Found',
'headers' =>
array (
'date' => 'Thu, 15 Jun 2017 10:56:01 GMT',
'server' => 'Apache',
'strict-transport-security' => 'max-age=63072000; includeSubDomains',
'x-frame-options' => 'SAMEORIGIN',
'x-content-type-options' => 'nosniff',
'content-length' => '387',
'connection' => 'close',
'content-type' => 'text/html; charset=iso-8859-1',
),
'code' => '404',
'error' => 'Not Found',
))
Comment | File | Size | Author |
---|---|---|---|
#35 | advagg-2886423-34-check-errordoc-htaccess.patch | 6.77 KB | mikeytown2 |
#31 | advagg-2886423-31-force-set-globals-base-path.patch | 4.3 KB | mikeytown2 |
| |||
#8 | Source Code of the first image.PNG | 20.66 KB | C.E.A |
#8 | After Clicking on the link.PNG | 14.92 KB | C.E.A |
#3 | advagg-2886423-3-clearer-view-source-directions.patch | 3.58 KB | mikeytown2 |
|
Comments
Comment #2
mikeytown2 CreditAttribution: mikeytown2 commentedView the HTML source code for "advagg_missing_fast404"
https://www.computerhope.com/issues/ch000746.htm
Comment #3
mikeytown2 CreditAttribution: mikeytown2 commentedI've modified the instructions by adding this "(press ctrl+u on your keyboard)". Let me know if this is still not clear, and what parts are not clear so I can give better directions.
Comment #5
C.E.A CreditAttribution: C.E.A commentedYou understand me wrong !
I know how to view the page source !!!
The error display the following:
However, when i go to http://:@www.testnetwork.cu.cc/sub-folder/sites/default/files/advagg_js/... , the page is not found and so i cannot check if the source has an html comment that says "advagg_missing_fast404" or no !
What should i do ?
Comment #6
mikeytown2 CreditAttribution: mikeytown2 commentedOn most 404 pages you can view the source. Try on this page as an example
https://www.google.com/asdfasdfasdfasdfsdf
We want the check the source of the 404 page to see if AdvAgg generated it.
Comment #7
mikeytown2 CreditAttribution: mikeytown2 commentedThinking I could use the w3 validator to view the source like so
https://validator.w3.org/check?uri={URL}&ss=1&No200=1#source
https://validator.w3.org/nu/?doc={URL}&checkerrorpages=yes&showsource=yes#source
If you fill in {URL} with http://...YOUR SITE.../sites/default/files/advagg_css/css__1497524159.css does advagg_missing_fast404 show up in the source section of the above pages?
Or do you get
Like what AdvAgg is reporting?
Comment #8
C.E.A CreditAttribution: C.E.A commentedHi again,
to better understand what is going on please find the attached pictures:
1) I went to following page /admin/reports/status
2) The above explained error appear.
3) The error description suggest to check the following link:
http://www.testnetwork.cu.cc/tabarja-kfaryassine/sites/default/files/advagg_js/js__1497626912.js
and
http://www.testnetwork.cu.cc/tabarja-kfaryassine/sites/default/files/advagg_css/css__1497626912.css
4) After clicking on any of the above links, the following is displayed:
5) While i am on the Not found page, Hit Ctrl + u and the following is displayed:
6) Follow the below link to find the results of w3 validator you suggested.
http://validator.w3.org/check?uri=http%3A%2F%2Fwww.testnetwork.cu.cc%2Ftabarja-kfaryassine%2Fsites%2Fdefault%2Ffiles%2Fadvagg_js%2Fjs__1497626912.js;ss=1;No200=1
Thank you,
Comment #9
mikeytown2 CreditAttribution: mikeytown2 commentedYou have a problem with your Apache configuration. This might help you out https://stackoverflow.com/questions/12760351/getting-404-not-found-error...
What's the core .htaccess look like and the one located at /tabarja-kfaryassine/sites/default/files/advagg_js/.htaccess
Comment #10
mikeytown2 CreditAttribution: mikeytown2 commentedComment #11
C.E.A CreditAttribution: C.E.A commentedHi again,
Please find below:
My core .htaccess (my-domain/.htacess):
The /tabarja-kfaryassine/sites/default/files/advagg_js/.htaccess
Thank you,
Comment #12
mikeytown2 CreditAttribution: mikeytown2 commentedAt the top of the
/tabarja-kfaryassine/sites/default/files/advagg_js/.htaccess
and
/tabarja-kfaryassine/sites/default/files/advagg_css/.htaccess
files but right below
Options +FollowSymLinks
Try adding this
ErrorDocument 404 /index.php
What version of Apache are you using?
Comment #13
JamesOakleyI'm confused. This issue is referenced in the release notes for 7.x-2.25 (as a new feature), but it's still active and nothing's been committed yet. Could someone explain how this was introduced in 7.x-2.25?
Comment #14
mikeytown2 CreditAttribution: mikeytown2 commentedLook at comment #4. The change is a documentation/wording change. Feature being better explanation.
Comment #15
JamesOakleyAh - that makes sense.
Something in 7.x-2.25 broke one site I tried it on, but not the other (in that the page started to render with no CSS at all). The error I got in the site status report led me here, but if this issue is only about documenting issues then I'm in the wrong place.
I'll do some more digging to try and find out why my site stopped aggregating correctly with the new version, then open a separate issue (or update the relevant one).
Comment #16
C.E.A CreditAttribution: C.E.A commentedHi again and sorry for the late reply,
I tried adding the above given code in both of mentioned .htaccess files, but I still have the same problem (nothing changed as described above in comment #8).
below are information of my server:
Comment #17
mikeytown2 CreditAttribution: mikeytown2 commentedWhat happens if you remove the .htaccess file from the /advagg_css/ directory?
Steps:
Delete /tabarja-kfaryassine/sites/default/files/advagg_css/.htaccess
Check the source of http://www.testnetwork.cu.cc/tabarja-kfaryassine/sites/default/files/adv...
Comment #18
C.E.A CreditAttribution: C.E.A commentedHi again,
when i removed the .htaccess file from the /advagg_css/ directory and re-visited http://www.testnetwork.cu.cc/tabarja-kfaryassine/sites/default/files/adv...
I received the below:
And in the status report of my site:
the Adv CSS/JS Agg - HTTP Request HTTP requests to advagg for css files are not getting through. part of error has gone away but the Adv CSS/JS Agg - HTTP Request HTTP requests to advagg for js files are not getting through. still available as shown below:
And two new errors appeared:
Thank you,
Comment #19
mikeytown2 CreditAttribution: mikeytown2 commentedWhat the browser sees and what the status report says seems to be 2 different 404 messages. Can you view the source in the browser when the .htaccess file is removed?
Comment #20
C.E.A CreditAttribution: C.E.A commentedWhile the .htaccess removed as requested above, this is my page source of http://www.testnetwork.cu.cc/tabarja-kfaryassine/sites/default/files/adv...
Comment #21
C.E.A CreditAttribution: C.E.A commentedHi again and thank you for the continuous support,
The website where i am having the issue is a dev.website and located under:
/home/username/public_html/testnetwork.cu.cc/[site-name.com]/
and the error mentioned above always appear whatever i tried...
However,
When i copied the same website (files, folders & DB) to the Prod.Website located under:
/home/username/public_html/[site-name.com]/
The error just gone and and all now is working good with no error at all.
In fact, the satus report of my website is now showing the following message:
I really don't know what happened and why on my dev.website the error still appear but on my Prod.website the error completely disappear !!!
I believe that my problem has been fixed now since i care about the prod.website more than the dev.website, but i would like to know the problem behind what is happening if you have some explanation !?
NOTE:
Both prod.website and dev.website are on the same shared-server and they are 100% identical in db, files & folders.
Thank you for your cooperation and help,
Comment #22
mikeytown2 CreditAttribution: mikeytown2 commentedCan you check the Apache configuration? website in a subdir or virtual host?
Comment #23
C.E.A CreditAttribution: C.E.A commentedWhat do you mean by apache configuration ? could you be more specific please ?
The website with errors (Dev.website) is inside a subdir so its url is: my-domain.com/subdir
and
The website without errors (Prod.website) is inside the root folder so its url is: my-domain.com
Comment #24
mikeytown2 CreditAttribution: mikeytown2 commentedSo dev and prod are on the same server, just dev is in a subdir.
On your dev box what's the value of this
If it's "/" what does
output?
If it's not "/" what version of AdvAgg are you using?
Comment #25
C.E.A CreditAttribution: C.E.A commentedI am using version 7.x-2.25 and only the Advanced CSS/JS Aggregation (advagg) module is enabled.
After running the drush command drush eval 'print_r($_SERVER);':
Array
(
[MANPATH] => :/usr/local/easy/share/man
[HOSTNAME] => my-host-name
[SHELL] => /bin/bash
[TERM] => xterm
[HISTSIZE] => 1000
[PERL5LIB] => /home/username/perl5/lib/perl5
[PERL_MB_OPT] => --install_base "/home/usernameperl5"
[USER] => username
[LS_COLORS] => rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:
[COLUMNS] => 80
[PATH] => /usr/local/jdk/bin:/home/username/perl5/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/cpanel/composer/bin:/usr/local/easy/bin:/usr/local/bin:/usr/X11R6/bin:/home/username/bin
[MAIL] => /var/spool/mail/username
[PWD] => /home/username/www/testnetwork.cu.cc/tabarja-kfaryassine
[JAVA_HOME] => /usr/local/jdk
[EDITOR] => pico
[HISTCONTROL] => ignoredups
[HOME] => /home/username
[SHLVL] => 1
[LS_OPTIONS] => --color=tty -F -a -b -T 0
[PERL_LOCAL_LIB_ROOT] => /home/username/perl5
[LOGNAME] => username
[VISUAL] => pico
[CLASSPATH] => .:/usr/local/jdk/lib/classes.zip
[LESSOPEN] => ||/usr/bin/lesspipe.sh %s
[HISTTIMEFORMAT] => %d/%m/%y %T username[654153] 68.235.36.118 58348 184.154.61.98 22
[G_BROKEN_FILENAMES] => 1
[PERL_MM_OPT] => INSTALL_BASE=/home/username/perl5
[PHP_SELF] => /index.php
[SCRIPT_NAME] => /index.php
[SCRIPT_FILENAME] => /home/username/public_html/testnetwork.cu.cc/tabarja-kfaryassine/index.php
[PATH_TRANSLATED] => /home/username/drush/drush.php
[DOCUMENT_ROOT] =>
[REQUEST_TIME_FLOAT] => 1498510383.2332
[REQUEST_TIME] => 1498510383
[argv] => Array
(
[0] => /home/username/drush/drush.php
[1] => --php=/usr/bin/php-cli
[2] => --php-options=
[3] => eval
[4] => print_r($_SERVER);
)
[argc] => 5
[HTTP_HOST] => default
[SERVER_PORT] =>
[REQUEST_URI] => /
[REMOTE_ADDR] => 127.0.0.1
[REQUEST_METHOD] =>
[SERVER_SOFTWARE] =>
[HTTP_USER_AGENT] =>
[HTTP_REFERER] =>
[SERVER_PROTOCOL] => HTTP/1.0
)
and running the drush command drush eval 'echo $GLOBALS['base_path'];':
gives no output at all.
UPDATE:
Yes, both dev and prod are on the same server, just dev is in a subdir and both using different domain names.
Dev website:
domain-name-1.com/subdir
Prod website:
domain-name-2.com
However dev website is an exact copy of the prod website
Comment #26
JamesOakleyBecause @mikeytown2 is suspecting the issue may be with your Apache configuration, I'm not sure you'll see much running those commands from Drush. (Drush sends them straight to PHP, and so PHP won't report your Apache environment)
Try creating a file called "test.php" in the document root that prints out those same server global variables, and then see what you get.
Comment #27
mikeytown2 CreditAttribution: mikeytown2 commentedI forgot to mention that. Create a file called test.php (or something else) and put this in it
If you're wondering what these lines are, the first 3 are copied out of the index.php file.
Comment #28
C.E.A CreditAttribution: C.E.A commentedHi again,
Here are my results of my codetest.php created file:
Comment #29
mikeytown2 CreditAttribution: mikeytown2 commentedSo $GLOBALS['base_path'] is empty; drupal_settings_initialize() should set it. That's super weird.
Can you run this?
Comment #30
C.E.A CreditAttribution: C.E.A commentedI am receiving the following:
when running:
Comment #31
mikeytown2 CreditAttribution: mikeytown2 commentedCreated a patch that will set the base_path if its not set. Looking over your drush $_SERVER and normal $_SERVER output and SCRIPT_NAME is different in that drush doesn't contain the subdir while accessing it via apache it does.
Running the advagg updates from drush if it doesn't have the correct subdir is what caused this issue most likely; the advagg .htaccess would have the wrong base_path for the ErrorDocument.
Try this patch and go to the status report page
admin/reports/status
. Delete the advagg_js/.htaccess and advagg_css/.htaccess files and hit the status report page again.Comment #32
mikeytown2 CreditAttribution: mikeytown2 commentedI think calling drush like so is how to do it correctly in your case.
Also see https://drupal.stackexchange.com/questions/125132/drush-doesnt-detect-dr...
Comment #33
C.E.A CreditAttribution: C.E.A commentedI applied your patch and delete both .htaccess files and then clean the browser and the website caches.
Now i have the below errors:
Thank you,
Comment #35
mikeytown2 CreditAttribution: mikeytown2 commentedThis patch has been committed. Go to the AdvAgg: Operations page and press the Recreate htaccess files button.
Comment #36
C.E.A CreditAttribution: C.E.A commentedI would like to confirm that applying the patch advagg-2886423-34-check-errordoc-htaccess.patchand recreared the htaccess files, all is working now !
The following patches will be included in the next release version for drupal 7 ?!
Thank you
Comment #37
mikeytown2 CreditAttribution: mikeytown2 commentedThe patch in #35 is the only one that is needed and has been committed (see comment #34). It's in the dev release currently and will be apart of the 7.x-2.26 release.
Comment #38
C.E.A CreditAttribution: C.E.A commentedComment #39
webservant316 CreditAttribution: webservant316 commenteddoes this patch fix an actual problem or a false positive error report?
Comment #40
mikeytown2 CreditAttribution: mikeytown2 commentedThis fixes an actual problem with the advagg .htaccess file's ErrorDocument 404; it can happen if the site is accessed via drush and it's a subdir site; or if you move a site from a subdir to root or root to subdir.
Comment #41
webservant316 CreditAttribution: webservant316 commentedI manually applied the patch to Advanced CSS/JS Aggregation 7.x-2.25, rebuilt the .htaccess files on the operations page and my problem did not go away. Still seeing the following...
So I went to manually edit the .htaccess file and the .htaccess file was not even there.
?
Comment #42
mikeytown2 CreditAttribution: mikeytown2 commentedWhat does this output?
Comment #43
webservant316 CreditAttribution: webservant316 commentedthat outputs 1. wow, I need to figure out why .htaccess is not created. there are no php errors or drupal errors.
Comment #44
webservant316 CreditAttribution: webservant316 commentedOops sorry. the .htaccess file is there in there in the advagg_css and advagg_js folder. However, the line "ErrorDocument 404 /index.php" is not there as the status page warning asks. The line is NOT their because of the test below in advagg.missin.inc and my base_path== '/'.
So I manually added the line "ErrorDocument 404 /index.php" in advagg_js/.htaccess and advagg_css/.htaccess and it made no difference. I still get the error....
Any other ideas?