14

I have a website on a lamp stack with little to no extra configuration other than FallbackResource /index.php present in my root .htaccess

When I load the root page (localhost ) in Chrome I receive

GET http://192.168.163.171/ net::ERR_INCOMPLETE_CHUNKED_ENCODING VM110:1

in the chrome console after about 10 seconds. If I attempt to follow the link at VM110:1 it takes me to the top of my inline Javascript.

More information / What I've tried

  • This does NOT occur on any other page but root
  • There are no 404's in the access log nor any other abnormal codes
  • There are no errors appearing in the apache error log.
  • The error does not occur in the latest version of IE or Firefox.
  • It caused a problem in both my local environment and hosted. The latter has absolutely no config changes and I expect to be a near default install.
  • When I remove the FallbackResource directive my page loads fine without the error

In index.php the root is treated no different than any other page.

This would all be a non-issue because everything loads properly BUT it prevents javascript relying on a finished page load from working.

Any further ideas on what is causing the problem or new things I can try? I've considered moving to just using mod_rewrite but this is much simpler.

Blaine
  • 829
  • 2
  • 9
  • 19
  • Hi i have the same problem, did u find out? – fartagaintuxedo Jun 09 '14 at 18:12
  • No sorry, I decided it wasn't a blocking issue and pretty much just ignored it. – Blaine Jun 10 '14 at 17:13
  • I think it's something to do with Chrome, but unsure. Do you have adblock? If so, turn it off and try. – craniumonempty Jul 15 '14 at 00:23
  • Yes it's a Chrome only issue. No it was a clean install of Chrome. – Blaine Jul 15 '14 at 04:23
  • Having the same problem. It's preventing some javascript from running properly on document load. It's also cause by the `FallbackResource`. Really annoying! – Juicy Jul 20 '14 at 02:01
  • I am experiencing the same. I didn't change anything on the server's config nor chrome. – mistapink Jul 30 '14 at 16:19
  • I have also faced the same issue but I am working on Java application with Tomcat 7. As read in the comments and the solution too, my issue also comes only in Chrome. Any guidance would be of great help. Thanks. – Aadil Jul 20 '16 at 07:26

4 Answers4

26

Finally found the answer while working on another site:

Before FallbackResource directive be sure to add a DirectoryIndex directive with the same file. Haven't had time to research why but it fixed my issue. I blame it on a Chrome bug or possibly Chrome being super picky because no other major browser has an issue.

Blaine
  • 829
  • 2
  • 9
  • 19
  • Thanks for posting your solution. It was a big help. – Mike Feb 22 '15 at 04:27
  • So, does anyone know why or how this might work? Is the bad behavior on Apache's side, or is it on Chrome's side? – Charles Mar 17 '16 at 21:14
  • My guess is that it's bad behaviour on Apache's side but the administrator's fault for configuring the directives wrong. Most likely the other browsers have an issue with it too, but they ignore it whereas Chrome actually says something and breaks. – Blaine Jun 14 '16 at 03:15
  • This worked for me. Thanks because it's been like that for weeks. – John the Ripper Apr 07 '17 at 14:08
2

I fixed this error by removing the following lines from my php5filter.conf file in the Apache configuration:

<FilesMatch ".+\.ph(p3?|tml)$">
    SetInputFilter PHP
    SetOutputFilter PHP
</FilesMatch>
honk
  • 9,137
  • 11
  • 75
  • 83
2

To add to Blaine's answer (as I can't yet comment):

I believe this is an Apache configuration issue, not specific to Chrome.

I recently experienced this issue, and noted the following effects in various clients, again only with the home page:

  • Chrome, as stated, displayed the ERR_INCOMPLETE_CHUNKED_ENCODING error, but also didn't display the page correctly. The page continued to "load" for another 5 seconds even after all the content was visible.
  • A simple CURL request outputted the error curl: (18) transfer closed with outstanding read data remaining. The full HTML appeared, followed by the error after a delay.
  • Firefox and IE initially displayed the page incorrectly, as with Chrome, and again had the ~5 second additional loading time. However, after this period, the page suddenly reformatted itself correctly. No errors were seen in the respective developer consoles.

The solution to set the DirectoryIndex to the same location as FallbackResource resolved this for all clients.

Edit: An alternative if using mod_rewrite is to use something like RewriteRule ^$ index.php which will avoid affecting all subdirectories.

I don't know whether this is expected behaviour of Apache or a bug.

emorris
  • 744
  • 6
  • 12
0

In my json response '\n' causing the issue. So after removing it, issue has been solved.

Bunty
  • 1,549
  • 13
  • 18